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..e23abc8b
--- /dev/null
+++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+
+
+ 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..99a734b2
--- /dev/null
+++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/agent/pom.xml
@@ -0,0 +1,58 @@
+
+
+
+ ${groupId}
+ component
+ ${version}
+ ../pom.xml
+
+ 4.0.0
+ ${artifactId}
+ ${version}
+ ${artifactId}
+
+
+ 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}
+
+
+
+
+
\ 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..adfe7878
--- /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}
+
+
+
+
+
+
+ ${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..6e9e696d
--- /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}
+ ${carbon.iot.device.mgt.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..b659470e
--- /dev/null
+++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/pom.xml
@@ -0,0 +1,57 @@
+
+
+
+ ${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
+
+
+
\ 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..46e92d4b
--- /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=/digital_display/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..77fb5058
--- /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=Agent.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/__rootArtifactId__.json b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/configs/__rootArtifactId__.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/__rootArtifactId__.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/__rootArtifactId__.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/configs/__rootArtifactId__.xml
new file mode 100644
index 00000000..95e326ab
--- /dev/null
+++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/configs/__rootArtifactId__.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+ jdbc/device_typeDM_DB
+
+
+
diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/datasources/__rootArtifactId__-datasources.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/datasources/__rootArtifactId__-datasources.xml
new file mode 100644
index 00000000..96d9b3b4
--- /dev/null
+++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/datasources/__rootArtifactId__-datasources.xml
@@ -0,0 +1,46 @@
+
+
+
+
+ org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader
+
+
+
+ ${rootArtifactId}DM_DB
+ The datasource used for the this device type
+
+ jdbc/device_typeDM_DB
+
+
+
+ jdbc:h2:repository/database/device_typeDM_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..fd40910d
--- /dev/null
+++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/dbscripts/h2.sql
@@ -0,0 +1,4 @@
+
+
+
+
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..3f2ff2d6
--- /dev/null
+++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/dbscripts/mysql.sql
@@ -0,0 +1,5 @@
+
+
+
+
+
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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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"}}
+
+{{/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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.type-view/type-view.hbs
@@ -0,0 +1,267 @@
+
+
+
+
Name of your device type
+
+
device type
+
+
+
+
+
+
Ingredients
+
+
Hardware Requirements
+
+
+
+
+
View API
+
Create an Instance
+
+
+
+
+
+
Name your device and download the agent from following link.
+
+
+
+
+
+
+
+
+
+
+
+
Please download the file from following link(Press CTRL+C).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Exception at backend. Try Later.
+
+
+
+
+
+
+
+
+
+
+
+
You have to log in first.
+
+
+
+
+
+
+
+
+
+
+
+
Action not permitted.
+
+
+
+
+
+
+
+
+
+
+
+
Device Sketch does not exist.
+
+
+
+
+
+
+
+
+
+
+
+
Unexpected error.
+
+
+
+
+
+
+
+
+
+
+
+
Prepare
+
Get your device ready
+
+
+
+
+
+
+
Schematic Diagram
+
Click on the image to zoom
+
+
+
+
+
+
+
+
Connect (Quick Start)
+
Internet of Things Foundation Quickstart connection
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Scan QR code to start enrollment
+
+
+ Please scan the QR code using your mobile device to retrieve enrollment URL.
+
+
+
+
+
+
+
+
+
+
+{{#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.__rootArtifactId__.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.__rootArtifactId__.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.__rootArtifactId__.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..dba0e65d
--- /dev/null
+++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/feature/feature/src/main/resources/p2.inf
@@ -0,0 +1,16 @@
+instructions.configure = \
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../conf/device-types/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/${package}.${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/${package}.${rootArtifactId}_${feature.version}/webapps/,target:${installFolder}/../../deployment/server/webapps/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/carbonapps/);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/${package}.${rootArtifactId}_${feature.version}/carbonapps/,target:${installFolder}/../../deployment/server/carbonapps/,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/${package}.${rootArtifactId}_${feature.version}/agent/,target:${installFolder}/../../resources/sketches/${rootArtifactId}/,overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/${package}.${rootArtifactId}_${feature.version}/dbscripts/,target:${installFolder}/../../../dbscripts/cdm/plugins/${rootArtifactId},overwrite:true);\
+org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/${package}.${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/${package}.${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/${package}.${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/pom.xml b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 00000000..c5507f72
--- /dev/null
+++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/pom.xml
@@ -0,0 +1,129 @@
+
+
+ ${groupId}
+ ${artifactId}
+ ${version}
+ pom
+ 4.0.0
+ http://wso2.com
+
+ component
+ feature
+
+
+ 1.7
+ 1.7
+ ${groupId}.${rootArtifactId}
+ 3.8.1
+ 1.0.0
+ 1.4.0
+ 2.4.1
+ 2.3.2
+ 2.6
+
+
+
+ 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