diff --git a/modules/tools/cdmf-devicetype-archetype/README.md b/modules/tools/cdmf-devicetype-archetype/README.md new file mode 100644 index 00000000..e9e81d48 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/README.md @@ -0,0 +1,25 @@ +# multi-module-maven-archetype example + + +To create new project + + mvn archetype:generate -DarchetypeCatalog=local + +Then select the cdmf.devicetype:cdmf-devicetype-archetype as new archetype. Then you need to provide groupId, artifactId, version and packaging as shown bellow. + + Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 3 + Define value for property 'groupId': : org.coffeeking + Define value for property 'artifactId': : connectedcup + Define value for property 'version': 1.0-SNAPSHOT: : 1.0.0-SNAPSHOT + Define value for property 'package': org.coffeeking: : + Confirm properties configuration: + groupId: org.coffeeking + artifactId: connectedcup + version: 1.0.0-SNAPSHOT + package: org.coffeeking + Y: : Y + + + + + diff --git a/modules/tools/cdmf-devicetype-archetype/pom.xml b/modules/tools/cdmf-devicetype-archetype/pom.xml new file mode 100644 index 00000000..d9255a41 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/pom.xml @@ -0,0 +1,66 @@ + + + + + org.wso2.iot + wso2cdmf-tools + 1.0.0-SNAPSHOT + ../pom.xml + + 4.0.0 + cdmf.devicetype + cdmf-devicetype-archetype + 1.0.0-SNAPSHOT + Archetype of WSO2 CDMF Device Type + Archetype of WSO2 CDMF Device Type + maven-archetype + + WSO2 Inc. + http://www.wso2.com + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + org.apache.maven.archetype + archetype-packaging + ${archetype.packaging.version} + + + + + + maven-archetype-plugin + ${archetype.plugin.version} + + + + + + 2.4 + 2.4 + + \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 00000000..41220ebb --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,165 @@ + + + + + + + + installer + + **/*.xml + + + + + + + + + + src/main/java + + **/*.java + + + + src/main/resources + + + src/test/java + + + src/test/resources + + + + + + + src/main/java + + **/*.java + + + + src/main/webapp + + **/*.xml + + + + src/main/resources + + + src/test/java + + + src/test/resources + + + + + + + src/main/java + + **/*.java + + + + src/main/webapp + + **/*.xml + + + + src/main/resources + + + src/test/java + + + src/test/resources + + + + + + + src/main/java + + **/*.java + + + + src/main/webapp + + **/*.jsp + **/*.xml + + + + src/main/resources + + + src/test/java + + + src/test/resources + + + + + + + + + + + + + build.xml + + + + + + + + src/main/resources + + **/*.xml + **/*.properties + **/*.car + **/*.db + **/*.sql + **/*.png + **/*.json + **/*.js + **/*.inf + **/*.sh + **/*.hbs + + + + + + + + \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/agent/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/agent/pom.xml new file mode 100644 index 00000000..27dc1eef --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/agent/pom.xml @@ -0,0 +1,59 @@ + + + + ${groupId} + component + ${version} + ../pom.xml + + 4.0.0 + ${artifactId} + ${version} + ${artifactId} + war + + + junit + junit + ${junit.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${wso2.maven.compiler.source} + ${wso2.maven.compiler.target} + + + + maven-war-plugin + ${maven-war-plugin.version} + + ${artifactId}_agent + + + + + \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/agent/src/main/webapp/WEB-INF/web.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/agent/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..f39e4103 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/agent/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,23 @@ + + + Sample-Agent-Webapp + diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/agent/src/main/webapp/index.jsp b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/agent/src/main/webapp/index.jsp new file mode 100644 index 00000000..fa3b38f0 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/agent/src/main/webapp/index.jsp @@ -0,0 +1,22 @@ +<%--/* +* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +* +* WSO2 Inc. licenses this file to you under the Apache License, +* Version 2.0 (the "License"); you may not use this file except +* in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/--%> + + +

Hello World!

+ + \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/pom.xml new file mode 100644 index 00000000..17fa04be --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/pom.xml @@ -0,0 +1,53 @@ + + + + ${groupId} + component + ${version} + ../pom.xml + + 4.0.0 + ${artifactId} + ${version} + war + ${artifactId} API + http://wso2.com + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + UTF-8 + ${wso2.maven.compiler.source} + ${wso2.maven.compiler.target} + + + + maven-war-plugin + ${maven-war-plugin.version} + + ${artifactId} + + + + + \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/src/main/webapp/META-INF/webapp-classloading.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/src/main/webapp/META-INF/webapp-classloading.xml new file mode 100644 index 00000000..01f27b48 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/src/main/webapp/META-INF/webapp-classloading.xml @@ -0,0 +1,34 @@ + + + + + + + + false + + + CXF,Carbon + diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/src/main/webapp/WEB-INF/web.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..5b0899bf --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/controller/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,70 @@ + + + + Sample-Webapp-Controller + + JAX-WS/JAX-RS Endpoint + JAX-WS/JAX-RS Servlet + CXFServlet + + org.apache.cxf.transport.servlet.CXFServlet + + 1 + + + CXFServlet + /* + + + + isAdminService + false + + + doAuthentication + false + + + + + managed-api-enabled + true + + + managed-api-owner + admin + + + + managed-api-context-template + /sampleapp/{version} + + + managed-api-application + sampleapp + + + managed-api-isSecured + true + + + diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/manager/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/manager/pom.xml new file mode 100644 index 00000000..902c8a55 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/manager/pom.xml @@ -0,0 +1,61 @@ + + + + ${groupId} + component + ${version} + ../pom.xml + + 4.0.0 + ${artifactId} + war + ${version} + ${artifactId} + http://wso2.org + + ${basedir}/src/main/java + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + UTF-8 + ${wso2.maven.compiler.source} + ${wso2.maven.compiler.target} + + + + maven-war-plugin + ${maven-war-plugin.version} + + ${artifactId}_mgt + + + + + + + ${groupId} + ${project-base-package}.plugin + ${version} + + + \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/manager/src/main/webapp/META-INF/webapp-classloading.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/manager/src/main/webapp/META-INF/webapp-classloading.xml new file mode 100644 index 00000000..01f27b48 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/manager/src/main/webapp/META-INF/webapp-classloading.xml @@ -0,0 +1,34 @@ + + + + + + + + false + + + CXF,Carbon + diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/manager/src/main/webapp/WEB-INF/web.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/manager/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..ed2e3a26 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/manager/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,70 @@ + + + + Sample-Webapp-Manager + + JAX-WS/JAX-RS Endpoint + JAX-WS/JAX-RS Servlet + CXFServlet + + org.apache.cxf.transport.servlet.CXFServlet + + 1 + + + CXFServlet + /* + + + + isAdminService + false + + + doAuthentication + false + + + + + managed-api-enabled + false + + + managed-api-owner + admin + + + + managed-api-context-template + /sampleapp/{version} + + + managed-api-application + sampleapp + + + managed-api-isSecured + true + + + diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/plugin/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/plugin/pom.xml new file mode 100644 index 00000000..31efbf47 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/plugin/pom.xml @@ -0,0 +1,68 @@ + + + + ${groupId} + component + ${version} + ../pom.xml + + 4.0.0 + ${version} + ${artifactId} + bundle + ${artifactId} for CDMF + http://wso2.org + + ${artifactId} + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + UTF-8 + ${wso2.maven.compiler.source} + ${wso2.maven.compiler.target} + + + + org.apache.felix + maven-bundle-plugin + ${org.apache.felix.version} + true + + + ${artifactId} + ${artifactId} + ${version} + IoT Server Impl Bundle + ${package}.${rootArtifactId}.plugin.internal + + + + !${package}.${rootArtifactId}.plugin.internal, + ${package}.${rootArtifactId}.plugin.* + + + + + + + \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/plugin/src/main/java/__rootArtifactId__/plugin/internal/ServiceComponent.java b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/plugin/src/main/java/__rootArtifactId__/plugin/internal/ServiceComponent.java new file mode 100644 index 00000000..f823f7e6 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/plugin/src/main/java/__rootArtifactId__/plugin/internal/ServiceComponent.java @@ -0,0 +1,21 @@ +package ${package}.${rootArtifactId}.plugin.internal; +/* + * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +public class ServiceComponent{ + +} \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/pom.xml new file mode 100644 index 00000000..4028ecf2 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/pom.xml @@ -0,0 +1,13 @@ + + + ${groupId} + ${rootArtifactId} + ${version} + ../pom.xml + + 4.0.0 + ${version} + ${artifactId} + pom + \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/analytics/build.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/analytics/build.xml new file mode 100644 index 00000000..9e3e6168 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/analytics/build.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/analytics/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/analytics/pom.xml new file mode 100644 index 00000000..7c5799cb --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/analytics/pom.xml @@ -0,0 +1,66 @@ + + + + ${groupId} + feature + ${version} + ../pom.xml + + 4.0.0 + ${artifactId} + ${version} + pom + ${artifactId} + http://wso2.org + + + + maven-clean-plugin + ${maven-clean-plugin.version} + + + auto-clean + initialize + + clean + + + + + + maven-antrun-plugin + ${wso2.maven.compiler.source} + + + process-resources + + + + + + + run + + + + + + + \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/pom.xml new file mode 100644 index 00000000..b8b250c5 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/pom.xml @@ -0,0 +1,220 @@ + + + + ${groupId} + feature + ${version} + ../pom.xml + + 4.0.0 + ${version} + ${artifactId} + pom + ${project.artifactId} + http://wso2.org + + + ${groupId} + ${project-base-package}.plugin + ${version} + + + ${groupId} + ${project-base-package}.manager + ${version} + war + + + ${groupId} + ${project-base-package}.controller + ${version} + war + + + ${groupId} + ${project-base-package}.agent + ${version} + war + + + com.h2database.wso2 + h2-database-engine + 1.2.140.wso2v3 + + + + + + maven-resources-plugin + + + copy-resources + generate-resources + + copy-resources + + + src/main/resources + + + resources + + build.properties + p2.inf + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-jaxrs-manager-war + package + + copy + + + + + ${groupId} + ${project-base-package}.manager + war + true + ${basedir}/src/main/resources/webapps/ + ${rootArtifactId}_mgt.war + + + + + + copy-jaxrs-controller-war + package + + copy + + + + + ${groupId} + ${project-base-package}.controller + war + true + ${basedir}/src/main/resources/webapps/ + ${rootArtifactId}.war + + + + + + copy-jaxrs-agent-war + package + + copy + + + + + ${groupId} + ${project-base-package}.agent + war + true + ${basedir}/src/main/resources/webapps/ + ${rootArtifactId}_agent.war + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + ${maven-antrun-plugin.version} + + + create-${deviceType}-plugin-mgt-schema + package + + run + + + + + + + + + + + + + + + + + + + + + org.wso2.maven + carbon-p2-plugin + + + p2-feature-generation + package + + p2-feature-gen + + + ${project-base-package} + ../../../features/etc/feature.properties + + + org.wso2.carbon.p2.category.type:server + org.eclipse.equinox.p2.type.group:false + + + + + ${groupId}:${project-base-package}.plugin:${version} + + + + org.wso2.carbon.core.server:${carbon.kernel.version} + + org.wso2.carbon.device.mgt.server:${carbon.device.mgt.version} + + + + + + + + + \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/agent/deviceConfig.properties b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/agent/deviceConfig.properties new file mode 100644 index 00000000..49311a31 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/agent/deviceConfig.properties @@ -0,0 +1,29 @@ +# +# Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +[Device-Configurations] +owner=${DEVICE_OWNER} +deviceId=${DEVICE_ID} +device-name=${DEVICE_NAME} +controller-context=/${deviceType}/controller +mqtt-ep=${MQTT_EP} +auth-method=token +auth-token=${DEVICE_TOKEN} +refresh-token=${DEVICE_REFRESH_TOKEN} +push-interval=15 + + diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/agent/sketch.properties b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/agent/sketch.properties new file mode 100644 index 00000000..de71dfbd --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/agent/sketch.properties @@ -0,0 +1,16 @@ +#/* +# * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +# * WSO2 Inc. licenses this file to you under the Apache License, +# * Version 2.0 (the "License"); you may not use this file except +# * in compliance with the License. +# * You may obtain a copy of the License at +# * http://www.apache.org/licenses/LICENSE-2.0 +# * Unless required by applicable law or agreed to in writing, +# * software distributed under the License is distributed on an +# * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# * KIND, either express or implied. See the License for the +# * specific language governing permissions and limitations +# * under the License. +# */ +templates=deviceConfig.properties +zipfilename=${deviceType}.zip diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/build.properties b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/build.properties new file mode 100644 index 00000000..a7e289bc --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/build.properties @@ -0,0 +1,18 @@ +# +custom = true diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/configs/__deviceType__.json b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/configs/__deviceType__.json new file mode 100644 index 00000000..eae77b20 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/configs/__deviceType__.json @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +{ + "deviceType": { + "label": "", + "category": "virtual", + }, + "analyticStreams": [ + ] +} \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/configs/__deviceType__.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/configs/__deviceType__.xml new file mode 100644 index 00000000..e302e014 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/configs/__deviceType__.xml @@ -0,0 +1,24 @@ + + + + + + jdbc/${deviceType}DM_DB + + diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/datasources/__deviceType__-datasources.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/datasources/__deviceType__-datasources.xml new file mode 100644 index 00000000..f69cb16e --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/datasources/__deviceType__-datasources.xml @@ -0,0 +1,46 @@ + + + + + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader + + + + ${deviceType}DM_DB + The datasource used for the this device type + + jdbc/${deviceType}DM_DB + + + + jdbc:h2:repository/database/${deviceType}DM_DB;DB_CLOSE_ON_EXIT=FALSE + + wso2carbon + wso2carbon + org.h2.Driver + 50 + 60000 + true + SELECT 1 + 30000 + + + + + diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/dbscripts/h2.sql b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/dbscripts/h2.sql new file mode 100644 index 00000000..7fdf935a --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/dbscripts/h2.sql @@ -0,0 +1,11 @@ + +-- ----------------------------------------------------- +-- Agent Database +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `${deviceType}_DEVICE` ( + `${deviceType}_DEVICE_ID` VARCHAR(45) NOT NULL , + `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL, + PRIMARY KEY (`${deviceType}_DEVICE_ID`) ); + + + diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/dbscripts/mysql.sql b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/dbscripts/mysql.sql new file mode 100644 index 00000000..007f9246 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/dbscripts/mysql.sql @@ -0,0 +1,12 @@ +-- ----------------------------------------------------- +-- Agent Database +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `${deviceType}_DEVICE` ( + `${deviceType}_DEVICE_ID` VARCHAR(45) NOT NULL , + `DEVICE_NAME` VARCHAR(100) NULL DEFAULT NULL, + PRIMARY KEY (`${deviceType}_DEVICE_ID`) ) +ENGINE = InnoDB; + + + + diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.device-view/device-view.hbs b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.device-view/device-view.hbs new file mode 100644 index 00000000..3793cad4 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.device-view/device-view.hbs @@ -0,0 +1,94 @@ +{{#zone "topCss"}} + +{{/zone}} + +{{#zone "device-thumbnail"}} + +{{/zone}} + +{{#zone "device-opetations"}} +
+ Operations +
+ +{{/zone}} +{{#zone "device-detail-properties"}} +
+
+ +
+
+
+ +
+
Device Statistics
+ {{unit "iot.unit.device.stats" device=device}} +
+ +
+
Policy Compliance
+
+ +
+
+ Not available yet +
+
+
+
+
+
+
Operations Log
+
+ +
+
+ Not available yet +
+
+
+
+
+
+
+
+{{/zone}} + + diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.device-view/device-view.js b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.device-view/device-view.js new file mode 100644 index 00000000..a1d45de2 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.device-view/device-view.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +function onRequest(context) { + var log = new Log("detail.js"); + var deviceType = context.uriParams.deviceType; + var deviceId = request.getParameter("id"); + + if (deviceType != null && deviceType != undefined && deviceId != null && deviceId != undefined) { + var deviceModule = require("/app/modules/device.js").deviceModule; + var device = deviceModule.viewDevice(deviceType, deviceId); + + if (device && device.status != "error") { + log.info(device); + var deviceProperties = device.properties; + device.accessToken = deviceProperties.accessToken + return {"device": device}; + } + } +} \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.device-view/device-view.json b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.device-view/device-view.json new file mode 100644 index 00000000..2def3808 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.device-view/device-view.json @@ -0,0 +1,20 @@ +/**/ +{ + "version": "1.0.0" +} \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.device-view/public/images/thumb.png b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.device-view/public/images/thumb.png new file mode 100644 index 00000000..7dda85e4 Binary files /dev/null and b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.device-view/public/images/thumb.png differ diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.type-view/public/images/thumb.png b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.type-view/public/images/thumb.png new file mode 100644 index 00000000..7dda85e4 Binary files /dev/null and b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.type-view/public/images/thumb.png differ diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.type-view/public/js/download.js b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.type-view/public/js/download.js new file mode 100644 index 00000000..e69de29b diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.type-view/type-view.hbs b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.type-view/type-view.hbs new file mode 100644 index 00000000..85dddee7 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.type-view/type-view.hbs @@ -0,0 +1,267 @@ + + +
+

Name of your device type

+
+

device type

+
+
+ +
+
+

Ingredients

+
+

Hardware Requirements

+
+ +
+ + View API   + Create an Instance + +
+ +
+ + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +

+
+ +
+

Prepare


+

Get your device ready

+
+ +
+
+ +
+

Schematic Diagram


+

Click on the image to zoom

+
+ +
+
+
+ +
+

Connect (Quick Start)


+

Internet of Things Foundation Quickstart connection

+
+ +
+
+ + + + + + + +{{#zone "bottomJs"}} + {{js "/js/download.js"}} + {{js "/js/jquery.validate.js"}} +{{/zone}} + + + diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.type-view/type-view.json b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.type-view/type-view.json new file mode 100644 index 00000000..2def3808 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.__deviceType__.type-view/type-view.json @@ -0,0 +1,20 @@ +/**/ +{ + "version": "1.0.0" +} \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/p2.inf b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/p2.inf new file mode 100644 index 00000000..a94662de --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/p2.inf @@ -0,0 +1,14 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../conf/device-types/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/${groupId}.${rootArtifactId}_${feature.version}/configs/,target:${installFolder}/../../conf/device-types/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/webapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/${groupId}.${rootArtifactId}_${feature.version}/webapps/,target:${installFolder}/../../deployment/server/webapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/sketches/);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/sketches/${rootArtifactId}/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/${groupId}.${rootArtifactId}_${feature.version}/agent/,target:${installFolder}/../../resources/sketches/${deviceType}/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/${groupId}.${rootArtifactId}_${feature.version}/dbscripts/,target:${installFolder}/../../../dbscripts/cdm/plugins/${deviceType},overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/${groupId}.${rootArtifactId}_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/jaggeryapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/${groupId}.${rootArtifactId}_${feature.version}/jaggeryapps/,target:${installFolder}/../../deployment/server/jaggeryapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../database/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/${groupId}.${rootArtifactId}_${feature.version}/database/,target:${installFolder}/../../database/,overwrite:true);\ \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/pom.xml new file mode 100644 index 00000000..530e9007 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/pom.xml @@ -0,0 +1,30 @@ + + + + ${groupId} + ${rootArtifactId} + ${version} + ../pom.xml + + ${artifactId} + 4.0.0 + pom + ${version} + \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/installer/device-deployer.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/installer/device-deployer.xml new file mode 100644 index 00000000..aec0d951 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/installer/device-deployer.xml @@ -0,0 +1,139 @@ + + + + + org.wso2 + wso2 + 1 + + 4.0.0 + ${groupId} + devicetype-feature-installation + ${version} + pom + Creating custom distribution + http://wso2.org + + + samples/${rootArtifactId} + + + + + org.wso2.maven + carbon-p2-plugin + 1.5.3 + + + + 2-p2-repo-generation + package + + p2-repo-gen + + + file:${basedir}/samples/p2-repo + file:${basedir}/samples/p2-repo + true + true + + + + + ${groupId}:${groupId}.${rootArtifactId}.feature:${version} + + + + + + + + + org.wso2.maven + carbon-p2-plugin + 1.5.3 + + + feature-install + package + + p2-profile-gen + + + default + file:${basedir}/samples/p2-repo + file:${basedir}/samples/p2-repo + repository/components + true + + + + ${groupId}.${rootArtifactId}.feature.group + ${version} + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.1 + + + package + + + + + + + + + run + + + + + + + + + wso2-nexus + WSO2 internal Repository + http://maven.wso2.org/nexus/content/groups/wso2-public/ + + true + daily + ignore + + + + + + wso2-maven2-repository + http://dist.wso2.org/maven2 + + + wso2-maven2-snapshot-repository + http://dist.wso2.org/snapshots/maven2 + + + \ No newline at end of file diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 00000000..db424711 --- /dev/null +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,132 @@ + + + ${groupId} + ${artifactId} + ${version} + pom + 4.0.0 + http://wso2.com + + component + feature + + + 1.7 + 1.7 + ${groupId}.${rootArtifactId} + 3.8.1 + 1.0.0 + 4.4.2 + 0.9.2-SNAPSHOT + 1.4.0 + 2.4.1 + 2.3.2 + 2.6 + 1.8 + + + + wso2.releases + WSO2 internal Repository + http://maven.wso2.org/nexus/content/repositories/releases/ + + true + daily + ignore + + + + wso2.snapshots + Apache Snapshot Repository + http://maven.wso2.org/nexus/content/repositories/snapshots/ + + true + daily + + + false + + + + wso2-nexus + WSO2 internal Repository + http://maven.wso2.org/nexus/content/groups/wso2-public/ + + true + daily + ignore + + + + + + + wso2-nexus + WSO2 internal Repository + http://maven.wso2.org/nexus/content/groups/wso2-public/ + + true + daily + ignore + + + + wso2.releases + WSO2 internal Repository + http://maven.wso2.org/nexus/content/repositories/releases/ + + true + daily + ignore + + + + wso2.snapshots + WSO2 Snapshot Repository + http://maven.wso2.org/nexus/content/repositories/snapshots/ + + true + daily + + + false + + + + gcm-server-repository + GCM Server repository - GitHub + https://github.com/slorber/gcm-server-repository/raw/master/releases/ + + + wso2-staging + WSO2 internal Repository + http://maven.wso2.org/nexus/content/repositories/orgwso2carbonapimgt-174/ + + true + daily + ignore + + + + \ No newline at end of file diff --git a/modules/tools/mdm-android-agent-archetype/pom.xml b/modules/tools/mdm-android-agent-archetype/pom.xml index 733a2689..772ae90f 100644 --- a/modules/tools/mdm-android-agent-archetype/pom.xml +++ b/modules/tools/mdm-android-agent-archetype/pom.xml @@ -21,9 +21,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - org.wso2.mdm - wso2mdm-tools - 2.0.0-SNAPSHOT + org.wso2.iot + wso2cdm-tools + 1.0.0-SNAPSHOT ../pom.xml diff --git a/modules/tools/pom.xml b/modules/tools/pom.xml index 149ed722..86ff9469 100644 --- a/modules/tools/pom.xml +++ b/modules/tools/pom.xml @@ -26,17 +26,16 @@ 1.0.0-SNAPSHOT ../../pom.xml - 4.0.0 - org.wso2.mdm - wso2mdm-tools + org.wso2.iot + wso2cdmf-tools pom - 2.0.0-SNAPSHOT - WSO2 MDM Tools + 1.0.0-SNAPSHOT + WSO2 CDMF Tools http://maven.apache.org - mdm-android-agent-archetype + cdmf-devicetype-archetype