application-manager-new
Menaka Madushanka 9 years ago
commit b99001ae8d

@ -32,7 +32,7 @@
<url>http://wso2.org</url> <url>http://wso2.org</url>
<modules> <modules>
<!-- maven module of your device-type --> <!-- STEP#1 ADD THE LOCATION OF YOUR DEVICE-TYPE -->
<module>samples/connectedcup</module> <module>samples/connectedcup</module>
<module>samples/currentsensor</module> <module>samples/currentsensor</module>
</modules> </modules>
@ -43,7 +43,6 @@
<groupId>org.wso2.maven</groupId> <groupId>org.wso2.maven</groupId>
<artifactId>carbon-p2-plugin</artifactId> <artifactId>carbon-p2-plugin</artifactId>
<version>1.5.3</version> <version>1.5.3</version>
<executions> <executions>
<execution> <execution>
<id>2-p2-repo-generation</id> <id>2-p2-repo-generation</id>
@ -59,7 +58,7 @@
<featureArtifacts> <featureArtifacts>
<featureArtifactDef> <featureArtifactDef>
<!-- STEP#1. ADD YOUR DEVICE TYPE FEATURE HERE "< GROUP_ID:ARTIFACT_ID:VERSION >" --> <!-- STEP#2. ADD YOUR DEVICE TYPE FEATURE HERE "< GROUP_ID:ARTIFACT_ID:VERSION >" -->
org.wso2.carbon.devicemgt-plugins:org.coffeeking.connectedcup.feature:2.0.4-SNAPSHOT org.wso2.carbon.devicemgt-plugins:org.coffeeking.connectedcup.feature:2.0.4-SNAPSHOT
</featureArtifactDef> </featureArtifactDef>
<featureArtifactDef> <featureArtifactDef>
@ -89,7 +88,7 @@
<destination>repository/components</destination> <destination>repository/components</destination>
<deleteOldProfileFiles>true</deleteOldProfileFiles> <deleteOldProfileFiles>true</deleteOldProfileFiles>
<features> <features>
<!-- STEP#2. ADD YOUR DEVICE TYPE FEATURE GROUP HERE "<ARTIFACT_ID>.group" --> <!-- STEP#3. ADD YOUR DEVICE TYPE FEATURE GROUP HERE "<ARTIFACT_ID>.group" -->
<feature> <feature>
<id>org.coffeeking.connectedcup.feature.group</id> <id>org.coffeeking.connectedcup.feature.group</id>
<version>2.0.4-SNAPSHOT</version> <version>2.0.4-SNAPSHOT</version>

@ -1,16 +1,18 @@
# cdmf-devicetype-archetype # cdmf-devicetype-archetype
To install this maven archetype To install this maven archetype
go to this folder cdmf-devicetype-archetype
go to this folder `cdmf-devicetype-archetype`
mvn clean install mvn clean install
To create new project To create new project
go to this folder /wso2iots-1.0.0-SNAPSHOT/samples
go to this folder `/wso2iots-1.0.0-SNAPSHOT/samples`
mvn archetype:generate -DarchetypeCatalog=local mvn archetype:generate -DarchetypeCatalog=local
Then select the cdmf.devicetype:cdmf-devicetype-archetype as new archetype. Then you need to provide groupId, artifactId, Then select the `cdmf.devicetype:cdmf-devicetype-archetype` as new archetype. Then you need to provide groupId, artifactId,
version, packaging, name of your device type and name for sensor as shown bellow. version, packaging, name of your device type and name for sensor as shown bellow.
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 3 Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 3
@ -30,20 +32,28 @@ version, packaging, name of your device type and name for sensor as shown bellow
To install sample app into IOTS To install sample app into IOTS
open '`device-deployer.xml` which is located in wso2iots-1.0.0-SNAPSHOT directory open `device-deployer.xml` which is located in wso2iots-1.0.0-SNAPSHOT directory
Under featureArtifacts tag add feature artifact definition as below
Under modules tag add name of sample which you created as module
<module>samples/safeLocker</module>
Under featureArtifacts tag add feature artifact definition as below
<featureArtifactDef> <featureArtifactDef>
org.homeautomation:org.homeautomation.safeLocker.feature:1.0.0-SNAPSHOT org.homeautomation:org.homeautomation.safeLocker.feature:1.0.0-SNAPSHOT
</featureArtifactDef> </featureArtifactDef>
Under features tag add feature group definition as below Under features tag add feature group definition as below
<feature> <feature>
<id>org.homeautomation.safeLocker.feature.group</id> <id>org.homeautomation.safeLocker.feature.group</id>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</feature> </feature>
mvn clean install -f device-deployer.xml Finally to deploy sample device type into IoT Server
mvn clean install -f device-deployer.xml
Note: This command should be executed place where `device-deployer.xml` is located

@ -28,8 +28,8 @@
<groupId>cdmf.devicetype</groupId> <groupId>cdmf.devicetype</groupId>
<artifactId>cdmf-devicetype-archetype</artifactId> <artifactId>cdmf-devicetype-archetype</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<name>Archetype of WSO2 CDMF Device Type</name> <name>WSO2 CDMF Device Type Archetype</name>
<description>Archetype of WSO2 CDMF Device Type</description> <description>WSO2 CDMF Device Type Archetype</description>
<packaging>maven-archetype</packaging> <packaging>maven-archetype</packaging>
<organization> <organization>
<name>WSO2 Inc.</name> <name>WSO2 Inc.</name>

@ -21,7 +21,7 @@
<requiredProperty key="nameOfTheSensor"></requiredProperty> <requiredProperty key="nameOfTheSensor"></requiredProperty>
</requiredProperties> </requiredProperties>
<modules> <modules>
<module id="component" dir="component" name="component"> <module id="${rootArtifactId}-component" dir="component" name="${rootArtifactId}-component">
<modules> <modules>
<module id="${groupId}.${rootArtifactId}.plugin" dir="plugin" <module id="${groupId}.${rootArtifactId}.plugin" dir="plugin"
name="${groupId}.${rootArtifactId}.plugin"> name="${groupId}.${rootArtifactId}.plugin">
@ -149,7 +149,7 @@
</module> </module>
</modules> </modules>
</module> </module>
<module id="feature" dir="feature" name="feature"> <module id="${rootArtifactId}-feature" dir="feature" name="${rootArtifactId}-feature">
<modules> <modules>
<module id="${groupId}.${rootArtifactId}.feature" dir="feature" <module id="${groupId}.${rootArtifactId}.feature" dir="feature"
name="${groupId}.${rootArtifactId}.feature"> name="${groupId}.${rootArtifactId}.feature">

@ -19,7 +19,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>${groupId}</groupId> <groupId>${groupId}</groupId>
<artifactId>component</artifactId> <artifactId>${rootArtifactId}-component</artifactId>
<version>${version}</version> <version>${version}</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -19,7 +19,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>${groupId}</groupId> <groupId>${groupId}</groupId>
<artifactId>component</artifactId> <artifactId>${rootArtifactId}-component</artifactId>
<version>${version}</version> <version>${version}</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -142,15 +142,10 @@ public class ControllerService {
@POST @POST
@Consumes(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON)
public void pushData(final DeviceJSON agentInfo, @Context HttpServletResponse response) { public void pushData(final DeviceJSON agentInfo, @Context HttpServletResponse response) {
String owner = agentInfo.owner; if (!ServiceUtils.publishToDASSensorValue(agentInfo.owner, agentInfo.deviceId, agentInfo.sensorValue)) {
String deviceId = agentInfo.deviceId;
float pinData = agentInfo.sensorValue;
log.warn(pinData);
log.warn(String.valueOf(pinData));
if (!ServiceUtils.publishToDASSensorValue(agentInfo.owner, agentInfo.deviceId, pinData)) {
response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
log.warn("An error occurred whilst trying to publish pin data of go Data with ID [" + deviceId + log.warn("An error occurred whilst trying to publish pin data of go Data with ID [" + agentInfo.deviceId +
"] of owner [" + owner + "]"); "] of owner [" + agentInfo.owner + "]");
} }
} }
@ -170,7 +165,6 @@ public class ControllerService {
@Context HttpServletResponse response) { @Context HttpServletResponse response) {
try { try {
mqttConnector.sendCommandViaMQTT(owner, deviceId, "Sensor:", state.toUpperCase()); mqttConnector.sendCommandViaMQTT(owner, deviceId, "Sensor:", state.toUpperCase());
response.setStatus(Response.Status.OK.getStatusCode()); response.setStatus(Response.Status.OK.getStatusCode());
} catch (DeviceManagementException e) { } catch (DeviceManagementException e) {
log.error(e); log.error(e);

@ -19,7 +19,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>${groupId}</groupId> <groupId>${groupId}</groupId>
<artifactId>component</artifactId> <artifactId>${rootArtifactId}-component</artifactId>
<version>${version}</version> <version>${version}</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -19,7 +19,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>${groupId}</groupId> <groupId>${groupId}</groupId>
<artifactId>component</artifactId> <artifactId>${rootArtifactId}-component</artifactId>
<version>${version}</version> <version>${version}</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
@ -56,7 +56,7 @@
<Bundle-Name>${artifactId}</Bundle-Name> <Bundle-Name>${artifactId}</Bundle-Name>
<Bundle-Version>${version}</Bundle-Version> <Bundle-Version>${version}</Bundle-Version>
<Bundle-Description>IoT Server Impl Bundle</Bundle-Description> <Bundle-Description>IoT Server Impl Bundle</Bundle-Description>
<Private-Package>${groupId}.${rootArtifactId}.plugin.internal</Private-Package> <Private-Package>${project-base-package}.plugin.internal</Private-Package>
<Import-Package> <Import-Package>
org.osgi.framework, org.osgi.framework,
org.osgi.service.component, org.osgi.service.component,
@ -73,8 +73,8 @@
org.wso2.carbon.device.mgt.iot.*, org.wso2.carbon.device.mgt.iot.*,
</Import-Package> </Import-Package>
<Export-Package> <Export-Package>
!${groupId}.${rootArtifactId}.plugin.internal, !${project-base-package}.plugin.internal,
${groupId}.${rootArtifactId}.plugin.* ${project-base-package}.plugin.*
</Export-Package> </Export-Package>
</instructions> </instructions>
</configuration> </configuration>

@ -25,7 +25,7 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>${version}</version> <version>${version}</version>
<artifactId>${artifactId}</artifactId> <artifactId>${rootArtifactId}-component</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<build> <build>
<pluginManagement> <pluginManagement>

@ -21,7 +21,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent> <parent>
<groupId>${groupId}</groupId> <groupId>${groupId}</groupId>
<artifactId>component</artifactId> <artifactId>${rootArtifactId}-component</artifactId>
<version>${version}</version> <version>${version}</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -19,7 +19,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>${groupId}</groupId> <groupId>${groupId}</groupId>
<artifactId>feature</artifactId> <artifactId>${rootArtifactId}-feature</artifactId>
<version>${version}</version> <version>${version}</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

@ -23,7 +23,7 @@
<version>${version}</version> <version>${version}</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<artifactId>${artifactId}</artifactId> <artifactId>${rootArtifactId}-feature</artifactId>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>${version}</version> <version>${version}</version>

Loading…
Cancel
Save