Removing some unnecessary sources from the analytics module.

application-manager-new
sinthuja 8 years ago
parent 7b4dfaf98f
commit e6d6c5f178

@ -70,7 +70,7 @@
<artifactItem>
<groupId>org.wso2.carbon</groupId>
<artifactId>wso2carbon-core</artifactId>
<version>${carbon.kernel.version}</version>
<version>${carbon.kernel.449.version}</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>target</outputDirectory>
@ -100,7 +100,7 @@
<include name="${project.artifactId}-${project.version}.zip"/>
</fileset>
</unzip>
<copy todir="target/wso2carbon-core-${carbon.kernel.version}/repository/components"
<copy todir="target/wso2carbon-core-${carbon.kernel.449.version}/repository/components"
overwrite="true">
<fileset
dir="${tempdir}/${project.artifactId}-${project.version}/repository/components">
@ -120,34 +120,34 @@
<!-- commenting "GetAllRolesOfUserEnabled" property to fix
https://wso2.org/jira/browse/IDENTITY-3489 -->
<replace
file="target/wso2carbon-core-${carbon.kernel.version}/repository/conf/user-mgt.xml"
file="target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/user-mgt.xml"
token="&lt;Property name=&quot;GetAllRolesOfUserEnabled&quot;&gt;true&lt;/Property&gt;"
value="&lt;!--Property name=&quot;GetAllRolesOfUserEnabled&quot;&gt;true&lt;/Property--&gt;"/>
<!-- Move IS UI to configure menu -->
<property name="tempdir2" value="target/identity-ui"/>
<mkdir dir="${tempdir2}"/>
<unzip src="target/wso2carbon-core-${carbon.kernel.version}/repository/components/plugins/org.wso2.carbon.user.mgt.ui_${identity.jar.version}.jar"
<unzip src="target/wso2carbon-core-${carbon.kernel.449.version}/repository/components/plugins/org.wso2.carbon.user.mgt.ui_${identity.jar.version}.jar"
dest="${tempdir2}"/>
<replace file="${tempdir2}/META-INF/component.xml"
token="&lt;parent-menu&gt;identity_menu&lt;/parent-menu&gt;"
value="&lt;parent-menu&gt;configure_menu&lt;/parent-menu&gt;"/>
<zip destfile="target/wso2carbon-core-${carbon.kernel.version}/repository/components/plugins/org.wso2.carbon.user.mgt.ui_${identity.jar.version}.jar"
<zip destfile="target/wso2carbon-core-${carbon.kernel.449.version}/repository/components/plugins/org.wso2.carbon.user.mgt.ui_${identity.jar.version}.jar"
basedir="${tempdir2}"/>
<unzip src="target/wso2carbon-core-${carbon.kernel.version}/repository/components/plugins/org.wso2.carbon.identity.user.store.configuration.ui_${identity.jar.version}.jar"
<unzip src="target/wso2carbon-core-${carbon.kernel.449.version}/repository/components/plugins/org.wso2.carbon.identity.user.store.configuration.ui_${identity.jar.version}.jar"
dest="${tempdir3}"/>
<replace file="${tempdir3}/META-INF/component.xml"
token="&lt;parent-menu&gt;identity_menu&lt;/parent-menu&gt;"
value="&lt;parent-menu&gt;configure_menu&lt;/parent-menu&gt;"/>
<zip destfile="target/wso2carbon-core-${carbon.kernel.version}/repository/components/plugins/org.wso2.carbon.identity.user.store.configuration.ui_${identity.jar.version}.jar"
<zip destfile="target/wso2carbon-core-${carbon.kernel.449.version}/repository/components/plugins/org.wso2.carbon.identity.user.store.configuration.ui_${identity.jar.version}.jar"
basedir="${tempdir3}"/>
<unzip src="target/wso2carbon-core-${carbon.kernel.version}/repository/components/plugins/org.wso2.carbon.security.mgt.ui_${identity.jar.version}.jar"
<unzip src="target/wso2carbon-core-${carbon.kernel.449.version}/repository/components/plugins/org.wso2.carbon.security.mgt.ui_${identity.jar.version}.jar"
dest="${tempdir4}"/>
<replace file="${tempdir4}/META-INF/component.xml"
token="&lt;parent-menu&gt;manage_menu&lt;/parent-menu&gt;"
value="&lt;parent-menu&gt;configure_menu&lt;/parent-menu&gt;"/>
<zip destfile="target/wso2carbon-core-${carbon.kernel.version}/repository/components/plugins/org.wso2.carbon.security.mgt.ui_${identity.jar.version}.jar"
<zip destfile="target/wso2carbon-core-${carbon.kernel.449.version}/repository/components/plugins/org.wso2.carbon.security.mgt.ui_${identity.jar.version}.jar"
basedir="${tempdir4}"/>
<concat destfile="target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/logging-bridge.properties"
<concat destfile="target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/etc/logging-bridge.properties"
append="true" fixlastline="true">org.restlet.level=SEVERE
</concat>
<delete dir="${tempdir4}"/>
@ -168,7 +168,7 @@
<delete dir="target/archive-tmp"/>
<delete dir="target/dependency-maven-plugin-markers"/>
<delete dir="target/maven-archiver"/>
<delete dir="target/wso2carbon-core-${carbon.kernel.version}"/>
<delete dir="target/wso2carbon-core-${carbon.kernel.449.version}"/>
<delete file="target/${project.artifactId}-${project.version}.jar"/>
<delete dir="target/sources"/>
<delete dir="target/site"/>

@ -24,7 +24,7 @@
<fileSets>
<fileSet>
<directory>target/wso2carbon-core-${carbon.kernel.version}</directory>
<directory>target/wso2carbon-core-${carbon.kernel.449.version}</directory>
<outputDirectory>${pom.artifactId}-${pom.version}</outputDirectory>
<excludes>
<exclude>**/repository/deployment/server/axis2services/*</exclude>
@ -44,11 +44,12 @@
<exclude>**/wso2server.sh</exclude> <!--adding a custom DAS server.sh file-->
<exclude>**/registry.xml</exclude>
<exclude>**/repository/conf/security/cipher-text.properties</exclude>
<exclude>**/repository/conf/security/Owasp.CsrfGuard.Carbon.properties</exclude>
<exclude>**/repository/conf/security/cipher-tool.properties</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>target/wso2carbon-core-${carbon.kernel.version}</directory>
<directory>target/wso2carbon-core-${carbon.kernel.449.version}</directory>
<outputDirectory>${pom.artifactId}-${pom.version}</outputDirectory>
<excludes>
<exclude>**/wso2server.bat</exclude>
@ -61,7 +62,7 @@
</fileSet>
<!-- copying runtime-->
<fileSet>
<directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/lib/runtimes</directory>
<directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/lib/runtimes</directory>
<outputDirectory>${pom.artifactId}-${pom.version}/lib/runtimes/</outputDirectory>
<includes>
<include>*/**</include>
@ -71,7 +72,7 @@
<!-- Multitenancy related files -->
<fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/multitenancy/
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/multitenancy/
</directory>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/multitenancy</outputDirectory>
<includes>
@ -83,7 +84,7 @@
</fileSet>
<fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/multitenancy/
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/multitenancy/
</directory>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf</outputDirectory>
<includes>
@ -116,7 +117,7 @@
<!-- Analytics related config -->
<fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/analytics/
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/analytics/
</directory>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/analytics</outputDirectory>
<includes>
@ -175,7 +176,7 @@
<!-- Some war files related to CEP websockets -->
<fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/deployment/server/webapps
</directory>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/deployment/server/webapps
</outputDirectory>
@ -192,7 +193,7 @@
<!-- Jaggery modules, carbon and process. Should be copied to <DAS_HOME> -->
<fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/modules
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/modules
</directory>
<outputDirectory>${pom.artifactId}-${pom.version}/modules</outputDirectory>
<includes>
@ -203,7 +204,7 @@
<!-- Shindig webapp. Should be copied to <DAS_HOME> -->
<fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/deployment/server/webapps
</directory>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/deployment/server/webapps</outputDirectory>
<includes>
@ -214,7 +215,7 @@
<!-- Dashboard portal Jaggery app. Should be copied to <DAS_HOME>/repository/deployment/server/jaggeryapps -->
<fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/jaggeryapps/portal
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/deployment/server/jaggeryapps/portal
</directory>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/deployment/server/jaggeryapps/portal
</outputDirectory>
@ -238,7 +239,7 @@
<!-- Copying dbscripts related to metrics feature -->
<fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/dbscripts/metrics/
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/dbscripts/metrics/
</directory>
<outputDirectory>${pom.artifactId}-${pom.version}/dbscripts/metrics</outputDirectory>
<includes>
@ -252,13 +253,13 @@
<!-- *********** Default files copy that comes with Carbon ************* -->
<file>
<source>target/wso2carbon-core-${carbon.kernel.version}/bin/README.txt</source>
<source>target/wso2carbon-core-${carbon.kernel.449.version}/bin/README.txt</source>
<outputDirectory>${pom.artifactId}-${pom.version}/bin/</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>target/wso2carbon-core-${carbon.kernel.version}/bin/version.txt</source>
<source>target/wso2carbon-core-${carbon.kernel.449.version}/bin/version.txt</source>
<outputDirectory>${pom.artifactId}-${pom.version}/bin/</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
@ -269,55 +270,55 @@
<filtered>true</filtered>
</file>
<file>
<source>target/wso2carbon-core-${carbon.kernel.version}/repository/conf/axis2/axis2.xml</source>
<source>target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/axis2/axis2.xml</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/axis2/</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>target/wso2carbon-core-${carbon.kernel.version}/repository/conf/README</source>
<source>target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/README</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>target/wso2carbon-core-${carbon.kernel.version}/repository/README.txt</source>
<source>target/wso2carbon-core-${carbon.kernel.449.version}/repository/README.txt</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>target/wso2carbon-core-${carbon.kernel.version}/lib/README.txt</source>
<source>target/wso2carbon-core-${carbon.kernel.449.version}/lib/README.txt</source>
<outputDirectory>${pom.artifactId}-${pom.version}/lib/</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>target/wso2carbon-core-${carbon.kernel.version}/repository/components/README.txt</source>
<source>target/wso2carbon-core-${carbon.kernel.449.version}/repository/components/README.txt</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/components/</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>target/wso2carbon-core-${carbon.kernel.version}/repository/database/README.txt</source>
<source>target/wso2carbon-core-${carbon.kernel.449.version}/repository/database/README.txt</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/database/</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/README.txt</source>
<source>target/wso2carbon-core-${carbon.kernel.449.version}/repository/deployment/README.txt</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/deployment/</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>target/wso2carbon-core-${carbon.kernel.version}/repository/logs/README.txt</source>
<source>target/wso2carbon-core-${carbon.kernel.449.version}/repository/logs/README.txt</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/logs/</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
<file>
<source>target/wso2carbon-core-${carbon.kernel.version}/repository/resources/README.txt</source>
<source>target/wso2carbon-core-${carbon.kernel.449.version}/repository/resources/README.txt</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/resources/</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
@ -349,7 +350,7 @@
<!-- ************* Data bridge related files ********** -->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/data-bridge/data-bridge-config.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/data-bridge/data-bridge-config.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/data-bridge</outputDirectory>
<filtered>true</filtered>
@ -357,7 +358,7 @@
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/data-bridge/data-agent-config.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/data-bridge/data-agent-config.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/data-bridge
</outputDirectory>
@ -369,7 +370,7 @@
<!-- ************* tomcat webapp hosting related files start ********** -->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/webapp-classloading.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/tomcat/webapp-classloading.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/tomcat</outputDirectory>
<filtered>true</filtered>
@ -377,7 +378,7 @@
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/webapp-classloading-environments.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/tomcat/webapp-classloading-environments.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/tomcat</outputDirectory>
<filtered>true</filtered>
@ -385,7 +386,7 @@
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/context.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/tomcat/context.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/tomcat</outputDirectory>
<filtered>true</filtered>
@ -396,7 +397,7 @@
<!-- Event broker configuration for deployment sync -->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/event-broker.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/event-broker.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/</outputDirectory>
<filtered>true</filtered>
@ -405,7 +406,7 @@
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/output-event-adapters.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/output-event-adapters.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf
</outputDirectory>
@ -415,7 +416,7 @@
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/input-event-adapters.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/input-event-adapters.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf
</outputDirectory>
@ -425,7 +426,7 @@
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/cep/storm/storm.yaml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/cep/storm/storm.yaml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/cep/storm/
</outputDirectory>
@ -434,7 +435,7 @@
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/event-processor.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/event-processor.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/
</outputDirectory>
@ -445,7 +446,7 @@
<!-- Analytics datasources -->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/datasources/analytics-datasources.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/datasources/analytics-datasources.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/datasources</outputDirectory>
<filtered>true</filtered>
@ -455,7 +456,7 @@
<!-- Analytics REST APIs WebApp -->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps/analytics.war
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/deployment/server/webapps/analytics.war
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/deployment/server/webapps</outputDirectory>
<!--commented since this tag causes issues in maven assembly plugin when copying zip formats-->
@ -464,7 +465,7 @@
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/logging-config.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/etc/logging-config.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/etc/
</outputDirectory>
@ -472,7 +473,7 @@
<!--loads spark environment variables-->
<file>
<!--../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/bin/load-spark-env-vars.sh-->
<!--../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/bin/load-spark-env-vars.sh-->
<!-- this file is moved to product-das from carbon-analytics DAS-110 -->
<source>
src/bin/load-spark-env-vars.sh
@ -483,7 +484,7 @@
<fileMode>755</fileMode>
</file>
<file>
<!--../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/bin/load-spark-env-vars.bat-->
<!--../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/bin/load-spark-env-vars.bat-->
<!-- this file is moved to product-das from carbon-analytics DAS-110 -->
<source>
src/bin/load-spark-env-vars.bat
@ -499,7 +500,7 @@
<!-- Akka config files start -->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/bundle-config/com.typesafe.config/reference.conf
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/etc/bundle-config/com.typesafe.config/reference.conf
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/etc/bundle-config/com.typesafe.config/
</outputDirectory>
@ -509,7 +510,7 @@
<!--YARN conf files-->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/bundle-config/hadoop-client/core-site.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/etc/bundle-config/hadoop-client/core-site.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/etc/bundle-config/hadoop-client/
</outputDirectory>
@ -518,7 +519,7 @@
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/bundle-config/hadoop-client/hdfs-site.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/etc/bundle-config/hadoop-client/hdfs-site.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/etc/bundle-config/hadoop-client/
</outputDirectory>
@ -527,7 +528,7 @@
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/bundle-config/hadoop-client/yarn-site.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/etc/bundle-config/hadoop-client/yarn-site.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/etc/bundle-config/hadoop-client/
</outputDirectory>
@ -536,7 +537,7 @@
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/bundle-config/hadoop-client/mapred-site.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/etc/bundle-config/hadoop-client/mapred-site.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/etc/bundle-config/hadoop-client/
</outputDirectory>
@ -556,7 +557,7 @@
<fileMode>755</fileMode>
</file>
<file>
<!--../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/bin/wso2server.bat-->
<!--../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/bin/wso2server.bat-->
<!-- this file is moved to product-das from carbon-analytics DAS-110 -->
<source>
src/bin/wso2server.bat
@ -570,7 +571,7 @@
<!--spark defaults file-->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/analytics/spark/spark-defaults.conf
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/analytics/spark/spark-defaults.conf
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/analytics/spark/
</outputDirectory>
@ -580,7 +581,7 @@
<!--spark fair scheduler xml file-->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/analytics/spark/fairscheduler.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/analytics/spark/fairscheduler.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/analytics/spark/
</outputDirectory>
@ -590,7 +591,7 @@
<!--spark classpath config file-->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/analytics/spark/external-spark-classpath.conf
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/analytics/spark/external-spark-classpath.conf
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/analytics/spark/
</outputDirectory>
@ -598,7 +599,7 @@
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/analytics/spark/carbon-spark-classpath.conf
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/analytics/spark/carbon-spark-classpath.conf
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/analytics/spark/
</outputDirectory>
@ -608,7 +609,7 @@
<!--spark udf conf file-->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/analytics/spark/spark-udf-config.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/analytics/spark/spark-udf-config.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/analytics/spark/
</outputDirectory>
@ -618,7 +619,7 @@
<!-- analytics backup tool script file-->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/bin/analytics-backup.sh
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/bin/analytics-backup.sh
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/bin/
</outputDirectory>
@ -626,7 +627,7 @@
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/bin/analytics-backup.bat
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/bin/analytics-backup.bat
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/bin/</outputDirectory>
</file>
@ -634,7 +635,7 @@
<!-- analytics cassandra migration tool script file-->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/bin/analytics-migrate.sh
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/bin/analytics-migrate.sh
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/bin/
</outputDirectory>
@ -642,7 +643,7 @@
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/bin/analytics-migrate.bat
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/bin/analytics-migrate.bat
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/bin/</outputDirectory>
</file>
@ -651,7 +652,7 @@
<!-- CEP -->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/cep/storm/storm.yaml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/cep/storm/storm.yaml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/cep/storm/
</outputDirectory>
@ -661,7 +662,7 @@
<!-- Including rdbms configuration file for event simulator -->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/cep/rdbms-configuration.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/cep/rdbms-configuration.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/cep
</outputDirectory>
@ -671,20 +672,20 @@
<!-- Cipher Tool Files -->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/bin/ciphertool.sh
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/bin/ciphertool.sh
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/bin</outputDirectory>
<fileMode>755</fileMode>
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/bin/ciphertool.bat
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/bin/ciphertool.bat
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/bin</outputDirectory>
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/lib/org.wso2.ciphertool-${cipher.tool.version}.jar
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/lib/org.wso2.ciphertool-${cipher.tool.version}.jar
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/lib</outputDirectory>
</file>
@ -709,21 +710,21 @@
<!-- Copying metrics feature related files -->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/metrics.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/metrics.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/</outputDirectory>
<filtered>false</filtered>
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/metrics.properties
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/metrics.properties
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/</outputDirectory>
<filtered>false</filtered>
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/datasources/metrics-datasources.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/datasources/metrics-datasources.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/datasources/
</outputDirectory>
@ -731,7 +732,7 @@
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/database/WSO2METRICS_DB.h2.db
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/database/WSO2METRICS_DB.h2.db
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/database/</outputDirectory>
<fileMode>644</fileMode>
@ -740,14 +741,14 @@
<!-- Copying the identity file -->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/identity/identity.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/identity/identity.xml
</source>
<outputDirectory>wso2iot-analytics-${pom.version}/repository/conf/identity</outputDirectory>
<fileMode>644</fileMode>
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/jwt.properties
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/etc/jwt.properties
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/etc</outputDirectory>
<filtered>true</filtered>
@ -755,7 +756,7 @@
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/etc/websocket-validation.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/etc/websocket-validation.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/etc</outputDirectory>
<filtered>true</filtered>
@ -775,7 +776,7 @@
<!-- Adding IoT Analytics Dashboard and gadget CApps -->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/carbonapps/org_wso2_carbon_analytics_cdmf-1.0.0.car
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/deployment/server/carbonapps/org_wso2_carbon_analytics_cdmf-1.0.0.car
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/deployment/server/carbonapps/</outputDirectory>
<fileMode>644</fileMode>
@ -783,7 +784,7 @@
<!-- Adding Geo Dashboard configuration files and Capp -->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/carbonapps/org_wso2_carbon_geo_dashboard-1.0.0.car
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/deployment/server/carbonapps/org_wso2_carbon_geo_dashboard-1.0.0.car
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/deployment/server/carbonapps/</outputDirectory>
<fileMode>644</fileMode>
@ -804,7 +805,7 @@
</file>
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/datasources/geodashboard-datasources.xml
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/conf/datasources/geodashboard-datasources.xml
</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf/datasources</outputDirectory>
<filtered>true</filtered>

@ -25,7 +25,7 @@
<fileSets>
<!-- Copying p2 profile and osgi bundles-->
<fileSet>
<directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/components</directory>
<directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.449.version}/repository/components</directory>
<outputDirectory>wso2iot-analytics-${pom.version}/repository/components</outputDirectory>
<excludes>
<exclude>**/eclipse.ini</exclude>

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-analytics-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wso2iot-analytics-features-parent</artifactId>
<name>WSO2 IoT - Analytics - Product Features Parent</name>
<packaging>pom</packaging>
<modules>
<module>product</module>
<module>service</module>
</modules>
</project>

@ -1,242 +0,0 @@
################################################################################
# Copyright 2009 WSO2, Inc. (http://wso2.com)
#
# 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.
################################################################################
providerName=WSO2 Inc.
########################## license properties ##################################
licenseURL=http://www.apache.org/licenses/LICENSE-2.0
license=\
Apache License\n\
Version 2.0, January 2004\n\
http://www.apache.org/licenses/\n\
\n\
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\
\n\
1. Definitions.\n\
\n\
"License" shall mean the terms and conditions for use, reproduction,\n\
and distribution as defined by Sections 1 through 9 of this document.\n\
\n\
"Licensor" shall mean the copyright owner or entity authorized by\n\
the copyright owner that is granting the License.\n\
\n\
"Legal Entity" shall mean the union of the acting entity and all\n\
other entities that control, are controlled by, or are under common\n\
control with that entity. For the purposes of this definition,\n\
"control" means (i) the power, direct or indirect, to cause the\n\
direction or management of such entity, whether by contract or\n\
otherwise, or (ii) ownership of fifty percent (50%) or more of the\n\
outstanding shares, or (iii) beneficial ownership of such entity.\n\
\n\
"You" (or "Your") shall mean an individual or Legal Entity\n\
exercising permissions granted by this License.\n\
\n\
"Source" form shall mean the preferred form for making modifications,\n\
including but not limited to software source code, documentation\n\
source, and configuration files.\n\
\n\
"Object" form shall mean any form resulting from mechanical\n\
transformation or translation of a Source form, including but\n\
not limited to compiled object code, generated documentation,\n\
and conversions to other media types.\n\
\n\
"Work" shall mean the work of authorship, whether in Source or\n\
Object form, made available under the License, as indicated by a\n\
copyright notice that is included in or attached to the work\n\
(an example is provided in the Appendix below).\n\
\n\
"Derivative Works" shall mean any work, whether in Source or Object\n\
form, that is based on (or derived from) the Work and for which the\n\
editorial revisions, annotations, elaborations, or other modifications\n\
represent, as a whole, an original work of authorship. For the purposes\n\
of this License, Derivative Works shall not include works that remain\n\
separable from, or merely link (or bind by name) to the interfaces of,\n\
the Work and Derivative Works thereof.\n\
\n\
"Contribution" shall mean any work of authorship, including\n\
the original version of the Work and any modifications or additions\n\
to that Work or Derivative Works thereof, that is intentionally\n\
submitted to Licensor for inclusion in the Work by the copyright owner\n\
or by an individual or Legal Entity authorized to submit on behalf of\n\
the copyright owner. For the purposes of this definition, "submitted"\n\
means any form of electronic, verbal, or written communication sent\n\
to the Licensor or its representatives, including but not limited to\n\
communication on electronic mailing lists, source code control systems,\n\
and issue tracking systems that are managed by, or on behalf of, the\n\
Licensor for the purpose of discussing and improving the Work, but\n\
excluding communication that is conspicuously marked or otherwise\n\
designated in writing by the copyright owner as "Not a Contribution."\n\
\n\
"Contributor" shall mean Licensor and any individual or Legal Entity\n\
on behalf of whom a Contribution has been received by Licensor and\n\
subsequently incorporated within the Work.\n\
\n\
2. Grant of Copyright License. Subject to the terms and conditions of\n\
this License, each Contributor hereby grants to You a perpetual,\n\
worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n\
copyright license to reproduce, prepare Derivative Works of,\n\
publicly display, publicly perform, sublicense, and distribute the\n\
Work and such Derivative Works in Source or Object form.\n\
\n\
3. Grant of Patent License. Subject to the terms and conditions of\n\
this License, each Contributor hereby grants to You a perpetual,\n\
worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n\
(except as stated in this section) patent license to make, have made,\n\
use, offer to sell, sell, import, and otherwise transfer the Work,\n\
where such license applies only to those patent claims licensable\n\
by such Contributor that are necessarily infringed by their\n\
Contribution(s) alone or by combination of their Contribution(s)\n\
with the Work to which such Contribution(s) was submitted. If You\n\
institute patent litigation against any entity (including a\n\
cross-claim or counterclaim in a lawsuit) alleging that the Work\n\
or a Contribution incorporated within the Work constitutes direct\n\
or contributory patent infringement, then any patent licenses\n\
granted to You under this License for that Work shall terminate\n\
as of the date such litigation is filed.\n\
\n\
4. Redistribution. You may reproduce and distribute copies of the\n\
Work or Derivative Works thereof in any medium, with or without\n\
modifications, and in Source or Object form, provided that You\n\
meet the following conditions:\n\
\n\
(a) You must give any other recipients of the Work or\n\
Derivative Works a copy of this License; and\n\
\n\
(b) You must cause any modified files to carry prominent notices\n\
stating that You changed the files; and\n\
\n\
(c) You must retain, in the Source form of any Derivative Works\n\
that You distribute, all copyright, patent, trademark, and\n\
attribution notices from the Source form of the Work,\n\
excluding those notices that do not pertain to any part of\n\
the Derivative Works; and\n\
\n\
(d) If the Work includes a "NOTICE" text file as part of its\n\
distribution, then any Derivative Works that You distribute must\n\
include a readable copy of the attribution notices contained\n\
within such NOTICE file, excluding those notices that do not\n\
pertain to any part of the Derivative Works, in at least one\n\
of the following places: within a NOTICE text file distributed\n\
as part of the Derivative Works; within the Source form or\n\
documentation, if provided along with the Derivative Works; or,\n\
within a display generated by the Derivative Works, if and\n\
wherever such third-party notices normally appear. The contents\n\
of the NOTICE file are for informational purposes only and\n\
do not modify the License. You may add Your own attribution\n\
notices within Derivative Works that You distribute, alongside\n\
or as an addendum to the NOTICE text from the Work, provided\n\
that such additional attribution notices cannot be construed\n\
as modifying the License.\n\
\n\
You may add Your own copyright statement to Your modifications and\n\
may provide additional or different license terms and conditions\n\
for use, reproduction, or distribution of Your modifications, or\n\
for any such Derivative Works as a whole, provided Your use,\n\
reproduction, and distribution of the Work otherwise complies with\n\
the conditions stated in this License.\n\
\n\
5. Submission of Contributions. Unless You explicitly state otherwise,\n\
any Contribution intentionally submitted for inclusion in the Work\n\
by You to the Licensor shall be under the terms and conditions of\n\
this License, without any additional terms or conditions.\n\
Notwithstanding the above, nothing herein shall supersede or modify\n\
the terms of any separate license agreement you may have executed\n\
with Licensor regarding such Contributions.\n\
\n\
6. Trademarks. This License does not grant permission to use the trade\n\
names, trademarks, service marks, or product names of the Licensor,\n\
except as required for reasonable and customary use in describing the\n\
origin of the Work and reproducing the content of the NOTICE file.\n\
\n\
7. Disclaimer of Warranty. Unless required by applicable law or\n\
agreed to in writing, Licensor provides the Work (and each\n\
Contributor provides its Contributions) on an "AS IS" BASIS,\n\
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n\
implied, including, without limitation, any warranties or conditions\n\
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n\
PARTICULAR PURPOSE. You are solely responsible for determining the\n\
appropriateness of using or redistributing the Work and assume any\n\
risks associated with Your exercise of permissions under this License.\n\
\n\
8. Limitation of Liability. In no event and under no legal theory,\n\
whether in tort (including negligence), contract, or otherwise,\n\
unless required by applicable law (such as deliberate and grossly\n\
negligent acts) or agreed to in writing, shall any Contributor be\n\
liable to You for damages, including any direct, indirect, special,\n\
incidental, or consequential damages of any character arising as a\n\
result of this License or out of the use or inability to use the\n\
Work (including but not limited to damages for loss of goodwill,\n\
work stoppage, computer failure or malfunction, or any and all\n\
other commercial damages or losses), even if such Contributor\n\
has been advised of the possibility of such damages.\n\
\n\
9. Accepting Warranty or Additional Liability. While redistributing\n\
the Work or Derivative Works thereof, You may choose to offer,\n\
and charge a fee for, acceptance of support, warranty, indemnity,\n\
or other liability obligations and/or rights consistent with this\n\
License. However, in accepting such obligations, You may act only\n\
on Your own behalf and on Your sole responsibility, not on behalf\n\
of any other Contributor, and only if You agree to indemnify,\n\
defend, and hold each Contributor harmless for any liability\n\
incurred by, or claims asserted against, such Contributor by reason\n\
of your accepting any such warranty or additional liability.\n\
\n\
END OF TERMS AND CONDITIONS\n\
\n\
APPENDIX: How to apply the Apache License to your work.\n\
\n\
To apply the Apache License to your work, attach the following\n\
boilerplate notice, with the fields enclosed by brackets "[]"\n\
replaced with your own identifying information. (Don't include\n\
the brackets!) The text should be enclosed in the appropriate\n\
comment syntax for the file format. We also recommend that a\n\
file or class name and description of purpose be included on the\n\
same "printed page" as the copyright notice for easier\n\
identification within third-party archives.\n\
\n\
Copyright [yyyy] [name of copyright owner]\n\
\n\
Licensed under the Apache License, Version 2.0 (the "License");\n\
you may not use this file except in compliance with the License.\n\
You may obtain a copy of the License at\n\
\n\
http://www.apache.org/licenses/LICENSE-2.0\n\
\n\
Unless required by applicable law or agreed to in writing, software\n\
distributed under the License is distributed on an "AS IS" BASIS,\n\
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\
See the License for the specific language governing permissions and\n\
limitations under the License.\n
######################### copyright properties #################################
copyrightURL=TODO
copyright=\
Copyright (c) WSO2 Inc. (http://wso2.com)\n\
\n\
Licensed under the Apache License, Version 2.0 (the "License");\n\
you may not use this file except in compliance with the License.\n\
You may obtain a copy of the License at\n\
\n\
http://www.apache.org/licenses/LICENSE-2.0\n\
\n\
Unless required by applicable law or agreed to in writing, software\n\
distributed under the License is distributed on an "AS IS" BASIS,\n\
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\
See the License for the specific language governing permissions and\n\
limitations under the License.\n

@ -1,69 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-analytics-features</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.iot.analytics.styles.feature</artifactId>
<packaging>pom</packaging>
<name>WSO2 IoT - Analytics - Product Style Feature</name>
<dependencies>
<dependency>
<groupId>org.wso2.iot</groupId>
<artifactId>org.wso2.iot.analytics.styles</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>carbon-p2-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>p2-feature-generation</id>
<phase>package</phase>
<goals>
<goal>p2-feature-gen</goal>
</goals>
<configuration>
<id>org.wso2.iot.analytics.styles</id>
<propertiesFile>../etc/feature.properties</propertiesFile>
<bundles>
<bundleDef>org.wso2.iot:org.wso2.iot.analytics.styles</bundleDef>
</bundles>
<importFeatures>
<importFeatureDef>org.wso2.carbon.core.ui:${carbon.kernel.version}</importFeatureDef>
</importFeatures>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -1,242 +0,0 @@
################################################################################
# Copyright 2009 WSO2, Inc. (http://wso2.com)
#
# 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.
################################################################################
providerName=WSO2 Inc.
########################## license properties ##################################
licenseURL=http://www.apache.org/licenses/LICENSE-2.0
license=\
Apache License\n\
Version 2.0, January 2004\n\
http://www.apache.org/licenses/\n\
\n\
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\
\n\
1. Definitions.\n\
\n\
"License" shall mean the terms and conditions for use, reproduction,\n\
and distribution as defined by Sections 1 through 9 of this document.\n\
\n\
"Licensor" shall mean the copyright owner or entity authorized by\n\
the copyright owner that is granting the License.\n\
\n\
"Legal Entity" shall mean the union of the acting entity and all\n\
other entities that control, are controlled by, or are under common\n\
control with that entity. For the purposes of this definition,\n\
"control" means (i) the power, direct or indirect, to cause the\n\
direction or management of such entity, whether by contract or\n\
otherwise, or (ii) ownership of fifty percent (50%) or more of the\n\
outstanding shares, or (iii) beneficial ownership of such entity.\n\
\n\
"You" (or "Your") shall mean an individual or Legal Entity\n\
exercising permissions granted by this License.\n\
\n\
"Source" form shall mean the preferred form for making modifications,\n\
including but not limited to software source code, documentation\n\
source, and configuration files.\n\
\n\
"Object" form shall mean any form resulting from mechanical\n\
transformation or translation of a Source form, including but\n\
not limited to compiled object code, generated documentation,\n\
and conversions to other media types.\n\
\n\
"Work" shall mean the work of authorship, whether in Source or\n\
Object form, made available under the License, as indicated by a\n\
copyright notice that is included in or attached to the work\n\
(an example is provided in the Appendix below).\n\
\n\
"Derivative Works" shall mean any work, whether in Source or Object\n\
form, that is based on (or derived from) the Work and for which the\n\
editorial revisions, annotations, elaborations, or other modifications\n\
represent, as a whole, an original work of authorship. For the purposes\n\
of this License, Derivative Works shall not include works that remain\n\
separable from, or merely link (or bind by name) to the interfaces of,\n\
the Work and Derivative Works thereof.\n\
\n\
"Contribution" shall mean any work of authorship, including\n\
the original version of the Work and any modifications or additions\n\
to that Work or Derivative Works thereof, that is intentionally\n\
submitted to Licensor for inclusion in the Work by the copyright owner\n\
or by an individual or Legal Entity authorized to submit on behalf of\n\
the copyright owner. For the purposes of this definition, "submitted"\n\
means any form of electronic, verbal, or written communication sent\n\
to the Licensor or its representatives, including but not limited to\n\
communication on electronic mailing lists, source code control systems,\n\
and issue tracking systems that are managed by, or on behalf of, the\n\
Licensor for the purpose of discussing and improving the Work, but\n\
excluding communication that is conspicuously marked or otherwise\n\
designated in writing by the copyright owner as "Not a Contribution."\n\
\n\
"Contributor" shall mean Licensor and any individual or Legal Entity\n\
on behalf of whom a Contribution has been received by Licensor and\n\
subsequently incorporated within the Work.\n\
\n\
2. Grant of Copyright License. Subject to the terms and conditions of\n\
this License, each Contributor hereby grants to You a perpetual,\n\
worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n\
copyright license to reproduce, prepare Derivative Works of,\n\
publicly display, publicly perform, sublicense, and distribute the\n\
Work and such Derivative Works in Source or Object form.\n\
\n\
3. Grant of Patent License. Subject to the terms and conditions of\n\
this License, each Contributor hereby grants to You a perpetual,\n\
worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n\
(except as stated in this section) patent license to make, have made,\n\
use, offer to sell, sell, import, and otherwise transfer the Work,\n\
where such license applies only to those patent claims licensable\n\
by such Contributor that are necessarily infringed by their\n\
Contribution(s) alone or by combination of their Contribution(s)\n\
with the Work to which such Contribution(s) was submitted. If You\n\
institute patent litigation against any entity (including a\n\
cross-claim or counterclaim in a lawsuit) alleging that the Work\n\
or a Contribution incorporated within the Work constitutes direct\n\
or contributory patent infringement, then any patent licenses\n\
granted to You under this License for that Work shall terminate\n\
as of the date such litigation is filed.\n\
\n\
4. Redistribution. You may reproduce and distribute copies of the\n\
Work or Derivative Works thereof in any medium, with or without\n\
modifications, and in Source or Object form, provided that You\n\
meet the following conditions:\n\
\n\
(a) You must give any other recipients of the Work or\n\
Derivative Works a copy of this License; and\n\
\n\
(b) You must cause any modified files to carry prominent notices\n\
stating that You changed the files; and\n\
\n\
(c) You must retain, in the Source form of any Derivative Works\n\
that You distribute, all copyright, patent, trademark, and\n\
attribution notices from the Source form of the Work,\n\
excluding those notices that do not pertain to any part of\n\
the Derivative Works; and\n\
\n\
(d) If the Work includes a "NOTICE" text file as part of its\n\
distribution, then any Derivative Works that You distribute must\n\
include a readable copy of the attribution notices contained\n\
within such NOTICE file, excluding those notices that do not\n\
pertain to any part of the Derivative Works, in at least one\n\
of the following places: within a NOTICE text file distributed\n\
as part of the Derivative Works; within the Source form or\n\
documentation, if provided along with the Derivative Works; or,\n\
within a display generated by the Derivative Works, if and\n\
wherever such third-party notices normally appear. The contents\n\
of the NOTICE file are for informational purposes only and\n\
do not modify the License. You may add Your own attribution\n\
notices within Derivative Works that You distribute, alongside\n\
or as an addendum to the NOTICE text from the Work, provided\n\
that such additional attribution notices cannot be construed\n\
as modifying the License.\n\
\n\
You may add Your own copyright statement to Your modifications and\n\
may provide additional or different license terms and conditions\n\
for use, reproduction, or distribution of Your modifications, or\n\
for any such Derivative Works as a whole, provided Your use,\n\
reproduction, and distribution of the Work otherwise complies with\n\
the conditions stated in this License.\n\
\n\
5. Submission of Contributions. Unless You explicitly state otherwise,\n\
any Contribution intentionally submitted for inclusion in the Work\n\
by You to the Licensor shall be under the terms and conditions of\n\
this License, without any additional terms or conditions.\n\
Notwithstanding the above, nothing herein shall supersede or modify\n\
the terms of any separate license agreement you may have executed\n\
with Licensor regarding such Contributions.\n\
\n\
6. Trademarks. This License does not grant permission to use the trade\n\
names, trademarks, service marks, or product names of the Licensor,\n\
except as required for reasonable and customary use in describing the\n\
origin of the Work and reproducing the content of the NOTICE file.\n\
\n\
7. Disclaimer of Warranty. Unless required by applicable law or\n\
agreed to in writing, Licensor provides the Work (and each\n\
Contributor provides its Contributions) on an "AS IS" BASIS,\n\
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n\
implied, including, without limitation, any warranties or conditions\n\
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n\
PARTICULAR PURPOSE. You are solely responsible for determining the\n\
appropriateness of using or redistributing the Work and assume any\n\
risks associated with Your exercise of permissions under this License.\n\
\n\
8. Limitation of Liability. In no event and under no legal theory,\n\
whether in tort (including negligence), contract, or otherwise,\n\
unless required by applicable law (such as deliberate and grossly\n\
negligent acts) or agreed to in writing, shall any Contributor be\n\
liable to You for damages, including any direct, indirect, special,\n\
incidental, or consequential damages of any character arising as a\n\
result of this License or out of the use or inability to use the\n\
Work (including but not limited to damages for loss of goodwill,\n\
work stoppage, computer failure or malfunction, or any and all\n\
other commercial damages or losses), even if such Contributor\n\
has been advised of the possibility of such damages.\n\
\n\
9. Accepting Warranty or Additional Liability. While redistributing\n\
the Work or Derivative Works thereof, You may choose to offer,\n\
and charge a fee for, acceptance of support, warranty, indemnity,\n\
or other liability obligations and/or rights consistent with this\n\
License. However, in accepting such obligations, You may act only\n\
on Your own behalf and on Your sole responsibility, not on behalf\n\
of any other Contributor, and only if You agree to indemnify,\n\
defend, and hold each Contributor harmless for any liability\n\
incurred by, or claims asserted against, such Contributor by reason\n\
of your accepting any such warranty or additional liability.\n\
\n\
END OF TERMS AND CONDITIONS\n\
\n\
APPENDIX: How to apply the Apache License to your work.\n\
\n\
To apply the Apache License to your work, attach the following\n\
boilerplate notice, with the fields enclosed by brackets "[]"\n\
replaced with your own identifying information. (Don't include\n\
the brackets!) The text should be enclosed in the appropriate\n\
comment syntax for the file format. We also recommend that a\n\
file or class name and description of purpose be included on the\n\
same "printed page" as the copyright notice for easier\n\
identification within third-party archives.\n\
\n\
Copyright [yyyy] [name of copyright owner]\n\
\n\
Licensed under the Apache License, Version 2.0 (the "License");\n\
you may not use this file except in compliance with the License.\n\
You may obtain a copy of the License at\n\
\n\
http://www.apache.org/licenses/LICENSE-2.0\n\
\n\
Unless required by applicable law or agreed to in writing, software\n\
distributed under the License is distributed on an "AS IS" BASIS,\n\
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\
See the License for the specific language governing permissions and\n\
limitations under the License.\n
######################### copyright properties #################################
copyrightURL=TODO
copyright=\
Copyright (c) WSO2 Inc. (http://wso2.com)\n\
\n\
Licensed under the Apache License, Version 2.0 (the "License");\n\
you may not use this file except in compliance with the License.\n\
You may obtain a copy of the License at\n\
\n\
http://www.apache.org/licenses/LICENSE-2.0\n\
\n\
Unless required by applicable law or agreed to in writing, software\n\
distributed under the License is distributed on an "AS IS" BASIS,\n\
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\
See the License for the specific language governing permissions and\n\
limitations under the License.\n

@ -1,87 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-analytics-multitenancy-features</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.iot.analytics.multitenancy.dashboard.ui.feature</artifactId>
<packaging>pom</packaging>
<name>WSO2 IoT - Analytics - Multi-tenant Dashboard Feature</name>
<url>http://wso2.org</url>
<dependencies>
<dependency>
<groupId>org.wso2.iot</groupId>
<artifactId>org.wso2.iot.analytics.multitenancy.dashboard.ui</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.ui.menu.stratos</artifactId>
<exclusions>
<exclusion>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.statistics.ui</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>carbon-p2-plugin</artifactId>
<executions>
<execution>
<id>p2-feature-generation</id>
<phase>package</phase>
<goals>
<goal>p2-feature-gen</goal>
</goals>
<configuration>
<id>org.wso2.iot.analytics.multitenancy.dashboard.ui</id>
<propertiesFile>../etc/feature.properties</propertiesFile>
<adviceFile>
<properties>
<propertyDef>org.wso2.carbon.p2.category.type:console</propertyDef>
</properties>
</adviceFile>
<bundles>
<bundleDef>org.wso2.iot:org.wso2.iot.analytics.multitenancy.dashboard.ui</bundleDef>
<bundleDef>org.wso2.carbon:org.wso2.carbon.ui.menu.stratos</bundleDef>
</bundles>
<importFeatures>
<importFeatureDef>
org.wso2.carbon.core.ui:${carbon.kernel.version}
</importFeatureDef>
</importFeatures>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -1,67 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-analytics-multitenancy-features</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.iot.analytics.multitenancy.style.feature</artifactId>
<packaging>pom</packaging>
<name>WSO2 IoT - Analytics - Multi-tenant Style Feature</name>
<dependencies>
<dependency>
<groupId>org.wso2.iot</groupId>
<artifactId>org.wso2.iot.analytics.multitenancy.styles</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>carbon-p2-plugin</artifactId>
<executions>
<execution>
<id>p2-feature-generation</id>
<phase>package</phase>
<goals>
<goal>p2-feature-gen</goal>
</goals>
<configuration>
<id>org.wso2.iot.analytics.multitenancy.style</id>
<propertiesFile>../etc/feature.properties</propertiesFile>
<bundles>
<bundleDef>org.wso2.iot:org.wso2.iot.analytics.multitenancy.styles</bundleDef>
</bundles>
<importFeatures>
<importFeatureDef>org.wso2.carbon.core.ui:${carbon.kernel.version}</importFeatureDef>
</importFeatures>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-analytics-features-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wso2iot-analytics-multitenancy-features</artifactId>
<packaging>pom</packaging>
<name>WSO2 IoT - Analytics - Multi-tenant-Features</name>
<description>WSO2 IoT - Analytics Multi-tenant Features</description>
<modules>
<module>org.wso2.iot.analytics.multitenancy.styles.feature</module>
<module>org.wso2.iot.analytics.multitenancy.dashboard.ui.feature</module>
</modules>
</project>

@ -1,93 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-analytics-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.iot.analytics.multitenancy.dashboard.ui</artifactId>
<packaging>bundle</packaging>
<name>WSO2 IoT - Analytics - Multi-tenant Dashboard</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Export-Package>
org.wso2.multitenancy.iot.analytics.dashboard.ui.*; version="${iots.analytics.version}",
</Export-Package>
<Import-Package>
!javax.xml.namespace,
javax.xml.namespace; version=0.0.0,
javax.servlet; version="${imp.pkg.version.javax.servlet}",
javax.servlet.http; version="${imp.pkg.version.javax.servlet}",
*;resolution:=optional
</Import-Package>
<Carbon-Component>UIBundle</Carbon-Component>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.axis2.wso2</groupId>
<artifactId>axis2</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.registry.core</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.ui</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.commons</groupId>
<artifactId>org.wso2.carbon.statistics.ui</artifactId>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
</dependencies>
</project>

@ -1,2 +0,0 @@
password.mismatched=Passwords do not match.
current.password.should.provided=You should provide the current password inorder to change the password.

@ -1,66 +0,0 @@
.tip-table {
border-collapse: collapse;
width:868px;
}
.tip-table tr td.tip-empty {
width: 20px;
}
.tip-top {
width: 202px;
height: 85px;
z-index: 90;
}
.tip-content-lifter {
margin-top: -20px;
position:relative;
font-size:11px;
}
.tip-content a.dashboard-subtitle {
line-height:30px;
}
.tip-content {
background: transparent url(../images/tip-back.png) repeat-y left top;
padding: 10px !important;
width: 182px;
z-index: 100;
}
.tip-bottom {
background: transparent url(../images/tip-bottom.png) no-repeat left top;
height: 11px;
width: 202px;
}
a.tip-title,h3.tip-title {
color: #333333 !important;
font-size: 18px !important;
text-decoration: none;
margin-bottom:0 !important;
margin-top:0 !important;
display:block;
}
a.tip-title{
cursor:pointer;
}
a.tip-title:hover {
color: #930000 !important;
}
div#workArea h2.dashboard-title {
background-image: url(../images/dashboard-title-bg.gif);
background-position: left bottom;
background-repeat: repeat-x;
border-bottom: 0 none;
color: #000000;
font-size: 150%;
font-weight: bold;
line-height: 25px;
margin-bottom: 20px;
padding-bottom: 10px;
}
.tip-table-div{
height:10px;
}

@ -1,54 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!--
~ Copyright (c) 2005-2010, 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.
-->
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"/>
<title>WSO2 DAS Home - User Guide</title>
<link href="../../admin/css/documentation.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body>
<h1>WSO2 DAS Home</h1>
<p>
The WSO2 Data Analytics Server Home page provides a interface to access the monitoring services of the SOA platform
of your organization.The WSO2 Data Analytics Server (WSO2 DAS) serves the needs of both business and IT domain experts
to monitor and understand business activities within an SOA deployment. While specifically designed to monitor SOA deployments, it can be extended to cater to other general monitoring requirements as well.
</p>
<img src="../../tenant-dashboard/docs/images/dashboard.png"/>
<p>Figure1: WSO2 DAS Home Page</p>
</body>
<h2>Add Gadget</h2>
<p>
The Dashboard is an Executive Information System, which gives users a Bird's Eye view of their SOA by way of a set of Gadgets. Users can use the default set of Gadgets shipped with a WSO2 product as well as adding their own.
</p>
<h2>Service Data</h2>
<p>
Service data and Mediation data dashboards display key operational data that are lightly summarized and updated as and when the latest data is available. For example, latest counts and time measures for both service and mediation data are available as operational dashboards.
</p>
<h2>Monitored Servers</h2>
<p>
Servers adding and monitoring tasks done by using this component.Server addition is driven by three types of data collection methods.
</p>
</html>

@ -1,86 +0,0 @@
<!--
~ Copyright (c) 2005-2010, 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.
-->
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="../dialog/display_messages.jsp"/>
<script type="text/javascript" src="../statistics/js/statistics.js"></script>
<script type="text/javascript" src="../statistics/js/graphs.js"></script>
<script type="text/javascript" src="../admin/js/jquery.flot.js"></script>
<script type="text/javascript" src="../admin/js/excanvas.js"></script>
<%@include file="../admin/index.jsp" %>
<script id="source" type="text/javascript">
jQuery.noConflict();
var responseTimeGraphWidth = 500;
var responseTimeXScale = 25;
initStats(responseTimeXScale, 25);
function drawResponseTimeGraph() {
jQuery.plot(jQuery("#responseTimeGraph"), [
{
data: graphAvgResponse.get(),
lines: { show: true, fill: true }
}
], {
xaxis: {
ticks: graphAvgResponse.tick(),
min: 0
},
yaxis: {
ticks: 10,
min: 0
}
});
}
</script>
<fmt:bundle basename="org.wso2.carbon.statistics.ui.i18n.Resources">
<div id="middle">
<div id="workArea">
<div id="systemStats"></div>
<script type="text/javascript">
jQuery.noConflict();
var varRefreshSystemStats;
function refreshSystemStats() {
var url = "../tenant-dashboard/system_stats_ajaxprocessor.jsp";
jQuery("#systemStats").load(url, null, function (responseText, status, XMLHttpRequest) {
if ( status != "success"){
stopRefreshSystemStats();
document.getElementById('systemStats').innerHTML = responseText;
}
});
}
function stopRefreshSystemStats() {
if (varRefreshSystemStats) {
clearInterval(varRefreshSystemStats);
}
}
jQuery(document).ready(function() {
refreshSystemStats();
varRefreshSystemStats = setInterval("refreshSystemStats()", 10000);
});
</script>
</div>
</div>
</fmt:bundle>

@ -1,204 +0,0 @@
<!--
~ Copyright (c) 2005-2010, 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.
-->
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
<jsp:include page="../dialog/display_messages.jsp"/>
<link href="../tenant-dashboard/css/dashboard-common.css" rel="stylesheet" type="text/css" media="all"/>
<%
Object param = session.getAttribute("authenticated");
String passwordExpires = (String) session.getAttribute(ServerConstants.PASSWORD_EXPIRATION);
boolean loggedIn = false;
if (param != null) {
loggedIn = (Boolean) param;
}
%>
<div id="passwordExpire">
<%
if (loggedIn && passwordExpires != null) {
%>
<div class="info-box"><p>Your password expires at <%=passwordExpires%>. Please change by visiting <a href="../user/change-passwd.jsp?isUserChange=true&returnPath=../admin/index.jsp">here</a></p></div>
<%
}
%>
</div>
<div id="middle">
<div id="workArea">
<style type="text/css">
.tip-table td.real-time-monitoring {
background-image: url(../../carbon/tenant-dashboard/images/real-time-monitoring.png);
}
.tip-table td.mediation-analytic {
background-image: url(../../carbon/tenant-dashboard/images/mediation-analytic.png);
}
.tip-table td.real-time-service-monitoring {
background-image: url(../../carbon/tenant-dashboard/images/real-time-service-monitoring.png);
}
.tip-table td.summary-genaration {
background-image: url(../../carbon/tenant-dashboard/images/summary-genaration.png);
}
.tip-table td.service-analytic {
background-image: url(../../carbon/tenant-dashboard/images/service-analytic.png);
}
.tip-table td.dashboard {
background-image: url(../../carbon/tenant-dashboard/images/dashboard.png);
}
.tip-table td.activity-correlation{
background-image: url(../../carbon/tenant-dashboard/images/activity-correlation.png);
}
.tip-table td.message-archival{
background-image: url(../../carbon/tenant-dashboard/images/message-archival.png);
}
</style>
<h2 class="dashboard-title">WSO2 DAS quick start dashboard</h2>
<table class="tip-table">
<tr>
<td class="tip-top real-time-monitoring"></td>
<td class="tip-empty"></td>
<td class="tip-top mediation-analytic"></td>
<td class="tip-empty "></td>
<td class="tip-top real-time-service-monitoring"></td>
<td class="tip-empty "></td>
<td class="tip-top summary-genaration"></td>
</tr>
<tr>
<td class="tip-content">
<div class="tip-content-lifter">
<h3 class="tip-title">Real Time Mediation Monitoring </h3> <br/>
<p>Monitor proxy services, endpoints and sequences and their operations in real time. The results gathered from the real-time monitoring are presented in a clear and easy-to-view format. </p>
</div>
</td>
<td class="tip-empty"></td>
<td class="tip-content">
<div class="tip-content-lifter">
<h3 class="tip-title">Mediation Analysis</h3><br/>
<p>Analyze the historical mediation trends over time with the help of visualization framework.</p>
</div>
</td>
<td class="tip-empty"></td>
<td class="tip-content">
<div class="tip-content-lifter">
<h3 class="tip-title">Real time Service Monitoring </h3> <br/>
<p>Monitor services and their operations in real time. The results gathered from the real-time monitoring are presented in a clear and easy-to-view format. </p>
</div>
</td>
<td class="tip-empty"></td>
<td class="tip-content">
<div class="tip-content-lifter">
<h3 class="tip-title">Summary Generation</h3> <br/>
<p>Generate a summarized view of collected statistics & write gadgets to display these summarized data</p>
</div>
</td>
</tr>
<tr>
<td class="tip-bottom"></td>
<td class="tip-empty"></td>
<td class="tip-bottom"></td>
<td class="tip-empty"></td>
<td class="tip-bottom"></td>
<td class="tip-empty"></td>
<td class="tip-bottom"></td>
</tr>
</table>
<div class="tip-table-div"></div>
<table class="tip-table">
<tr>
<td class="tip-top service-analytic"></td>
<td class="tip-empty"></td>
<td class="tip-top dashboard"></td>
<td class="tip-empty "></td>
<td class="tip-top activity-correlation"></td>
<td class="tip-empty "></td>
<td class="tip-top message-archival"></td>
</tr>
<tr>
<td class="tip-content">
<div class="tip-content-lifter">
<h3 class="tip-title">Service Invocation Analysis</h3> <br/>
<p>Analyze trends over time to help make both business and IT decisions to fine tune SOA deployment.</p>
</div>
</td>
<td class="tip-empty"></td>
<td class="tip-content">
<div class="tip-content-lifter">
<h3 class="tip-title">Dashboard</h3><br/>
<p>Write gadgets to consume service statistics and present to end user. Dashboard support Google Gadget specification.</p>
</div>
</td>
<td class="tip-empty"></td>
<td class="tip-content">
<div class="tip-content-lifter">
<h3 class="tip-title">Activity Correlation & Monitoring</h3> <br/>
<p>Monitor and correlate related business activities across multiple server instances. These activities can be used to track and verify the smooth execution of business.</p>
</div>
</td>
<td class="tip-empty"></td>
<td class="tip-content">
<div class="tip-content-lifter">
<h3 class="tip-title">Message Collection & Archival</h3> <br/>
<p>Collect messages coming into your SOA, analyze & archive for future retrieval.</p>
</div>
</td>
</tr>
<tr>
<td class="tip-bottom"></td>
<td class="tip-empty"></td>
<td class="tip-bottom"></td>
<td class="tip-empty"></td>
<td class="tip-bottom"></td>
<td class="tip-empty"></td>
<td class="tip-bottom"></td>
</tr>
</table>
<p>
<br/>
</p> </div>
</div>

@ -1,127 +0,0 @@
<!--
~ Copyright (c) 2005-2010, 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.
-->
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page import="org.apache.axis2.context.ConfigurationContext" %>
<%@ page import="org.wso2.carbon.CarbonConstants" %>
<%@ page import="org.wso2.carbon.statistics.ui.StatisticsAdminClient" %>
<%@ page import="org.wso2.carbon.statistics.ui.types.carbon.SystemStatistics" %>
<%@ page import="org.wso2.carbon.ui.CarbonUIUtil" %>
<%@ page import="org.wso2.carbon.utils.ServerConstants" %>
<%@ page import="org.wso2.carbon.ui.CarbonUIMessage" %>
<%
response.setHeader("Cache-Control", "no-cache");
String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session);
ConfigurationContext configContext =
(ConfigurationContext) config.getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
String cookie = (String) session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE);
StatisticsAdminClient client = new StatisticsAdminClient(cookie, backendServerURL,
configContext, request.getLocale());
SystemStatistics systemStats;
try {
systemStats = client.getSystemStatistics();
} catch (Exception e) {
response.setStatus(500);
CarbonUIMessage uiMsg = new CarbonUIMessage(CarbonUIMessage.ERROR, e.getMessage(), e);
session.setAttribute(CarbonUIMessage.ID, uiMsg);
%>
<jsp:include page="../admin/error.jsp"/>
<%
return;
}
%>
<fmt:bundle basename="org.wso2.carbon.statistics.ui.i18n.Resources">
<table width="100%">
<tr>
<td width="49%">
<!-- Service Summary -->
<table class="styledLeft" width="100%" id="serviceSummaryTable" style="margin-left: 0px;">
<thead>
<tr>
<th colspan="2"><fmt:message key="service.summary"/></th>
</tr>
</thead>
<tr class="tableOddRow">
<td width="60%"><fmt:message key="average.response.time"/></td>
<td><%= ((float) Math.round(systemStats.getAvgResponseTime() * 1000)) / 1000 %>
ms
</td>
</tr>
<tr class="tableEvenRow">
<td width="60%"><fmt:message key="minimum.response.time"/></td>
<td>
<% if (systemStats.getMinResponseTime() <= 0) {%>
&lt; 1.00 ms
<% } else {%>
<%= systemStats.getMinResponseTime()%> ms
<% }%>
</td>
</tr>
<tr class="tableOddRow">
<td width="60%"><fmt:message key="maximum.response.time"/></td>
<td><%= systemStats.getMaxResponseTime()%> ms</td>
</tr>
<tr class="tableEvenRow">
<td width="60%"><fmt:message key="total.request.count"/></td>
<td><%= systemStats.getRequestCount()%>
</td>
</tr>
<tr class="tableOddRow">
<td width="60%"><fmt:message key="total.response.count"/></td>
<td><%= systemStats.getResponseCount()%>
</td>
</tr>
<tr class="tableEvenRow">
<td width="60%"><fmt:message key="total.fault.count"/></td>
<td><%= systemStats.getFaultCount()%>
</td>
</tr>
<tr class="tableOddRow">
<td width="60%"><fmt:message key="active.services"/></td>
<td><%= systemStats.getServices()%>
</td>
</tr>
</table>
</td>
<td width="2%">&nbsp;</td>
<td width="49%">
<table class="styledLeft" width="100%" style="margin-left: 0px;">
<thead>
<tr>
<th><fmt:message key="average.response.time.vs.time.units"/></th>
</tr>
</thead>
<tr>
<td>
<div id="responseTimeGraph"
style="width:500px;height:205px;"></div>
</td>
</tr>
</table>
</td>
</tr>
<script type="text/javascript">
graphAvgResponse.add(<%= systemStats.getAvgResponseTime()%>);
drawResponseTimeGraph();
</script>
</table>
</fmt:bundle>

@ -49,7 +49,7 @@
<artifactItem>
<groupId>org.wso2.carbon</groupId>
<artifactId>wso2carbon-core</artifactId>
<version>${carbon.kernel.version}</version>
<version>${carbon.kernel.449.version}</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>target</outputDirectory>
@ -101,19 +101,19 @@
<featureArtifacts>
<!-- START - Analytics Features -->
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.core.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.core.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.datasource.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.datasource.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.restapi.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.restapi.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.spark.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.spark.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.api.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.api.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics-common:org.wso2.carbon.spark.commons.feature:${carbon.analytics.common.version}
@ -127,34 +127,34 @@
org.wso2.carbon.analytics-common:org.wso2.carbon.analytics.gadget.template.feature:${carbon.analytics.common.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.dashboard.ui.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.dashboard.ui.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.dashboards:org.wso2.carbon.dashboards.deployment.feature:${carbon.dashboard.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.messageconsole.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.messageconsole.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.activitydashboard.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.activitydashboard.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.webservice.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.webservice.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.jsservice.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.jsservice.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon:org.wso2.carbon.core.feature:${carbon.kernel.version}
org.wso2.carbon:org.wso2.carbon.core.feature:${carbon.kernel.449.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon:org.wso2.carbon.core.runtime.feature:${carbon.kernel.version}
org.wso2.carbon:org.wso2.carbon.core.runtime.feature:${carbon.kernel.449.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon:org.wso2.carbon.core.ui.feature:${carbon.kernel.version}
org.wso2.carbon:org.wso2.carbon.core.ui.feature:${carbon.kernel.449.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.iot:org.wso2.iot.analytics.styles.feature:${product.iot.analytics.version}
org.wso2.das:org.wso2.das.styles.feature:${product.das.version}
</featureArtifactDef>
<!-- ********* START - Registry related *********** -->
@ -210,10 +210,10 @@
org.wso2.carbon.analytics-common:org.wso2.carbon.databridge.datapublisher.feature:${carbon.analytics.common.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.eventsink.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.eventsink.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.eventtable.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.eventtable.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<!-- ************** END - Data Bridge ************ -->
@ -249,7 +249,7 @@
org.wso2.carbon.identity:org.wso2.carbon.security.mgt.feature:${carbon.identity.framework.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.iot:org.wso2.iot.analytics.multitenancy.dashboard.ui.feature:${product.iot.analytics.version}
org.wso2.das:org.wso2.das.multitenancy.dashboard.ui.feature:${product.das.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.commons:org.wso2.carbon.tenant.mgt.common.feature:${carbon.commons.version}
@ -312,13 +312,13 @@
org.wso2.carbon.analytics-common:org.wso2.carbon.event.processor.manager.commons.feature:${carbon.analytics.common.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.stream.persistence.server.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.stream.persistence.server.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics-common:org.wso2.carbon.event.template.manager.feature:${carbon.analytics.common.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.spark.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.spark.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics-common:org.wso2.carbon.event.stream.template.deployer.server.feature:${carbon.analytics.common.version}
@ -330,7 +330,7 @@
org.wso2.carbon.analytics-common:org.wso2.carbon.dashboard.template.deployer.server.feature:${carbon.analytics.common.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.analytics:org.wso2.carbon.analytics.eventsink.template.deployer.server.feature:${carbon.analytics.version}
org.wso2.carbon.analytics:org.wso2.carbon.analytics.eventsink.template.deployer.server.feature:${carbon.analytics.das.version}
</featureArtifactDef>
<!-- ************** END - EVENT PROCESSING FEATURES ************ -->
@ -403,30 +403,30 @@
<metadataRepository>file:${basedir}/target/p2-repo</metadataRepository>
<artifactRepository>file:${basedir}/target/p2-repo</artifactRepository>
<destination>
${basedir}/target/wso2carbon-core-${carbon.kernel.version}/repository/components
${basedir}/target/wso2carbon-core-${carbon.kernel.449.version}/repository/components
</destination>
<deleteOldProfileFiles>true</deleteOldProfileFiles>
<features>
<!-- START - Analytics Features -->
<feature>
<id>org.wso2.carbon.analytics.core.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.analytics.datasource.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.analytics.restapi.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.analytics.spark.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.analytics.api.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.spark.commons.feature.group</id>
@ -447,7 +447,7 @@
<!-- END - Analytics features -->
<feature>
<id>org.wso2.carbon.analytics.dashboard.ui.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<feature>
@ -460,35 +460,35 @@
</feature>
<feature>
<id>org.wso2.carbon.analytics.messageconsole.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.analytics.activitydashboard.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.analytics.webservice.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.analytics.jsservice.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.core.feature.group</id>
<version>${carbon.kernel.version}</version>
<version>${carbon.kernel.449.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.core.runtime.feature.group</id>
<version>${carbon.kernel.version}</version>
<version>${carbon.kernel.449.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.core.ui.feature.group</id>
<version>${carbon.kernel.version}</version>
<version>${carbon.kernel.449.version}</version>
</feature>
<feature>
<id>org.wso2.iot.analytics.styles.feature.group</id>
<version>${product.iot.analytics.version}</version>
<id>org.wso2.das.styles.feature.group</id>
<version>${product.das.version}</version>
</feature>
<!-- ********* START - Registry related *********** -->
@ -558,11 +558,11 @@
</feature>
<feature>
<id>org.wso2.carbon.analytics.eventsink.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.analytics.eventtable.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<!-- ************** END - Data Bridge ************ -->
@ -607,8 +607,8 @@
<version>${carbon.identity.framework.version}</version>
</feature>
<feature>
<id>org.wso2.iot.analytics.multitenancy.dashboard.ui.feature.group</id>
<version>${product.iot.analytics.version}</version>
<id>org.wso2.das.multitenancy.dashboard.ui.feature.group</id>
<version>${product.das.version}</version>
</feature>
<!-- END - Multitenancy related -->
@ -689,7 +689,7 @@
</feature>
<feature>
<id>org.wso2.carbon.analytics.stream.persistence.server.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.event.template.manager.feature.group</id>
@ -697,11 +697,11 @@
</feature>
<feature>
<id>org.wso2.carbon.analytics.spark.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.analytics.eventsink.template.deployer.server.feature.group</id>
<version>${carbon.analytics.version}</version>
<version>${carbon.analytics.das.version}</version>
</feature>
<!-- ************** END - EVENT PROCESSING FEATURES ************ -->
@ -804,7 +804,7 @@
<configuration>
<tasks>
<replace token="false" value="true"
dir="target/wso2carbon-core-${carbon.kernel.version}/repository/components">
dir="target/wso2carbon-core-${carbon.kernel.449.version}/repository/components">
<include name="**/bundles.info"/>
</replace>
</tasks>

@ -34,9 +34,6 @@
<description>WSO2 IoT Analytics Module</description>
<modules>
<module>styles</module>
<module>org.wso2.iot.analytics.multitenancy.dashboard.ui</module>
<module>features</module>
<module>p2-profile-gen</module>
<module>distribution</module>
</modules>

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-analytics-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wso2iot-analytics-styles-parent</artifactId>
<packaging>pom</packaging>
<name>WSO2 IoT - Analytics - Styles Parent</name>
<modules>
<module>product</module>
<module>service</module>
</modules>
</project>

@ -1,121 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-analytics-styles-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.iot.analytics.styles</artifactId>
<packaging>bundle</packaging>
<name>WSO2 IoT - Analytics - Product UI Styles</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Private-Package>org.wso2.iot.analytics.styles.internal</Private-Package>
<Import-Package>
org.osgi.framework,
org.osgi.service.http,
org.wso2.carbon.ui,
javax.servlet.*;version="2.4.1",
*;resolution:=optional
</Import-Package>
<Fragment-Host>org.wso2.carbon.ui</Fragment-Host>
<Carbon-Component>UIBundle</Carbon-Component>
</instructions>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>META-INF/product.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>META-INF/product.xml</exclude>
</excludes>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.ui</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.registry.core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.main</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.compendium</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.http.servlet</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.http.helper</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.jsp.jasper</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>javax.servlet.jsp</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
</dependencies>
</project>

@ -1,65 +0,0 @@
/*
* 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.
*/
package org.wso2.das.styles.internal;
import org.eclipse.equinox.http.helper.ContextPathServletAdaptor;
import org.eclipse.equinox.jsp.jasper.JspServlet;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpContext;
import org.osgi.service.http.HttpService;
import org.wso2.carbon.ui.DefaultComponentEntryHttpContext;
import javax.servlet.Servlet;
/**
*
*/
public class Activator implements BundleActivator {
private static String CONTEXT = "/styles";
private static String INTERNAL_CONTEXT = "/web";
public void start(BundleContext bundleContext) throws Exception {
ServiceReference reference = bundleContext.getServiceReference(HttpService.class.getName());
if (reference != null) {
final HttpService httpService = (HttpService) bundleContext.getService(reference);
try {
HttpContext commonContext =
new DefaultComponentEntryHttpContext(bundleContext.getBundle(), INTERNAL_CONTEXT);
//register our .jsp files at the httpService
Servlet servlet = new ContextPathServletAdaptor(
new JspServlet(bundleContext.getBundle(), "/web"), CONTEXT);
httpService.registerResources(CONTEXT, "/", commonContext);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
throw new Exception("HttpService is not found.");
}
}
public void stop(BundleContext context) throws Exception {
}
}

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2005-2010, 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.
-->
<component xmlns="http://products.wso2.org/carbon">
<menus>
<menu>
<id>manage_gs</id>
<i18n-key>component.das.dashboard</i18n-key>
<i18n-bundle>org.wso2.das.styles.i18n.Resources</i18n-bundle>
<parent-menu></parent-menu>
<link>#</link>
<region>region1</region>
<order>2</order>
<style-class>home</style-class>
<icon>../menugeneral/images/chart_organisation.gif</icon>
<skip-authentication>false</skip-authentication>
<icon>../dashboard/images/dashboard.gif</icon>
</menu>
</menus>
</component>

@ -1,26 +0,0 @@
<!--
~ Copyright (c) 2005-2010, 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.
-->
<product xmlns="http://products.wso2.org/carbon">
<properties>
<property name="userforum">http://stackoverflow.com/questions/tagged/wso2/</property>
<property name="userguide">https://docs.wso2.com/display/BAM300/WSO2+Business+Activity+Monitor+Documentation
</property>
<property name="mailinglist">http://wso2.org/mail</property>
<property name="issuetracker">https://wso2.org/jira/browse/BAM</property>
</properties>
</product>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

@ -1,145 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!--
~ Copyright (c) 2005-2010, WSO2 Inc. (http://wso2.com) 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.
-->
<html>
<head><title>WSO2 Data Analytics Server - About</title>
<link href="../admin/css/documentation.css" rel="stylesheet" type="text/css" media="all"/>
</head>
<body>
<h1>Version 2.5.0</h1>
<h2>About WSO2 Data Analytics Server </h2>
<p>
WSO2 Data Analytics Server (BAM) is a lean, fully-open source, complete solution for aggregating and analyzing data and presenting information about business activities. It provides real-time visibility into distributed complex systems, including service-oriented architecture (SOA) processes, transactions and workflows.
</p>
<p>
WSO2 Data Analytics Server 2.5.0 developed on top of the revolutionary
<a href="http://wso2.org/projects/caon">Carbon platform</a>
(Middleware a' la carte), and is based on OSGi which provides
better modularity for your SOA architecture.
</p>
<h2>About WSO2 Carbon </h2>
<p>WSO2 Carbon is a component based Enterprise SOA platform. The
design of
WSO2 Carbon focuses on separating the key functionality of the SOA
platform
into separate pluggable Carbon components that can be mixed and
matched, like
customizable building blocks. This allows you to add only the
functionality
you need to start up, and continue to add product capabilities
as your
requirements grow. This helps a business to quickly adapt to
changes.</p>
<p>OSGi is used as the underlying core modularization technology
to build the
Carbon platform. The Carbon framework is shipped with Eclipse Equinox
by
default, but can be supported on Spring dm Server, Felix or Knoplerfish
if
required. The OSGi technology even allows you to write your business
functionality as an OSGi component and deploy it in the existing Carbon
platform. </p>
<p> For a quick start on using the WSO2 Carbon
platform, the Carbon components are pre-assembled into the following
products: </p>
<ul id="CarbonProducts">
<li><a href="http://wso2.com/products/enterprise-service-bus/">WSO2
Enterprise Service Bus</a></li>
<li><a href="http://wso2.com/products/governance-registry/">WSO2
Governance Registry</a></li>
<li><a href="http://wso2.com/products/application-server/">WSO2
Application Server</a></li>
<li><a href="http://wso2.com/products/business-rules-server/">WSO2
Business Rules Server</a></li>
<li><a href="http://wso2.com/products/business-process-server/">WSO2
Business Process Server</a></li>
<li><a href="http://wso2.com/products/identity-server/">WSO2
Identity Server</a></li>
<li><a href="http://wso2.com/products/data-services-server">WSO2
Data Services Server</a></li>
<li><a href="http://wso2.com/products/business-activity-monitor/">WSO2
Data Analytics Server</a></li>
<li><a href="http://wso2.com/products/gadget-server/">WSO2
Gadget Server</a></li>
<li><a href="http://wso2.com/products/mashup-server/">WSO2
Mashup Server</a></li>
</ul>
<p>You can assemble your own products by combining
components and
deploying them in a preferred architecture. </p>
<p>The WSO2 Carbon platform gives maximum flexibility to adapt
the middleware
to your enterprise architecture, rather than adapt your architecture to
the
middleware. </p>
<h2>About WSO2</h2>
<p>WSO2 is an Open Source technology company building Open Source
middleware
platforms for Web services and SOA. WSO2 delivers integrated middleware
stacks based on components developed at Apache, offering industry
leading
performance and convenience for customers. </p>
<p>Founded in August 2005 by pioneers in Web services and Open
Source, WSO2
engineers contribute heavily to many key Apache Web services projects. </p>
<h3>Have you tried...</h3>
<p><a href="http://wso2.com/products/governance-registry/"><img
src="../admin/images/registry_logo_h23.gif" alt="Governance Registry"/></a></p>
<p><a href="http://wso2.com/products/business-rules-server/"><img
src="../admin/images/brs_logo_h23.gif" alt="BRS"/></a></p>
<p><a href="http://wso2.com/products/business-process-server/"><img
src="../admin/images/bps_logo_h23.gif" alt="BPS"/></a></p>
<p><a href="http://wso2.com/products/identity-server/"><img
src="../admin/images/identity_logo_h23.gif" alt="IS"/></a></p>
<p><a href="http://wso2.com/products/data-services-server"><img
src="../admin/images/ds_logo_h23.gif" alt="DS"/></a></p>
<p><a href="http://wso2.com/products/business-activity-monitor/"><img
src="../admin/images/bam_logo_h23.gif" alt="BAM"/></a></p>
<p><a href="http://wso2.com/products/gadget-server/"><img
src="../admin/images/gadgetserver_logo_h23.gif" alt="GS"/></a></p>
<p><a href="http://wso2.com/products/mashup-server/"><img
src="../admin/images/mashup_logo_h23.gif" alt="MS"/></a></p>
<h3>Stay connected </h3>
<p><a href="http://wso2.org/user/login?destination=newsletter/subscriptions">Subscribe</a>
to the WSO2 newsletter - project updates, events, articles, SOA news
and much
more.</p>
</body>
</html>

@ -1,220 +0,0 @@
/* ---------------- template styles ------------------------- */
table#main-table td#header {
height:80px;
}
table#main-table td#menu-panel {
border-right: solid 1px #91961f;
background-image: url(../images/analytics-iots-menu-panel-bg.png);
background-position: right top;
background-repeat: repeat-y;
}
/* ---------------- header styles ------------------ */
div#header-div {
height:80px;
}
div#header-div div.left-logo {
background-image: url( ../images/analytics-iots-logo.png);
margin-left: 30px;
margin-top: 10px;
width:260px;
height:60px;
}
div#header-div div.right-logo {
color: #cc362b;
height:32px;
margin-right:20px;
line-height: 30px;
margin-top:7px;
padding-right:0px;
padding-top:5px;
}
div#header-div div.header-links {
margin-top:-20px;
}
div#header-div div.header-links div.right-links {
margin-right: 0px;
height: 35px;
padding-top: 0px;
}
div#header-div div.header-links div.right-links ul {
background:none;
padding-left: 25px;
padding-right: 15px;
padding-top: 0px;
padding-bottom: 7px;
}
#logged-user{
color:#555;
}
/* ------------- menu styles ---------------------- */
div#menu {
}
div#menu ul.main {
}
div#menu ul.main li {
}
div#menu ul.main li.normal {
}
div#menu ul.main li a.menu-home {
background-image:url(../images/menu_header.gif);
height:28px;
}
div#menu ul.main li.menu-header {
background-image: url(../images/analytics-iots-menu-header.gif);
background-position: left bottom;
background-repeat: repeat-x;
height: 32px;
line-height: 32px;
}
div#menu ul.main li a.menu-default {
}
div#menu ul.main li a.menu-default:hover {
background-color: #EFECF5;
border-bottom: solid 1px #C2B7D8;
border-top: solid 1px #C2B7D8;
color: #00447C;
}
div#menu ul.sub {
}
/* -------------- child no-01 styles -------------- */
div#menu ul.sub li.normal {
}
div#menu ul.sub li a.menu-default {
}
/* ----------- child no-01 (disabled) styles ------------------- */
div#menu ul.sub li a.menu-disabled-link {
}
div#menu ul.sub li a.menu-disabled-link:hover {
}
/* -------------- child no-02 styles -------------- */
div#menu ul.sub li.normal ul.sub li a.menu-default {
}
/* -------------- child no-03 styles -------------- */
div#menu ul.sub li.normal ul.sub li.normal ul.sub li a.menu-default {
}
/* ------------- footer styles -------------------- */
div#footer-div div.footer-content div.poweredby {
background-image: url(../images/powered-synapse.gif);
background-position: right top;
}
/* ---- login styles ----- */
/* --------------- table styles -------------------- */
.tableOddRow{background-color: white;}
.tableEvenRow{background-color: #EFECF5;}
.button:hover{
/*background-image:url(../images/esb-button-bg-hover.gif);
border:solid 1px #8268A8;*/
}
/* =============================================================================================================== */
.cornerExpand {
position: relative;
top: 3px;
left: -12px;
cursor: pointer;
}
.cornerCollapse {
position: relative;
top: 3px;
left: -12px;
cursor: pointer;
}
/* chanaka */
.form-table td{
padding-bottom:5px !important;
padding-left:5px !important;
padding-top:5px !important;
padding-right:10px !important;
}
.form-table td div.indented{
padding-left:7px !important;
color:#595959 !important;
}
.form-table-left{
width:80px;
}
table#main-table td#header{
height:80px;
}
.longTextField{
width:270px;
}
.rowAlone{
padding-top:10px;
padding-bottom:10px;
}
.tabedBox{
border:solid 1px #cccccc;
margin-left:10px;
padding:10px;
margin-bottom:10px;
}
/* chanaka end */
a.fact-selector-icon-link {
background-image: url( ../images/facts-selector.gif );
background-repeat: no-repeat;
background-position: left top;
padding-left: 20px;
line-height: 17px;
height: 17px;
float: left;
position: relative;
margin-left: 10px;
margin-top: 5px;
margin-bottom: 3px;
white-space: nowrap;
}
table#main-table td#middle-content {
background-color:#f5f6fb;
}
div#middle{
background-color:#f5f6fb;
}
div#middle h2{
color:#8a2c3f;
}
div#menu ul.main li.menu-disabled-link{
background-color:#eff1f9;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 967 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

@ -1,121 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-analytics-styles-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.iot.analytics.multitenancy.styles</artifactId>
<packaging>bundle</packaging>
<name>WSO2 IoT - Analytics - Multi-tenant UI Styles</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Private-Package>org.wso2.iot.analytics.multitenancy.styles.internal</Private-Package>
<Import-Package>
org.osgi.framework,
org.osgi.service.http,
org.wso2.carbon.ui,
javax.servlet.*;version="2.4.1",
*;resolution:=optional
</Import-Package>
<Fragment-Host>org.wso2.carbon.ui</Fragment-Host>
<Carbon-Component>UIBundle</Carbon-Component>
</instructions>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>META-INF/product.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>META-INF/product.xml</exclude>
</excludes>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.ui</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.registry.core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.main</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.compendium</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.http.servlet</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.http.helper</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.jsp.jasper</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>javax.servlet.jsp</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
</dependencies>
</project>

@ -1,63 +0,0 @@
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
* 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.
*/
package org.wso2.das.styles.internal;
import org.eclipse.equinox.http.helper.ContextPathServletAdaptor;
import org.eclipse.equinox.jsp.jasper.JspServlet;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpContext;
import org.osgi.service.http.HttpService;
import org.wso2.carbon.ui.DefaultComponentEntryHttpContext;
import javax.servlet.Servlet;
/**
*
*/
public class Activator implements BundleActivator {
private static String CONTEXT = "/styles";
private static String INTERNAL_CONTEXT = "/web";
public void start(BundleContext bundleContext) throws Exception {
ServiceReference reference = bundleContext.getServiceReference(HttpService.class.getName());
if (reference != null) {
final HttpService httpService = (HttpService) bundleContext.getService(reference);
try {
HttpContext commonContext =
new DefaultComponentEntryHttpContext(bundleContext.getBundle(), INTERNAL_CONTEXT);
//register our .jsp files at the httpService
Servlet servlet = new ContextPathServletAdaptor(
new JspServlet(bundleContext.getBundle(), "/web"), CONTEXT);
httpService.registerResources(CONTEXT, "/", commonContext);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
throw new Exception("HttpService is not found.");
}
}
public void stop(BundleContext context) throws Exception {
}
}

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2005-2010, 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.
-->
<component xmlns="http://products.wso2.org/carbon">
<menus>
<menu>
<id>manage_gs</id>
<i18n-key>component.das.dashboard</i18n-key>
<i18n-bundle>org.wso2.das.styles.i18n.Resources</i18n-bundle>
<parent-menu></parent-menu>
<link>#</link>
<region>region1</region>
<order>2</order>
<style-class>home</style-class>
<icon>../menugeneral/images/chart_organisation.gif</icon>
<skip-authentication>false</skip-authentication>
<icon>../dashboard/images/dashboard.gif</icon>
</menu>
</menus>
</component>

@ -1,26 +0,0 @@
<!--
~ Copyright (c) 2005-2010, 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.
-->
<product xmlns="http://products.wso2.org/carbon">
<properties>
<property name="userforum">http://stackoverflow.com/questions/tagged/wso2/</property>
<property name="userguide">https://docs.wso2.com/display/BAM300/WSO2+Business+Activity+Monitor+Documentation
</property>
<property name="mailinglist">http://wso2.org/mail</property>
<property name="issuetracker">https://wso2.org/jira/browse/BAM</property>
</properties>
</product>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

@ -1,261 +0,0 @@
/* ---------------- template styles ------------------------- */
table#main-table td#header {
background-color: #3B003D;
background-image: url(../images/back-repeat.png);
background-repeat: repeat-x;
height: 70px;
border-bottom: solid 1px #000000;
}
table#main-table td#menu-panel {
border-right: solid 1px #989898;
/ / background-image : url(../images/bam-server-menu-panel-bg.gif);
background-position: right top;
background-repeat: repeat-y;
}
/* ---------------- header styles ------------------ */
div#header-div {
background-image: url(../images/bam-header-bg.png);
height: 70px;
}
div#header-div div.left-logo {
background-image: url(../images/bam-header-logo.png);
margin-left: 25px;
margin-top: 22px;
position: absolute;
}
div#header-div div.right-logo {
color: #ffffff;
height: 32px;
margin-right: 20px;
line-height: 30px;
margin-top: 10px;
padding-right: 0px;
padding-top: 0px;
}
div#header-div div.header-links {
margin-top: 0px;
}
div#header-div div.header-links div.right-links {
margin-right: 0px;
height: 27px;
padding-top: 0px;
color: #ffffff;
}
div#header-div div.header-links div.right-links a {
color: #91e9c7;
}
div#header-div div.header-links div.right-links ul {
background-image: none;
background-position: left top;
background-repeat: repeat-x;
padding-left: 25px;
padding-right: 15px;
padding-top: 4px;
padding-bottom: 4px;
}
/* ------------- menu styles ---------------------- */
div#menu {
}
div#menu ul.main {
}
div#menu ul.main li {
}
div#menu ul.main li.normal {
}
div#menu ul.main li a.menu-home {
background-image: url(../images/menu_header.gif);
height: 28px;
}
div#menu ul.main li.menu-header {
background-image: url(../images/bam-server-menu-header.gif);
background-position: left bottom;
background-repeat: repeat-x;
height: 32px;
line-height: 32px;
}
div#menu ul.main li a.menu-default {
}
div#menu ul.main li a.menu-default:hover {
background-color: #EFECF5;
border-bottom: solid 1px #C2B7D8;
border-top: solid 1px #C2B7D8;
color: #00447C;
}
div#menu ul.sub {
}
/* -------------- child no-01 styles -------------- */
div#menu ul.sub li.normal {
}
div#menu ul.sub li a.menu-default {
}
/* ----------- child no-01 (disabled) styles ------------------- */
div#menu ul.sub li a.menu-disabled-link {
}
div#menu ul.sub li a.menu-disabled-link:hover {
}
/* -------------- child no-02 styles -------------- */
div#menu ul.sub li.normal ul.sub li a.menu-default {
}
/* -------------- child no-03 styles -------------- */
div#menu ul.sub li.normal ul.sub li.normal ul.sub li a.menu-default {
}
/* ------------- footer styles -------------------- */
div#footer-div div.footer-content div.poweredby {
background-image: url(../images/powered-synapse.gif);
background-position: right top;
}
/* ---- login styles ----- */
/* --------------- table styles -------------------- */
.tableOddRow {
background-color: white;
}
.tableEvenRow {
background-color: #EFECF5;
}
.button:hover {
}
/* =============================================================================================================== */
.cornerExpand {
position: relative;
top: 3px;
left: -12px;
cursor: pointer;
}
.cornerCollapse {
position: relative;
top: 3px;
left: -12px;
cursor: pointer;
}
/* chanaka */
.form-table td {
padding-bottom: 5px !important;
padding-left: 5px !important;
padding-top: 5px !important;
padding-right: 10px !important;
}
.form-table td div.indented {
padding-left: 7px !important;
color: #595959 !important;
}
.form-table-left {
width: 100px;
}
.longTextField {
width: 270px;
}
.rowAlone {
padding-top: 10px;
padding-bottom: 10px;
}
.tabedBox {
border: solid 1px #cccccc;
margin-left: 10px;
padding: 10px;
margin-bottom: 10px;
}
/* chanaka end */
a.fact-selector-icon-link {
background-image: url(../images/facts-selector.gif);
background-repeat: no-repeat;
background-position: left top;
padding-left: 20px;
line-height: 17px;
height: 17px;
float: left;
position: relative;
margin-left: 10px;
margin-top: 5px;
margin-bottom: 3px;
white-space: nowrap;
}
table#main-table td#middle-content {
background-image: url(../images/menu-margin.gif);
background-position: left top;
background-repeat: repeat-y;
background-color: #ffffff;
}
div#middle {
background-color: #ffffff;
}
/* new theme 01-07-2013 */
table#main-table td.vertical-menu-container {
background-color: #444;
padding-left: 5px;
border-top: 0px;
}
div.menu-panel-buttons {
border-top-left-radius: 7px;
border-bottom-left-radius: 7px;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
padding: 15px 3px;
}
div.selected span {
font-weight: bold;
color: #ffffff;
background-color: #555555;
}
div.menu-panel-buttons span {
}
div.selected {
border: 0px;
background-color: #555555;
box-shadow: none;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

@ -0,0 +1,89 @@
# Install cdmf-devicetype-archetype
First you need to download this maven archetype. To download
git clone https://github.com/GPrathap/cdmf-devicetype-archetype.git
To install this maven archetype into your local system, inside the cdmf-devicetype-archetype
mvn clean install
# Create sample device type plugin using cdmf-devicetype-archetype
First download WOS2 IoT Server and copy the downloaded file to a preferred location and unzip it. The unzipped folder rename as IOTS_HOME.
To create new project go to this folder: IOTS_HOME/samples
mvn archetype:generate -DarchetypeCatalog=local
Then select the cdmf.devicetype:cdmf-devicetype-archetype as new archetype.
jobs@jobs-ThinkPad-T530:~/wso2/IoT/m3/product/IOTS_HOME/samples$
mvn archetype:generate -DarchetypeCatalog=local
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: local -> org.apache.synapse:synapse-package-archetype (This archetype can be used to create Maven projects that bundle a mediation
into a standalone distribution ready to be executed)
2: local -> org.wso2.mdm:mdm-android-agent-archetype (Creates a MDM-Android agent project)
3: local -> org.wso2.cdmf.devicetype:cdmf-devicetype-archetype (WSO2 CDMF Device Type Archetype)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 3
Then you need to provide groupId, artifactId, version, packaging, name of your device type and name for sensor as shown below.
Define value for property 'groupId': : org.homeautomation
Define value for property 'artifactId': : currentsensor
Define value for property 'version': 1.0-SNAPSHOT: : 1.0.0-SNAPSHOT
Define value for property 'package': org.homeautomation: :
Define value for property 'deviceType': : currentsensor
Define value for property 'nameOfTheSensor': : current
Confirm properties configuration:
groupId: org.homeautomation
artifactId: currentsensor
version: 1.0.0-SNAPSHOT
package: org.homeautomation
deviceType: currentsensor
nameOfTheSensor: current
# Configure the device-deployer.xml file that is in the IoTS_HOME directory.
Add the new module under the <modules> tag.
<modules>
<module>samples/currentsensor</module>
</modules>
Add the device type feature under the `<featureArtifacts>` tag.
<featureArtifactDef>org.homeautomation:org.homeautomation.currentsensor.feature:1.0.0-SNAPSHOT
</featureArtifactDef>
Add the device type feature group under the <features> tag.
<features>
<feature>
<id>org.homeautomation.currentsensor.feature.group</id>
<version>1.0.0-SNAPSHOT</version>
</feature>
</features>
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

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.wso2.iot</groupId>
<artifactId>wso2iot-core-tools</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>iot-devicetype-archetype</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>WSO2 IoT Device Type Archetype</name>
<description>WSO2 IoT Device Type Archetype</description>
<packaging>maven-archetype</packaging>
<organization>
<name>WSO2 Inc.</name>
<url>http://www.wso2.com</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.archetype</groupId>
<artifactId>archetype-packaging</artifactId>
<version>${archetype.packaging.version}</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-archetype-plugin</artifactId>
<version>${archetype.plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<properties>
<archetype.packaging.version>2.4</archetype.packaging.version>
<archetype.plugin.version>2.4</archetype.plugin.version>
</properties>
</project>

@ -0,0 +1,163 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<archetype-descriptor name="${deviceType}">
<requiredProperties>
<requiredProperty key="deviceType"></requiredProperty>
<requiredProperty key="nameOfTheSensor"></requiredProperty>
</requiredProperties>
<modules>
<module id="${rootArtifactId}-component" dir="component" name="${rootArtifactId}-component">
<modules>
<module id="${groupId}.${rootArtifactId}.plugin" dir="plugin"
name="${groupId}.${rootArtifactId}.plugin">
<fileSets>
<fileSet filtered="true" packaged="false" encoding="UTF-8">
<directory>src/main/java/</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/main/resources</directory>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/test/resources</directory>
</fileSet>
</fileSets>
</module>
<module id="${groupId}.${rootArtifactId}.api" dir="api"
name="${groupId}.${rootArtifactId}.api">
<fileSets>
<fileSet filtered="true" packaged="false" encoding="UTF-8">
<directory>src/main/java/</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/main/webapp</directory>
<includes>
<include>**/*.xml</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/main/resources</directory>
</fileSet>
<fileSet filtered="true" packaged="false" encoding="UTF-8">
<directory>src/test/java/__groupId__.__rootArtifactId__.api</directory>
</fileSet>
<fileSet encoding="UTF-8">
<directory>src/test/resources</directory>
</fileSet>
</fileSets>
</module>
<module id="${groupId}.${rootArtifactId}.ui" dir="ui" name="${groupId}.${rootArtifactId}.ui">
<fileSets>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/assembly</directory>
<includes>
<include>**/*.xml</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/main/resources/</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
<include>**/*.car</include>
<include>**/*.db</include>
<include>**/*.sql</include>
<include>**/*.json</include>
<include>**/*.inf</include>
<include>**/*.sh</include>
<include>**/*.hbs</include>
<include>**/*.py</include>
<include>**/*-view.js</include>
<include>**/*-graph.js</include>
</includes>
</fileSet>
<fileSet filtered="false" encoding="UTF-8">
<directory>src/main/resources/</directory>
<includes>
<include>**/*.png</include>
<include>**/*.js</include>
<include>**/*.css</include>
</includes>
</fileSet>
</fileSets>
</module>
<module id="${groupId}.${rootArtifactId}.analytics" dir="analytics"
name="${groupId}.${rootArtifactId}.analytics">
<fileSets>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/assembly</directory>
<includes>
<include>**/*.xml</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/main/resources/carbonapps</directory>
<includes>
<include>**/*.*</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory></directory>
<includes>
<include>build.xml</include>
</includes>
</fileSet>
</fileSets>
</module>
</modules>
</module>
<module id="${rootArtifactId}-feature" dir="feature" name="${rootArtifactId}-feature">
<modules>
<module id="${groupId}.${rootArtifactId}.feature" dir="feature"
name="${groupId}.${rootArtifactId}.feature">
<fileSets>
<fileSet filtered="true" encoding="UTF-8">
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
<include>**/*.car</include>
<include>**/*.db</include>
<include>**/*.sql</include>
<include>**/*.json</include>
<include>**/*.inf</include>
<include>**/*.hbs</include>
<include>**/*.py</include>
</includes>
</fileSet>
<fileSet filtered="false" encoding="UTF-8">
<directory>src/main/resources/</directory>
<includes>
<include>**/*.png</include>
<include>**/*.js</include>
<include>**/*.sh</include>
<include>**/*.css</include>
</includes>
</fileSet>
</fileSets>
</module>
</modules>
</module>
</modules>
</archetype-descriptor>

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--/*
* 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.
*/-->
<project name="create-sample-sensor-capps" default="zip" basedir=".">
<property name="project-name" value="${ant.project.name}"/>
<property name="target-dir" value="target/carbonapps"/>
<property name="src-dir" value="src/main/resources/carbonapps"/>
<property name="sensor_dir" value="${nameOfTheSensor}"/>
<target name="clean">
<delete dir="${target-dir}" />
</target>
<target name="zip" depends="clean">
<mkdir dir="${target-dir}"/>
<zip destfile="${target-dir}/${sensor_dir}.car">
<zipfileset dir="${src-dir}/${sensor_dir}"/>
</zip>
</target>
</project>

@ -0,0 +1,86 @@
<!--/*
* 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.
*/-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-component</artifactId>
<version>${version}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
<packaging>pom</packaging>
<name> ${artifactId} </name>
<url>http://wso2.org</url>
<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
<executions>
<execution>
<id>auto-clean</id>
<phase>initialize</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>${wso2.maven.compiler.source}</version>
<executions>
<execution>
<phase>process-resources</phase>
<configuration>
<target>
<ant antfile="build.xml" target="zip"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<configuration>
<finalName>${project.artifactId}-${version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/src.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>create-archive</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -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.
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>src</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<baseDirectory>${basedir}/src</baseDirectory>
<fileSets>
<fileSet>
<directory>${basedir}/target/carbonapps</directory>
<outputDirectory>/</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
</fileSet>
</fileSets>
</assembly>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<eventPublisher name="EventPublisher_${nameOfTheSensor}" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventpublisher">
<from streamName="org.wso2.iot.devices.${nameOfTheSensor}" version="1.0.0"/>
<mapping customMapping="disable" type="wso2event"/>
<to eventAdapterType="secured-ui"/>
</eventPublisher>

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<artifact name="Eventpublisher_${nameOfTheSensor}" version="1.0.0" type="event/publisher" serverRole="DataAnalyticsServer">
<file>EventPublisher_${nameOfTheSensor}.xml</file>
</artifact>

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<eventReceiver name="${nameOfTheSensor}-mqtt" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventreceiver">
<from eventAdapterType="oauth-mqtt">
<property name="topic">carbon.super/${deviceType}/+/publisher</property>
<property name="username">admin</property>
<property name="contentValidatorParams">device_id_json_path:event.metaData.deviceId,device_id_topic_hierarchy_index:2</property>
<property name="contentValidator">org.wso2.carbon.device.mgt.iot.input.adapter.mqtt.util.MQTTContentValidator</property>
<property name="contentTransformer">default</property>
<property name="dcrUrl">https://localhost:${carbon.https.port}/dynamic-client-web/register</property>
<property name="url">tcp://${mqtt.broker.host}:${mqtt.broker.port}</property>
<property name="cleanSession">true</property>
</from>
<mapping customMapping="disable" type="json"/>
<to streamName="org.wso2.iot.devices.${nameOfTheSensor}" version="1.0.0"/>
</eventReceiver>

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<artifact name="Eventreceiver_mqtt_${nameOfTheSensor}" version="1.0.0" type="event/receiver" serverRole="DataAnalyticsServer">
<file>EventReceiver_mqtt_${nameOfTheSensor}.xml</file>
</artifact>

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<artifact name="Eventstore_${nameOfTheSensor}" version="1.0.0" type="analytics/eventstore" serverRole="DataAnalyticsServer">
<file>org_wso2_iot_devices_${nameOfTheSensor}.xml</file>
</artifact>

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
~ 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.
-->
<EventStoreConfiguration>
<Source>
<StreamId>org.wso2.iot.devices.${nameOfTheSensor}:1.0.0</StreamId>
</Source>
<RecordStoreName>EVENT_STORE</RecordStoreName>
<TableSchema>
<ColumnDefinition>
<Name>meta_owner</Name>
<EnableIndexing>true</EnableIndexing>
<IsPrimaryKey>true</IsPrimaryKey>
<EnableScoreParam>false</EnableScoreParam>
<Type>STRING</Type>
</ColumnDefinition>
<ColumnDefinition>
<Name>meta_deviceType</Name>
<EnableIndexing>true</EnableIndexing>
<IsPrimaryKey>true</IsPrimaryKey>
<EnableScoreParam>false</EnableScoreParam>
<Type>STRING</Type>
</ColumnDefinition>
<ColumnDefinition>
<Name>meta_deviceId</Name>
<EnableIndexing>true</EnableIndexing>
<IsPrimaryKey>true</IsPrimaryKey>
<EnableScoreParam>false</EnableScoreParam>
<Type>STRING</Type>
</ColumnDefinition>
<ColumnDefinition>
<Name>meta_time</Name>
<EnableIndexing>true</EnableIndexing>
<IsPrimaryKey>true</IsPrimaryKey>
<EnableScoreParam>false</EnableScoreParam>
<Type>LONG</Type>
</ColumnDefinition>
<ColumnDefinition>
<Name>${nameOfTheSensor}</Name>
<EnableIndexing>false</EnableIndexing>
<IsPrimaryKey>false</IsPrimaryKey>
<EnableScoreParam>false</EnableScoreParam>
<Type>FLOAT</Type>
</ColumnDefinition>
</TableSchema>
</EventStoreConfiguration>

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<artifact name="Eventstream_${nameOfTheSensor}" version="1.0.0" type="event/stream" serverRole="DataAnalyticsServer">
<file>org.wso2.iot.devices.${nameOfTheSensor}_1.0.0.json</file>
</artifact>

@ -0,0 +1,20 @@
{
"name": "org.wso2.iot.devices.${nameOfTheSensor}",
"version": "1.0.0",
"nickName": "${nameOfTheSensor}",
"description": "${nameOfTheSensor} data received from the Device",
"metaData": [
{"name":"owner","type":"STRING"},
{"name":"deviceType","type":"STRING"},
{"name":"deviceId","type":"STRING"},
{"name":"time","type":"LONG"}
],
"payloadData": [
{
"name": "${nameOfTheSensor}","type": "FLOAT"
}
]
}

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
~ 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.
-->
<Analytics>
<Name>IoTServer_Sensor_Script</Name>
<Script>
CREATE TEMPORARY TABLE Device${nameOfTheSensor}Data USING CarbonAnalytics OPTIONS(tableName "ORG_WSO2_IOT_DEVICES_${nameOfTheSensor}");
CREATE TEMPORARY TABLE Device${nameOfTheSensor}SummaryData USING CarbonAnalytics OPTIONS (tableName "DEVICE_${nameOfTheSensor}_SUMMARY", schema "${nameOfTheSensor} FLOAT, deviceType STRING -i, deviceId STRING -i, owner STRING -i, time LONG -i",primaryKeys "deviceType, deviceId, owner, time");
insert overwrite table Device${nameOfTheSensor}SummaryData select ${nameOfTheSensor}, meta_deviceType as deviceType, meta_deviceId as deviceId, meta_owner as owner, cast(meta_time/1000 as BIGINT)as time from Device${nameOfTheSensor}Data group by ${nameOfTheSensor}, meta_deviceType, meta_deviceId, meta_owner, cast(meta_time/1000 as BIGINT);
</Script>
<CronExpression>0 * * * * ?</CronExpression>
</Analytics>

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<artifact name="Sparkscripts" version="1.0.0" type="analytics/spark" serverRole="DataAnalyticsServer">
<file>${nameOfTheSensor}_Script.xml</file>
</artifact>

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<artifacts>
<artifact name="${nameOfTheSensor}_CAPP" version="1.0.0" type="carbon/application">
<dependency artifact="Eventstream_${nameOfTheSensor}" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="Eventstore_${nameOfTheSensor}" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="Eventreceiver_mqtt_${nameOfTheSensor}" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="Eventpublisher_${nameOfTheSensor}" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
<dependency artifact="Sparkscripts" version="1.0.0" include="true" serverRole="DataAnalyticsServer"/>
</artifact>
</artifacts>

@ -0,0 +1,173 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-component</artifactId>
<version>${version}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>${project-base-package}.api</artifactId>
<version>${version}</version>
<packaging>war</packaging>
<name>${project-base-package}.api</name>
<url>http://wso2.com</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<warName>${project-base-package}.api</warName>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- CDM -->
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.apache.axis2.wso2</groupId>
<artifactId>axis2-client</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--CXF -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<scope>provided</scope>
</dependency>
<!--MQTT -->
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<scope>provided</scope>
</dependency>
<!--IOT -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpasyncclient</artifactId>
<version>4.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>org.wso2.carbon.device.mgt.iot</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${groupId}</groupId>
<artifactId>${project-base-package}.plugin</artifactId>
<scope>provided</scope>
</dependency>
<!--JAX-RS -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.apimgt.annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.analytics</groupId>
<artifactId>org.wso2.carbon.analytics.api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.analytics</groupId>
<artifactId>org.wso2.carbon.analytics.api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.extensions</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.identity.jwt.client.extension</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.apimgt.application.extension</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

@ -0,0 +1,115 @@
/*
* 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.
*/
package ${groupId}.${rootArtifactId}.api;
import ${groupId}.${rootArtifactId}.api.dto.DeviceJSON;
import org.wso2.carbon.apimgt.annotations.api.API;
import org.wso2.carbon.apimgt.annotations.api.Permission;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.DeviceType;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.Feature;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Path;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Produces;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import javax.ws.rs.PUT;
import javax.ws.rs.DELETE;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
/**
* This is the controller API which is used to control agent side functionality
*/
@SuppressWarnings("NonJaxWsWebServices")
@API(name = "${deviceType}", version = "1.0.0", context = "/${deviceType}", tags = "${deviceType}")
@DeviceType(value = "${deviceType}")
public interface DeviceTypeService {
/**
* @param agentInfo device owner,id and sensor value
* @return
*/
@Path("device/register")
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Permission(scope = "${deviceType}_user", permissions = {"/permission/admin/device-mgt/user/register"})
Response registerDevice(final DeviceJSON agentInfo);
/**
* @param deviceId unique identifier for given device type
* @param state change status of sensor: on/off
* @param response
*/
@Path("device/{deviceId}/change-status")
@POST
@Feature(code = "change-status", name = "Change status of sensor: on/off",
description = "Change status of sensor: on/off")
@Permission(scope = "${deviceType}_user", permissions = {"/permission/admin/device-mgt/change-status"})
Response changeStatus(@PathParam("deviceId") String deviceId,
@QueryParam("state") String state,
@Context HttpServletResponse response);
/**
* Retrieve Sensor data for the ${deviceType}
*/
@Path("device/stats/{deviceId}")
@GET
@Consumes("application/json")
@Produces("application/json")
@Permission(scope = "${deviceType}_user", permissions = {"/permission/admin/device-mgt/stats"})
Response getSensorStats(@PathParam("deviceId") String deviceId, @QueryParam("from") long from,
@QueryParam("to") long to);
@Path("/device/{device_id}")
@DELETE
@Permission(scope = "${deviceType}_user", permissions = {"/permission/admin/device-mgt/removeDevice"})
Response removeDevice(@PathParam("device_id") String deviceId);
@Path("/device/{device_id}")
@PUT
@Permission(scope = "${deviceType}_user", permissions = {"/permission/admin/device-mgt/updateDevice"})
Response updateDevice(@PathParam("device_id") String deviceId, @QueryParam("name") String name);
@Path("/device/{device_id}")
@GET
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Permission(scope = "${deviceType}_user", permissions = {"/permission/admin/device-mgt/updateDevice"})
Response getDevice(@PathParam("device_id") String deviceId);
@Path("/devices")
@GET
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Permission(scope = "${deviceType}_user", permissions = {"/permission/admin/device-mgt/devices"})
Response getAllDevices();
@Path("/device/download")
@GET
@Produces("application/zip")
@Permission(scope = "${deviceType}_user", permissions = {"/permission/admin/device-mgt/download"})
Response downloadSketch(@QueryParam("deviceName") String deviceName, @QueryParam("sketchType") String sketchType);
}

@ -0,0 +1,384 @@
/*
* 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.
*/
package ${groupId}.${rootArtifactId}.api;
import ${groupId}.${rootArtifactId}.api.dto.DeviceJSON;
import ${groupId}.${rootArtifactId}.api.dto.SensorRecord;
import ${groupId}.${rootArtifactId}.api.util.APIUtil;
import ${groupId}.${rootArtifactId}.api.util.ZipUtil;
import ${groupId}.${rootArtifactId}.plugin.constants.DeviceTypeConstants;
import ${groupId}.${rootArtifactId}.api.DeviceTypeService;
import org.apache.commons.io.FileUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.analytics.dataservice.commons.SORT;
import org.wso2.carbon.analytics.dataservice.commons.SortByField;
import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException;
import org.wso2.carbon.apimgt.annotations.api.API;
import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService;
import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey;
import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.DeviceType;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.Feature;
import org.wso2.carbon.device.mgt.iot.util.ZipArchive;
import org.wso2.carbon.identity.jwt.client.extension.JWTClient;
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException;
import org.wso2.carbon.user.api.UserStoreException;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Path;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Produces;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import javax.ws.rs.PUT;
import javax.ws.rs.DELETE;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.UUID;
import java.util.Map;
import java.util.List;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.Date;
import java.util.concurrent.ConcurrentHashMap;
/**
* This is the controller API which is used to control agent side functionality
*/
@SuppressWarnings("NonJaxWsWebServices")
@API(name = "${deviceType}", version = "1.0.0", context = "/${deviceType}", tags = "${deviceType}")
@DeviceType(value = "${deviceType}")
public class DeviceTypeServiceImpl implements DeviceTypeService {
private static final String KEY_TYPE = "PRODUCTION";
private static Log log = LogFactory.getLog(DeviceTypeService.class);
private static ApiApplicationKey apiApplicationKey;
private ConcurrentHashMap<String, DeviceJSON> deviceToIpMap = new ConcurrentHashMap<>();
private static String shortUUID() {
UUID uuid = UUID.randomUUID();
long l = ByteBuffer.wrap(uuid.toString().getBytes(StandardCharsets.UTF_8)).getLong();
return Long.toString(l, Character.MAX_RADIX);
}
/**
* @param agentInfo device owner,id and sensor value
* @return
*/
@Path("device/register")
@POST
@Consumes(MediaType.APPLICATION_JSON)
public Response registerDevice(final DeviceJSON agentInfo) {
String deviceId = agentInfo.deviceId;
if ((agentInfo.deviceId != null) && (agentInfo.owner != null)) {
deviceToIpMap.put(deviceId, agentInfo);
return Response.status(Response.Status.OK).build();
}
return Response.status(Response.Status.NOT_ACCEPTABLE).build();
}
/**
* @param deviceId unique identifier for given device type
* @param state change status of sensor: on/off
* @param response
*/
@Path("device/{deviceId}/change-status")
@POST
@Feature(code = "change-status", name = "Change status of sensor: on/off",
description = "Change status of sensor: on/off")
public Response changeStatus(@PathParam("deviceId") String deviceId,
@QueryParam("state") String state,
@Context HttpServletResponse response) {
try {
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
DeviceTypeConstants.DEVICE_TYPE))) {
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
}
String sensorState = state.toUpperCase();
if (!sensorState.equals(DeviceTypeConstants.STATE_ON) && !sensorState.equals(
DeviceTypeConstants.STATE_OFF)) {
log.error("The requested state change should be either - 'ON' or 'OFF'");
return Response.status(Response.Status.BAD_REQUEST.getStatusCode()).build();
}
Map<String, String> dynamicProperties = new HashMap<>();
String publishTopic = APIUtil.getAuthenticatedUserTenantDomain()
+ "/" + DeviceTypeConstants.DEVICE_TYPE + "/" + deviceId + "/command";
dynamicProperties.put(DeviceTypeConstants.ADAPTER_TOPIC_PROPERTY, publishTopic);
APIUtil.getOutputEventAdapterService().publish(DeviceTypeConstants.MQTT_ADAPTER_NAME,
dynamicProperties, state);
return Response.ok().build();
} catch (DeviceAccessAuthorizationException e) {
log.error(e.getErrorMessage(), e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
}
}
/**
* Retrieve Sensor data for the
*/
@Path("device/stats/{deviceId}")
@GET
@Consumes("application/json")
@Produces("application/json")
public Response getSensorStats(@PathParam("deviceId") String deviceId, @QueryParam("from") long from,
@QueryParam("to") long to) {
String fromDate = String.valueOf(from);
String toDate = String.valueOf(to);
String query = "deviceId:" + deviceId + " AND deviceType:" +
DeviceTypeConstants.DEVICE_TYPE + " AND time : [" + fromDate + " TO " + toDate + "]";
String sensorTableName = DeviceTypeConstants.SENSOR_EVENT_TABLE;
try {
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(new DeviceIdentifier(deviceId,
DeviceTypeConstants.DEVICE_TYPE))) {
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
}
if (sensorTableName != null) {
List<SortByField> sortByFields = new ArrayList<>();
SortByField sortByField = new SortByField("time", SORT.ASC, false);
sortByFields.add(sortByField);
List<SensorRecord> sensorRecords = APIUtil.getAllEventsForDevice(sensorTableName, query, sortByFields);
return Response.status(Response.Status.OK.getStatusCode()).entity(sensorRecords).build();
}
} catch (AnalyticsException e) {
String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query;
log.error(errorMsg);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build();
} catch (DeviceAccessAuthorizationException e) {
log.error(e.getErrorMessage(), e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
}
return Response.status(Response.Status.BAD_REQUEST).build();
}
@Path("/device/{device_id}")
@DELETE
public Response removeDevice(@PathParam("device_id") String deviceId) {
try {
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
deviceIdentifier.setId(deviceId);
deviceIdentifier.setType(DeviceTypeConstants.DEVICE_TYPE);
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(deviceIdentifier)) {
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
}
boolean removed = APIUtil.getDeviceManagementService().disenrollDevice(
deviceIdentifier);
if (removed) {
return Response.ok().build();
} else {
return Response.status(Response.Status.NOT_ACCEPTABLE.getStatusCode()).build();
}
} catch (DeviceManagementException e) {
log.error(e.getErrorMessage(), e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
} catch (DeviceAccessAuthorizationException e) {
log.error(e.getErrorMessage(), e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
}
}
@Path("/device/{device_id}")
@PUT
public Response updateDevice(@PathParam("device_id") String deviceId, @QueryParam("name") String name) {
try {
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
deviceIdentifier.setId(deviceId);
deviceIdentifier.setType(DeviceTypeConstants.DEVICE_TYPE);
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(deviceIdentifier)) {
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
}
Device device = APIUtil.getDeviceManagementService().getDevice(deviceIdentifier);
device.setDeviceIdentifier(deviceId);
device.getEnrolmentInfo().setDateOfLastUpdate(new Date().getTime());
device.setName(name);
device.setType(DeviceTypeConstants.DEVICE_TYPE);
boolean updated = APIUtil.getDeviceManagementService().modifyEnrollment(device);
if (updated) {
return Response.ok().build();
} else {
return Response.status(Response.Status.NOT_ACCEPTABLE.getStatusCode()).build();
}
} catch (DeviceManagementException e) {
log.error(e.getErrorMessage(), e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
} catch (DeviceAccessAuthorizationException e) {
log.error(e.getErrorMessage(), e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
}
}
@Path("/device/{device_id}")
@GET
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response getDevice(@PathParam("device_id") String deviceId) {
try {
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
deviceIdentifier.setId(deviceId);
deviceIdentifier.setType(DeviceTypeConstants.DEVICE_TYPE);
if (!APIUtil.getDeviceAccessAuthorizationService().isUserAuthorized(deviceIdentifier)) {
return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build();
}
Device device = APIUtil.getDeviceManagementService().getDevice(deviceIdentifier);
return Response.ok().entity(device).build();
} catch (DeviceManagementException e) {
log.error(e.getErrorMessage(), e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
} catch (DeviceAccessAuthorizationException e) {
log.error(e.getErrorMessage(), e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
}
}
@Path("/devices")
@GET
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response getAllDevices() {
try {
List<Device> userDevices =
APIUtil.getDeviceManagementService().getDevicesOfUser(APIUtil.getAuthenticatedUser());
ArrayList<Device> userDevicesforFirealarm = new ArrayList<>();
for (Device device : userDevices) {
if (device.getType().equals(DeviceTypeConstants.DEVICE_TYPE) &&
device.getEnrolmentInfo().getStatus().equals(EnrolmentInfo.Status.ACTIVE)) {
userDevicesforFirealarm.add(device);
}
}
Device[] devices = userDevicesforFirealarm.toArray(new Device[]{});
return Response.ok().entity(devices).build();
} catch (DeviceManagementException e) {
log.error(e.getErrorMessage(), e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build();
}
}
@Path("/device/download")
@GET
@Produces("application/zip")
public Response downloadSketch(@QueryParam("deviceName") String deviceName,
@QueryParam("sketchType") String sketchType) {
try {
ZipArchive zipFile = createDownloadFile(APIUtil.getAuthenticatedUser(), deviceName, sketchType);
Response.ResponseBuilder response = Response.ok(FileUtils.readFileToByteArray(zipFile.getZipFile()));
response.status(Response.Status.OK);
response.type("application/zip");
response.header("Content-Disposition", "attachment; filename=\"" + zipFile.getFileName() + "\"");
Response resp = response.build();
zipFile.getZipFile().delete();
return resp;
} catch (IllegalArgumentException ex) {
return Response.status(400).entity(ex.getMessage()).build();//bad request
} catch (DeviceManagementException ex) {
log.error(ex.getMessage(), ex);
return Response.status(500).entity(ex.getMessage()).build();
} catch (JWTClientException ex) {
log.error(ex.getMessage(), ex);
return Response.status(500).entity(ex.getMessage()).build();
} catch (APIManagerException ex) {
log.error(ex.getMessage(), ex);
return Response.status(500).entity(ex.getMessage()).build();
} catch (IOException ex) {
log.error(ex.getMessage(), ex);
return Response.status(500).entity(ex.getMessage()).build();
} catch (UserStoreException ex) {
log.error(ex.getMessage(), ex);
return Response.status(500).entity(ex.getMessage()).build();
}
}
private boolean register(String deviceId, String name) {
try {
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
deviceIdentifier.setId(deviceId);
deviceIdentifier.setType(DeviceTypeConstants.DEVICE_TYPE);
if (APIUtil.getDeviceManagementService().isEnrolled(deviceIdentifier)) {
return false;
}
Device device = new Device();
device.setDeviceIdentifier(deviceId);
EnrolmentInfo enrolmentInfo = new EnrolmentInfo();
enrolmentInfo.setDateOfEnrolment(new Date().getTime());
enrolmentInfo.setDateOfLastUpdate(new Date().getTime());
enrolmentInfo.setStatus(EnrolmentInfo.Status.ACTIVE);
enrolmentInfo.setOwnership(EnrolmentInfo.OwnerShip.BYOD);
device.setName(name);
device.setType(DeviceTypeConstants.DEVICE_TYPE);
enrolmentInfo.setOwner(APIUtil.getAuthenticatedUser());
device.setEnrolmentInfo(enrolmentInfo);
boolean added = APIUtil.getDeviceManagementService().enrollDevice(device);
if (added) {
APIUtil.registerApiAccessRoles(APIUtil.getAuthenticatedUser());
}
return added;
} catch (DeviceManagementException e) {
log.error(e.getMessage(), e);
return false;
}
}
private ZipArchive createDownloadFile(String owner, String deviceName, String sketchType)
throws DeviceManagementException, JWTClientException, APIManagerException,
UserStoreException {
//create new device id
String deviceId = shortUUID();
if (apiApplicationKey == null) {
String applicationUsername = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm()
.getRealmConfiguration().getAdminUserName();
applicationUsername = applicationUsername + "@" + APIUtil.getAuthenticatedUserTenantDomain();
APIManagementProviderService apiManagementProviderService = APIUtil.getAPIManagementProviderService();
String[] tags = {DeviceTypeConstants.DEVICE_TYPE};
apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys(
DeviceTypeConstants.DEVICE_TYPE, tags, KEY_TYPE, applicationUsername, true);
}
JWTClient jwtClient = APIUtil.getJWTClientManagerService().getJWTClient();
String scopes = "device_type_" + DeviceTypeConstants.DEVICE_TYPE + " device_" + deviceId;
AccessTokenInfo accessTokenInfo = jwtClient.getAccessToken(apiApplicationKey.getConsumerKey(),
apiApplicationKey.getConsumerSecret(), owner + "@" + APIUtil.getAuthenticatedUserTenantDomain(), scopes);
//create token
String accessToken = accessTokenInfo.getAccessToken();
String refreshToken = accessTokenInfo.getRefreshToken();
boolean status = register(deviceId, deviceName);
if (!status) {
String msg = "Error occurred while registering the device with " + "id: " + deviceId + " owner:" + owner;
throw new DeviceManagementException(msg);
}
ZipUtil ziputil = new ZipUtil();
ZipArchive zipFile = ziputil.createZipFile(owner, APIUtil.getTenantDomainOftheUser(), sketchType,
deviceId, deviceName, accessToken, refreshToken);
return zipFile;
}
}

@ -0,0 +1,37 @@
/*
* 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.
*/
package ${groupId}.${rootArtifactId}.api.dto;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
/**
* These information are sent by agent in each request to server
*/
@XmlRootElement
@JsonIgnoreProperties(ignoreUnknown = true)
public class DeviceJSON {
@XmlElement(required = true)
public String owner;
@XmlElement(required = true)
public String deviceId;
@XmlElement(required = true)
public Float sensorValue;
}

@ -0,0 +1,88 @@
/*
* 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.
*/
package ${groupId}.${rootArtifactId}.api.dto;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* This stores sensor event data for ${deviceType}.
*/
@XmlRootElement
@JsonIgnoreProperties(ignoreUnknown = true)
public class SensorRecord {
@XmlElementWrapper(required = true, name = "values")
private Map<String, Object> values;
/**
* The id.
*/
@XmlElement(required = false, name = "id")
private String id;
/**
* Gets the values.
* @return the values
*/
public Map<String, Object> getValues() {
return values;
}
/**
* Sets the values.
* @param values the values
*/
public void setValues(Map<String, Object> values) {
this.values = values;
}
/**
* Gets the id.
* @return the id
*/
public String getId() {
return id;
}
/**
* Sets the id.
* @param id the new id
*/
public void setId(String id) {
this.id = id;
}
@Override
public String toString() {
List<String> valueList = new ArrayList<String>();
for (Map.Entry<String, Object> entry : values.entrySet()) {
valueList.add(entry.getKey() + ":" + entry.getValue());
}
return valueList.toString();
}
}

@ -0,0 +1,57 @@
/*
* 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.
*/
package ${groupId}.${rootArtifactId}.api.exception;
public class DeviceTypeException extends Exception {
private static final long serialVersionUID = 2736466230451105441L;
private String errorMessage;
public DeviceTypeException(String msg, DeviceTypeException nestedEx) {
super(msg, nestedEx);
setErrorMessage(msg);
}
public DeviceTypeException(String message, Throwable cause) {
super(message, cause);
setErrorMessage(message);
}
public DeviceTypeException(String msg) {
super(msg);
setErrorMessage(msg);
}
public DeviceTypeException() {
super();
}
public DeviceTypeException(Throwable cause) {
super(cause);
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
}

@ -0,0 +1,221 @@
package ${groupId}.${rootArtifactId}.api.util;
import ${groupId}.${rootArtifactId}.api.dto.SensorRecord;
import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService;
import org.wso2.carbon.analytics.api.AnalyticsDataAPI;
import org.wso2.carbon.analytics.dataservice.core.AnalyticsDataServiceUtils;
import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse;
import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry;
import org.wso2.carbon.analytics.dataservice.commons.SortByField;
import org.wso2.carbon.analytics.datasource.commons.Record;
import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException;
import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.api.UserStoreManager;
import org.wso2.carbon.user.core.service.RealmService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* This class provides utility functions used by REST-API.
*/
public class APIUtil {
private static Log log = LogFactory.getLog(APIUtil.class);
public static String getAuthenticatedUser() {
PrivilegedCarbonContext threadLocalCarbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
String username = threadLocalCarbonContext.getUsername();
String tenantDomain = threadLocalCarbonContext.getTenantDomain();
if (username.endsWith(tenantDomain)) {
return username.substring(0, username.lastIndexOf("@"));
}
return username;
}
public static DeviceManagementProviderService getDeviceManagementService() {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
DeviceManagementProviderService deviceManagementProviderService =
(DeviceManagementProviderService) ctx.getOSGiService(DeviceManagementProviderService.class, null);
if (deviceManagementProviderService == null) {
String msg = "Device Management service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
return deviceManagementProviderService;
}
public static APIManagementProviderService getAPIManagementProviderService() {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
APIManagementProviderService apiManagementProviderService =
(APIManagementProviderService) ctx.getOSGiService(APIManagementProviderService.class, null);
if (apiManagementProviderService == null) {
String msg = "API management provider service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
return apiManagementProviderService;
}
public static JWTClientManagerService getJWTClientManagerService() {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
JWTClientManagerService jwtClientManagerService =
(JWTClientManagerService) ctx.getOSGiService(JWTClientManagerService.class, null);
if (jwtClientManagerService == null) {
String msg = "JWT Client manager service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
return jwtClientManagerService;
}
public static String getTenantDomainOftheUser() {
PrivilegedCarbonContext threadLocalCarbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
return threadLocalCarbonContext.getTenantDomain();
}
public static UserStoreManager getUserStoreManager() {
RealmService realmService;
UserStoreManager userStoreManager;
try {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
realmService = (RealmService) ctx.getOSGiService(RealmService.class, null);
if (realmService == null) {
String msg = "Realm service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
int tenantId = ctx.getTenantId();
userStoreManager = realmService.getTenantUserRealm(tenantId).getUserStoreManager();
} catch (UserStoreException e) {
String msg = "Error occurred while retrieving current user store manager";
log.error(msg, e);
throw new IllegalStateException(msg);
}
return userStoreManager;
}
public static void registerApiAccessRoles(String user) {
UserStoreManager userStoreManager = null;
try {
userStoreManager = getUserStoreManager();
String[] userList = new String[]{user};
if (userStoreManager != null) {
String rolesOfUser[] = userStoreManager.getRoleListOfUser(user);
if (!userStoreManager.isExistingRole(Constants.DEFAULT_ROLE_NAME)) {
userStoreManager.addRole(Constants.DEFAULT_ROLE_NAME, userList, Constants.DEFAULT_PERMISSION);
} else if (rolesOfUser != null && Arrays.asList(rolesOfUser).contains(Constants.DEFAULT_ROLE_NAME)) {
return;
} else {
userStoreManager.updateUserListOfRole(Constants.DEFAULT_ROLE_NAME, new String[0], userList);
}
}
} catch (UserStoreException e) {
log.error("Error while creating a role and adding a user for virtual_firealarm.", e);
}
}
public static DeviceAccessAuthorizationService getDeviceAccessAuthorizationService() {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
DeviceAccessAuthorizationService deviceAccessAuthorizationService =
(DeviceAccessAuthorizationService) ctx.getOSGiService(DeviceAccessAuthorizationService.class, null);
if (deviceAccessAuthorizationService == null) {
String msg = "Device Authorization service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
return deviceAccessAuthorizationService;
}
public static List<SensorRecord> getAllEventsForDevice(String tableName, String query,
List<SortByField> sortByFields) throws AnalyticsException {
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
AnalyticsDataAPI analyticsDataAPI = getAnalyticsDataAPI();
int eventCount = analyticsDataAPI.searchCount(tenantId, tableName, query);
if (eventCount == 0) {
return null;
}
List<SearchResultEntry> resultEntries = analyticsDataAPI.search(tenantId, tableName, query, 0, eventCount,
sortByFields);
List<String> recordIds = getRecordIds(resultEntries);
AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, null, recordIds);
Map<String, SensorRecord> sensorDatas = createSensorData(AnalyticsDataServiceUtils.listRecords(
analyticsDataAPI, response));
List<SensorRecord> sortedSensorData = getSortedSensorData(sensorDatas, resultEntries);
return sortedSensorData;
}
public static List<SensorRecord> getSortedSensorData(Map<String, SensorRecord> sensorDatas,
List<SearchResultEntry> searchResults) {
List<SensorRecord> sortedRecords = new ArrayList<>();
for (SearchResultEntry searchResultEntry : searchResults) {
sortedRecords.add(sensorDatas.get(searchResultEntry.getId()));
}
return sortedRecords;
}
private static List<String> getRecordIds(List<SearchResultEntry> searchResults) {
List<String> ids = new ArrayList<>();
for (SearchResultEntry searchResult : searchResults) {
ids.add(searchResult.getId());
}
return ids;
}
public static Map<String, SensorRecord> createSensorData(List<Record> records) {
Map<String, SensorRecord> sensorDatas = new HashMap<>();
for (Record record : records) {
SensorRecord sensorData = createSensorData(record);
sensorDatas.put(sensorData.getId(), sensorData);
}
return sensorDatas;
}
public static SensorRecord createSensorData(Record record) {
SensorRecord recordBean = new SensorRecord();
recordBean.setId(record.getId());
recordBean.setValues(record.getValues());
return recordBean;
}
public static AnalyticsDataAPI getAnalyticsDataAPI() {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
AnalyticsDataAPI analyticsDataAPI =
(AnalyticsDataAPI) ctx.getOSGiService(AnalyticsDataAPI.class, null);
if (analyticsDataAPI == null) {
String msg = "Analytics api service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
return analyticsDataAPI;
}
public static String getAuthenticatedUserTenantDomain() {
PrivilegedCarbonContext threadLocalCarbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
return threadLocalCarbonContext.getTenantDomain();
}
public static OutputEventAdapterService getOutputEventAdapterService() {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
OutputEventAdapterService outputEventAdapterService =
(OutputEventAdapterService) ctx.getOSGiService(OutputEventAdapterService.class, null);
if (outputEventAdapterService == null) {
String msg = "Device Authorization service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
return outputEventAdapterService;
}
}

@ -0,0 +1,32 @@
/*
* 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.
*/
package ${groupId}.${rootArtifactId}.api.util;
import org.wso2.carbon.user.core.Permission;
/**
* This hold the constants related to the device type.
*/
public class Constants {
public static final String DEFAULT_PERMISSION_RESOURCE = "/permission/admin/device-mgt/${deviceType}/user";
public static final String DEFAULT_ROLE_NAME = "${deviceType}_user";
public static final Permission DEFAULT_PERMISSION[]
= new Permission[]{new Permission(Constants.DEFAULT_PERMISSION_RESOURCE, "ui.execute")};
}

@ -0,0 +1,108 @@
/*
* 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.
*/
package ${groupId}.${rootArtifactId}.api.util;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class ResponsePayload {
private int statusCode;
private String messageFromServer;
private Object responseContent;
public static ResponsePayloadBuilder statusCode(int statusCode) {
ResponsePayload message = new ResponsePayload();
return message.getBuilder().statusCode(statusCode);
}
public static ResponsePayloadBuilder messageFromServer(
String messageFromServer) {
ResponsePayload message = new ResponsePayload();
return message.getBuilder().messageFromServer(messageFromServer);
}
public static ResponsePayloadBuilder responseContent(String responseContent) {
ResponsePayload message = new ResponsePayload();
return message.getBuilder().responseContent(responseContent);
}
@XmlElement
public int getStatusCode() {
return statusCode;
}
public void setStatusCode(int statusCode) {
this.statusCode = statusCode;
}
@XmlElement
public String getMessageFromServer() {
return messageFromServer;
}
public void setMessageFromServer(String messageFromServer) {
this.messageFromServer = messageFromServer;
}
@XmlElement
public Object getResponseContent() {
return responseContent;
}
public void setResponseContent(Object responseContent) {
this.responseContent = responseContent;
}
private ResponsePayloadBuilder getBuilder() {
return new ResponsePayloadBuilder();
}
public class ResponsePayloadBuilder {
private int statusCode;
private String messageFromServer;
private Object responseContent;
public ResponsePayloadBuilder statusCode(int statusCode) {
this.statusCode = statusCode;
return this;
}
public ResponsePayloadBuilder messageFromServer(String messageFromServer) {
this.messageFromServer = messageFromServer;
return this;
}
public ResponsePayloadBuilder responseContent(String responseContent) {
this.responseContent = responseContent;
return this;
}
public ResponsePayload build() {
ResponsePayload payload = new ResponsePayload();
payload.setStatusCode(statusCode);
payload.setMessageFromServer(messageFromServer);
payload.setResponseContent(responseContent);
return payload;
}
}
}

@ -0,0 +1,56 @@
/*
* 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.
*/
package ${groupId}.${rootArtifactId}.api.util;
import ${groupId}.${rootArtifactId}.plugin.constants.DeviceTypeConstants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException;
import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService;
import org.wso2.carbon.context.PrivilegedCarbonContext;
public class ServiceUtils {
private static final Log log = LogFactory.getLog(ServiceUtils.class);
/**
* Sensor data are published to DAS
*
* @param deviceId unique identifier of the device
* @param sensorValue current value of sensor which is set at agent side
* @return
*/
public static boolean publishToDAS(String deviceId, float sensorValue) {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
EventsPublisherService deviceAnalyticsService = (EventsPublisherService) ctx.getOSGiService(
EventsPublisherService.class, null);
String owner = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
Object metdaData[] = {owner, DeviceTypeConstants.DEVICE_TYPE, deviceId, System.currentTimeMillis()};
Object payloadData[] = {sensorValue};
try {
deviceAnalyticsService.publishEvent(DeviceTypeConstants.SENSOR_STREAM_DEFINITION,
DeviceTypeConstants.SENSOR_STREAM_DEFINITION_VERSION, metdaData, new Object[0], payloadData);
} catch (DataPublisherConfigurationException e) {
return false;
}
return true;
}
}

@ -0,0 +1,86 @@
/*
* 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.
*/
package ${groupId}.${rootArtifactId}.api.util;
import ${groupId}.${rootArtifactId}.plugin.mqtt.MqttConfig;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.iot.util.Utils;
import org.wso2.carbon.device.mgt.iot.util.ZipArchive;
import org.wso2.carbon.utils.CarbonUtils;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
* This is used to create a zip file that includes the necessary configuration required for the agent.
*/
public class ZipUtil {
private static final String HTTPS_PORT_PROPERTY = "httpsPort";
private static final String HTTP_PORT_PROPERTY = "httpPort";
private static final String LOCALHOST = "localhost";
private static final String HTTPS_PROTOCOL_APPENDER = "https://";
private static final String HTTP_PROTOCOL_APPENDER = "http://";
public ZipArchive createZipFile(String owner, String tenantDomain, String deviceType,
String deviceId, String deviceName, String token,
String refreshToken) throws DeviceManagementException {
String sketchFolder = "repository" + File.separator + "resources" + File.separator + "sketches";
String archivesPath = CarbonUtils.getCarbonHome() + File.separator + sketchFolder + File.separator + "archives" +
File.separator + deviceId;
String templateSketchPath = sketchFolder + File.separator + deviceType;
String iotServerIP;
try {
iotServerIP = Utils.getServerUrl();
String httpsServerPort = System.getProperty(HTTPS_PORT_PROPERTY);
String httpServerPort = System.getProperty(HTTP_PORT_PROPERTY);
String httpsServerEP = HTTPS_PROTOCOL_APPENDER + iotServerIP + ":" + httpsServerPort;
String httpServerEP = HTTP_PROTOCOL_APPENDER + iotServerIP + ":" + httpServerPort;
String apimEndpoint = httpsServerEP;
String mqttEndpoint = MqttConfig.getInstance().getBrokerEndpoint();
if (mqttEndpoint.contains(LOCALHOST)) {
mqttEndpoint = mqttEndpoint.replace(LOCALHOST, iotServerIP);
}
Map<String, String> contextParams = new HashMap<>();
contextParams.put("SERVER_NAME", APIUtil.getTenantDomainOftheUser());
contextParams.put("DEVICE_OWNER", owner);
contextParams.put("DEVICE_ID", deviceId);
contextParams.put("DEVICE_NAME", deviceName);
contextParams.put("HTTPS_EP", httpsServerEP);
contextParams.put("HTTP_EP", httpServerEP);
contextParams.put("APIM_EP", apimEndpoint);
contextParams.put("MQTT_EP", mqttEndpoint);
contextParams.put("DEVICE_TOKEN", token);
contextParams.put("DEVICE_REFRESH_TOKEN", refreshToken);
ZipArchive zipFile;
zipFile = Utils.getSketchArchive(archivesPath, templateSketchPath, contextParams, deviceName);
return zipFile;
} catch (IOException e) {
throw new DeviceManagementException("Zip File Creation Failed", e);
}
}
}

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<!-- This file contains the list of permissions that are associated with URL end points
of the web app. Each permission should contain the name, permission path ,API path
(URL) , HTTP method and OAUTH2 authorization scope (not-required).
When defining dynamic paths for APIs, path variables are denoted by '*' notation.
NOTE: All the endpoints of the web app should be available in this file. Otherwise
it will result 403 error at the runtime.
-->
<PermissionConfiguration>
<APIVersion></APIVersion>
<!-- Device related APIs -->
<Permission>
<name>Get device</name>
<path>/device-mgt/${deviceType}/user</path>
<url>/device/*</url>
<method>GET</method>
<scope>${deviceType}_user</scope>
</Permission>
<Permission>
<name>Remove device</name>
<path>/device-mgt/${deviceType}/user</path>
<url>/device/*</url>
<method>DELETE</method>
<scope>${deviceType}_user</scope>
</Permission>
<Permission>
<name>Download device</name>
<path>/device-mgt/${deviceType}/user</path>
<url>/device/download</url>
<method>GET</method>
<scope>${deviceType}_user</scope>
</Permission>
<Permission>
<name>Update device</name>
<path>/device-mgt/${deviceType}/user</path>
<url>/device/*</url>
<method>POST</method>
<scope>${deviceType}_user</scope>
</Permission>
<Permission>
<name>Get Devices</name>
<path>/device-mgt/${deviceType}/user</path>
<url>/device</url>
<method>GET</method>
<scope>${deviceType}_user</scope>
</Permission>
<Permission>
<name>Register Device</name>
<path>/device-mgt/${deviceType}/user</path>
<url>/device/register</url>
<method>POST</method>
<scope>${deviceType}_device</scope>
</Permission>
<Permission>
<name>Control Sensor</name>
<path>/device-mgt/${deviceType}/user</path>
<url>/device/*/change-status</url>
<method>POST</method>
<scope>${deviceType}_user</scope>
</Permission>
<Permission>
<name>Get Stats</name>
<path>/device-mgt/${deviceType}/user</path>
<url>/device/stats/*</url>
<method>GET</method>
<scope>${deviceType}_device</scope>
</Permission>
</PermissionConfiguration>

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright 2005-2013 WSO2, Inc. (http://wso2.com)
~
~ 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.
-->
<!--
This file defines class loading policy of the whole container. But this behaviour can be overridden by individual webapps by putting this file into the META-INF/ directory.
-->
<Classloading xmlns="http://wso2.org/projects/as/classloading">
<!-- Parent-first or child-first. Default behaviour is child-first.-->
<ParentFirst>false</ParentFirst>
<!--
Default environments that contains provides to all the webapps. This can be overridden by individual webapps by specifing required environments
Tomcat environment is the default and every webapps gets it even if they didn't specify it.
e.g. If a webapps requires CXF, they will get both Tomcat and CXF.
-->
<Environments>CXF,Carbon</Environments>
</Classloading>

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
<jaxrs:server id="${deviceType}" address="/">
<jaxrs:serviceBeans>
<bean id="DeviceTypeService"
class="${groupId}.${rootArtifactId}.api.DeviceTypeServiceImpl">
</bean>
</jaxrs:serviceBeans>
<jaxrs:providers>
<bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
</jaxrs:providers>
</jaxrs:server>
</beans>

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
metadata-complete="true">
<display-name>WSO2 IoT Server</display-name>
<description>WSO2 IoT Server</description>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>isAdminService</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>doAuthentication</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>isSharedWithAllTenants</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>providerTenantDomain</param-name>
<param-value>carbon.super</param-value>
</context-param>
<!--publish to apim-->
<context-param>
<param-name>managed-api-enabled</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>managed-api-owner</param-name>
<param-value>admin</param-value>
</context-param>
</web-app>

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>${groupId}</groupId>
<artifactId>${rootArtifactId}-component</artifactId>
<version>${version}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>${version}</version>
<artifactId>${project-base-package}.plugin</artifactId>
<packaging>bundle</packaging>
<name>${project-base-package}.plugin</name>
<url>http://wso2.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${org.apache.felix.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project-base-package}.plugin</Bundle-SymbolicName>
<Bundle-Name>${project-base-package}.plugin</Bundle-Name>
<Bundle-Version>${version}</Bundle-Version>
<Bundle-Description>IoT Server Impl Bundle</Bundle-Description>
<Private-Package>${project-base-package}.plugin.internal</Private-Package>
<Import-Package>
org.osgi.framework,
org.osgi.service.component,
org.apache.commons.logging,
javax.naming;resolution:=optional,
javax.sql;resolution:=optional,
org.wso2.carbon.device.mgt.common.*,
org.wso2.carbon.device.mgt.common,
org.wso2.carbon.device.mgt.iot.*,
org.wso2.carbon.device.mgt.extensions.feature.mgt.*,
org.wso2.carbon.utils.*,
org.wso2.carbon.event.output.adapter.core,
org.wso2.carbon.event.output.adapter.core.exception,
org.wso2.carbon.base,
org.wso2.carbon.core.util,
org.wso2.carbon.context,
org.wso2.carbon.core,
org.apache.commons.codec.binary
</Import-Package>
<Export-Package>
!${project-base-package}.plugin.internal,
${project-base-package}.plugin.*
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>commons-codec.wso2</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.ndatasource.core</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.extensions</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.utils</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.analytics-common</groupId>
<artifactId>org.wso2.carbon.event.output.adapter.core</artifactId>
</dependency>
</dependencies>
</project>

@ -0,0 +1,66 @@
/*
* 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.
*/
package ${groupId}.${rootArtifactId}.plugin.constants;
import org.wso2.carbon.utils.CarbonUtils;
import java.io.File;
public class DeviceTypeConstants {
public final static String DEVICE_TYPE = "${deviceType}";
public final static String DEVICE_PLUGIN_DEVICE_NAME = "DEVICE_NAME";
public final static String DEVICE_PLUGIN_DEVICE_ID = "${deviceType}_DEVICE_ID";
public final static String STATE_ON = "ON";
public final static String STATE_OFF = "OFF";
//sensor events summerized table name
public static final String SENSOR_EVENT_TABLE = "ORG_WSO2_IOT_DEVICES_${nameOfTheSensor}";
public static final String DATA_SOURCE_NAME = "jdbc/${deviceType}DM_DB";
public final static String DEVICE_TYPE_PROVIDER_DOMAIN = "carbon.super";
//mqtt tranport related constants
public static final String MQTT_ADAPTER_NAME = "${nameOfTheSensor}_mqtt";
public static final String MQTT_ADAPTER_TYPE = "oauth-mqtt";
public static final String ADAPTER_TOPIC_PROPERTY = "topic";
public static final String MQTT_PORT = "\\$\\{mqtt.broker.port\\}";
public static final String MQTT_BROKER_HOST = "\\$\\{mqtt.broker.host\\}";
public static final String CARBON_CONFIG_PORT_OFFSET = "Ports.Offset";
public static final String DEFAULT_CARBON_LOCAL_IP_PROPERTY = "carbon.local.ip";
public static final int CARBON_DEFAULT_PORT_OFFSET = 0;
public static final int DEFAULT_MQTT_PORT = 1883;
public static final String SUBSCRIBED_TOPIC = "carbon.super/${deviceType}/+/publisher";
public static final String CONTENT_TRANSFORMATION = "contentTransformer";
public static final String CONTENT_VALIDATION = "contentValidator";
public static final String RESOURCE = "resource";
public static final String USERNAME_PROPERTY_KEY = "username";
public static final String DCR_PROPERTY_KEY = "dcrUrl";
public static final String BROKER_URL_PROPERTY_KEY = "url";
public static final String SCOPES_PROPERTY_KEY = "scopes";
public static final String QOS_PROPERTY_KEY = "qos";
public static final String CLIENT_ID_PROPERTY_KEY = "qos";
public static final String CLEAR_SESSION_PROPERTY_KEY = "clearSession";
public static final String TOPIC = "topic";
public final static String SENSOR_STREAM_DEFINITION = "org.wso2.iot.devices.${nameOfTheSensor}";
public final static String SENSOR_STREAM_DEFINITION_VERSION = "1.0.0";
public static final String MQTT_CONFIG_LOCATION = CarbonUtils.getEtcCarbonConfigDirPath() + File.separator
+ "mqtt.properties";
}

@ -0,0 +1,56 @@
/*
* 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.
*/
package ${groupId}.${rootArtifactId}.plugin.exception;
public class DeviceMgtPluginException extends Exception {
private String errorMessage;
public DeviceMgtPluginException(String msg, Exception nestedEx) {
super(msg, nestedEx);
setErrorMessage(msg);
}
public DeviceMgtPluginException(String message, Throwable cause) {
super(message, cause);
setErrorMessage(message);
}
public DeviceMgtPluginException(String msg) {
super(msg);
setErrorMessage(msg);
}
public DeviceMgtPluginException() {
super();
}
public DeviceMgtPluginException(Throwable cause) {
super(cause);
}
public String getErrorMessage() {
return errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
}

@ -0,0 +1,259 @@
/*
* 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.
*/
package ${groupId}.${rootArtifactId}.plugin.impl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import ${groupId}.${rootArtifactId}.plugin.impl.dao.DeviceTypeDAO;
import ${groupId}.${rootArtifactId}.plugin.exception.DeviceMgtPluginException;
import ${groupId}.${rootArtifactId}.plugin.impl.feature.DeviceTypeFeatureManager;
import org.wso2.carbon.device.mgt.common.*;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.DeviceManager;
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
import org.wso2.carbon.device.mgt.common.FeatureManager;
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
import org.wso2.carbon.device.mgt.common.license.mgt.License;
import org.wso2.carbon.device.mgt.common.license.mgt.LicenseManagementException;
import java.util.ArrayList;
import java.util.List;
/**
* This represents the ${rootArtifactId} implementation of DeviceManagerService.
*/
public class DeviceTypeManager implements DeviceManager {
private static final Log log = LogFactory.getLog(DeviceTypeManager.class);
private static final DeviceTypeDAO deviceTypeDAO = new DeviceTypeDAO();
private FeatureManager featureManager = new DeviceTypeFeatureManager();
@Override
public FeatureManager getFeatureManager() {
return featureManager;
}
@Override
public boolean saveConfiguration(TenantConfiguration tenantConfiguration)
throws DeviceManagementException {
//TODO implement this
return false;
}
@Override
public TenantConfiguration getConfiguration() throws DeviceManagementException {
//TODO implement this
return null;
}
@Override
public boolean enrollDevice(Device device) throws DeviceManagementException {
boolean status;
try {
if (log.isDebugEnabled()) {
log.debug("Enrolling a new ${rootArtifactId} device : " + device.getDeviceIdentifier());
}
DeviceTypeDAO.beginTransaction();
status = deviceTypeDAO.getDeviceTypeDAO().addDevice(device);
DeviceTypeDAO.commitTransaction();
} catch (DeviceMgtPluginException e) {
try {
DeviceTypeDAO.rollbackTransaction();
} catch (DeviceMgtPluginException iotDAOEx) {
log.warn("Error occurred while roll back the device enrol transaction :" + device.toString(), iotDAOEx);
}
String msg = "Error while enrolling the ${rootArtifactId} device : " + device.getDeviceIdentifier();
log.error(msg, e);
throw new DeviceManagementException(msg, e);
}
return status;
}
@Override
public boolean modifyEnrollment(Device device) throws DeviceManagementException {
boolean status;
try {
if (log.isDebugEnabled()) {
log.debug("Modifying the ${rootArtifactId} device enrollment data");
}
DeviceTypeDAO.beginTransaction();
status = deviceTypeDAO.getDeviceTypeDAO().updateDevice(device);
DeviceTypeDAO.commitTransaction();
} catch (DeviceMgtPluginException e) {
try {
DeviceTypeDAO.rollbackTransaction();
} catch (DeviceMgtPluginException iotDAOEx) {
String msg = "Error occurred while roll back the update device transaction :" + device.toString();
log.warn(msg, iotDAOEx);
}
String msg = "Error while updating the enrollment of the ${rootArtifactId} device : " +
device.getDeviceIdentifier();
log.error(msg, e);
throw new DeviceManagementException(msg, e);
}
return status;
}
@Override
public boolean disenrollDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
boolean status;
try {
if (log.isDebugEnabled()) {
log.debug("Dis-enrolling ${rootArtifactId} device : " + deviceId);
}
DeviceTypeDAO.beginTransaction();
status = deviceTypeDAO.getDeviceTypeDAO().deleteDevice(deviceId.getId());
DeviceTypeDAO.commitTransaction();
} catch (DeviceMgtPluginException e) {
try {
DeviceTypeDAO.rollbackTransaction();
} catch (DeviceMgtPluginException iotDAOEx) {
String msg = "Error occurred while roll back the device dis enrol transaction :" + deviceId.toString();
log.warn(msg, iotDAOEx);
}
String msg = "Error while removing the ${rootArtifactId} device : " + deviceId.getId();
log.error(msg, e);
throw new DeviceManagementException(msg, e);
}
return status;
}
@Override
public boolean isEnrolled(DeviceIdentifier deviceId) throws DeviceManagementException {
boolean isEnrolled = false;
try {
if (log.isDebugEnabled()) {
log.debug("Checking the enrollment of ${rootArtifactId} device : " + deviceId.getId());
}
Device iotDevice =
deviceTypeDAO.getDeviceTypeDAO().getDevice(deviceId.getId());
if (iotDevice != null) {
isEnrolled = true;
}
} catch (DeviceMgtPluginException e) {
String msg = "Error while checking the enrollment status of ${rootArtifactId} device : " +
deviceId.getId();
log.error(msg, e);
throw new DeviceManagementException(msg, e);
}
return isEnrolled;
}
@Override
public boolean isActive(DeviceIdentifier deviceId) throws DeviceManagementException {
return true;
}
@Override
public boolean setActive(DeviceIdentifier deviceId, boolean status)
throws DeviceManagementException {
return true;
}
@Override
public Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException {
Device device;
try {
if (log.isDebugEnabled()) {
log.debug("Getting the details of ${rootArtifactId} device : " + deviceId.getId());
}
device = deviceTypeDAO.getDeviceTypeDAO().getDevice(deviceId.getId());
} catch (DeviceMgtPluginException e) {
String msg = "Error while fetching the ${rootArtifactId} device : " + deviceId.getId();
log.error(msg, e);
throw new DeviceManagementException(msg, e);
}
return device;
}
@Override
public boolean setOwnership(DeviceIdentifier deviceId, String ownershipType)
throws DeviceManagementException {
return true;
}
public boolean isClaimable(DeviceIdentifier deviceIdentifier) throws DeviceManagementException {
return false;
}
@Override
public boolean setStatus(DeviceIdentifier deviceId, String currentOwner,
EnrolmentInfo.Status status) throws DeviceManagementException {
return false;
}
@Override
public License getLicense(String s) throws LicenseManagementException {
return null;
}
@Override
public void addLicense(License license) throws LicenseManagementException {
}
@Override
public boolean requireDeviceAuthorization() {
return true;
}
@Override
public boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device) throws DeviceManagementException {
boolean status;
try {
if (log.isDebugEnabled()) {
log.debug("updating the details of ${rootArtifactId} device : " + deviceIdentifier);
}
DeviceTypeDAO.beginTransaction();
status = deviceTypeDAO.getDeviceTypeDAO().updateDevice(device);
DeviceTypeDAO.commitTransaction();
} catch (DeviceMgtPluginException e) {
try {
DeviceTypeDAO.rollbackTransaction();
} catch (DeviceMgtPluginException iotDAOEx) {
String msg = "Error occurred while roll back the update device info transaction :" + device.toString();
log.warn(msg, iotDAOEx);
}
String msg =
"Error while updating the ${rootArtifactId} device : " + deviceIdentifier;
log.error(msg, e);
throw new DeviceManagementException(msg, e);
}
return status;
}
@Override
public List<Device> getAllDevices() throws DeviceManagementException {
List<Device> devices;
try {
if (log.isDebugEnabled()) {
log.debug("Fetching the details of all ${rootArtifactId} devices");
}
devices = deviceTypeDAO.getDeviceTypeDAO().getAllDevices();
} catch (DeviceMgtPluginException e) {
String msg = "Error while fetching all ${rootArtifactId} devices.";
log.error(msg, e);
throw new DeviceManagementException(msg, e);
}
return devices;
}
}

@ -0,0 +1,68 @@
/*
* 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.
*/
package ${groupId}.${rootArtifactId}.plugin.impl;
import ${groupId}.${rootArtifactId}.plugin.constants.DeviceTypeConstants;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.ProvisioningConfig;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.DeviceManager;
import org.wso2.carbon.device.mgt.common.app.mgt.Application;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManager;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig;
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
import java.util.List;
public class DeviceTypeManagerService implements DeviceManagementService {
private DeviceManager deviceManager;
@Override
public String getType() {
return DeviceTypeConstants.DEVICE_TYPE;
}
@Override
public void init() throws DeviceManagementException {
this.deviceManager = new DeviceTypeManager();
}
@Override
public DeviceManager getDeviceManager() {
return deviceManager;
}
@Override
public ApplicationManager getApplicationManager() {
return null;
}
@Override
public ProvisioningConfig getProvisioningConfig() {
return new ProvisioningConfig(DeviceTypeConstants.DEVICE_TYPE_PROVIDER_DOMAIN, false);
}
@Override
public PushNotificationConfig getPushNotificationConfig() {
return null;
}
}

@ -0,0 +1,129 @@
/*
* 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.
*/
package ${groupId}.${rootArtifactId}.plugin.impl.dao;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import ${groupId}.${rootArtifactId}.plugin.constants.DeviceTypeConstants;
import ${groupId}.${rootArtifactId}.plugin.impl.dao.impl.DeviceTypeDAOImpl;
import ${groupId}.${rootArtifactId}.plugin.exception.DeviceMgtPluginException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
public class DeviceTypeDAO {
private static final Log log = LogFactory.getLog(DeviceTypeDAO.class);
static DataSource dataSource; // package local variable
private static ThreadLocal<Connection> currentConnection = new ThreadLocal<>();
public DeviceTypeDAO() {
initDeviceTypeDAO();
}
public static void initDeviceTypeDAO() {
try {
Context ctx = new InitialContext();
dataSource = (DataSource) ctx.lookup(DeviceTypeConstants.DATA_SOURCE_NAME);
} catch (NamingException e) {
log.error("Error while looking up the data source: " +
DeviceTypeConstants.DATA_SOURCE_NAME);
}
}
public static void beginTransaction() throws DeviceMgtPluginException {
try {
Connection conn = dataSource.getConnection();
conn.setAutoCommit(false);
currentConnection.set(conn);
} catch (SQLException e) {
throw new DeviceMgtPluginException("Error occurred while retrieving datasource connection", e);
}
}
public static Connection getConnection() throws DeviceMgtPluginException {
if (currentConnection.get() == null) {
try {
currentConnection.set(dataSource.getConnection());
} catch (SQLException e) {
throw new DeviceMgtPluginException("Error occurred while retrieving data source connection",
e);
}
}
return currentConnection.get();
}
public static void commitTransaction() throws DeviceMgtPluginException {
try {
Connection conn = currentConnection.get();
if (conn != null) {
conn.commit();
} else {
if (log.isDebugEnabled()) {
log.debug("Datasource connection associated with the current thread is null, hence commit " +
"has not been attempted");
}
}
} catch (SQLException e) {
throw new DeviceMgtPluginException("Error occurred while committing the transaction", e);
} finally {
closeConnection();
}
}
public static void closeConnection() throws DeviceMgtPluginException {
Connection con = currentConnection.get();
if (con != null) {
try {
con.close();
} catch (SQLException e) {
log.error("Error occurred while close the connection");
}
}
currentConnection.remove();
}
public static void rollbackTransaction() throws DeviceMgtPluginException {
try {
Connection conn = currentConnection.get();
if (conn != null) {
conn.rollback();
} else {
if (log.isDebugEnabled()) {
log.debug("Datasource connection associated with the current thread is null, hence rollback " +
"has not been attempted");
}
}
} catch (SQLException e) {
throw new DeviceMgtPluginException("Error occurred while rollback the transaction", e);
} finally {
closeConnection();
}
}
public DeviceTypeDAOImpl getDeviceTypeDAO() {
return new DeviceTypeDAOImpl();
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save