few changes in sample device types to load cdmc specific units

merge-requests/1/head
ayyoob 8 years ago
parent 75c34eabfa
commit ecdbf6d272

@ -31,7 +31,7 @@
Operations Operations
</div> </div>
<div class="add-margin-top-4x"> <div class="add-margin-top-4x">
{{unit "iot.unit.device.operation-bar" device=device backendApiUri=backendApiUri autoCompleteParams=autoCompleteParams}} {{unit "cdmf.unit.device.operation-bar" device=device backendApiUri=backendApiUri autoCompleteParams=autoCompleteParams}}
</div> </div>
{{/zone}} {{/zone}}

@ -30,7 +30,7 @@ function onRequest(context) {
if (device && device.status != "error") { if (device && device.status != "error") {
return { return {
"device": device.content, "device": device.content,
"backendApiUri": devicemgtProps["httpsURL"] + "/android_sense/", "backendApiUri": "/android_sense/",
"autoCompleteParams": autoCompleteParams "autoCompleteParams": autoCompleteParams
}; };
} else { } else {

@ -32,7 +32,7 @@
Operations Operations
</div> </div>
<div class="add-margin-top-4x"> <div class="add-margin-top-4x">
{{unit "iot.unit.device.operation-bar" device=device backendApiUri=backendApiUri autoCompleteParams=autoCompleteParams}} {{unit "cdmf.unit.device.operation-bar" device=device backendApiUri=backendApiUri autoCompleteParams=autoCompleteParams}}
</div> </div>
{{/zone}} {{/zone}}

@ -28,7 +28,7 @@ function onRequest(context) {
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"]; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return {"device": device.content, "backendApiUri" : devicemgtProps["httpsURL"] + "/arduino/", "autoCompleteParams" : autoCompleteParams}; return {"device": device.content, "backendApiUri" : "/arduino/", "autoCompleteParams" : autoCompleteParams};
} else { } else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
exit(); exit();

@ -32,7 +32,7 @@
Operations Operations
</div> </div>
<div class="add-margin-top-4x"> <div class="add-margin-top-4x">
{{unit "iot.unit.device.operation-bar" device=device backendApiUri=backendApiUri autoCompleteParams=autoCompleteParams}} {{unit "cdmf.unit.device.operation-bar" device=device backendApiUri=backendApiUri autoCompleteParams=autoCompleteParams}}
</div> </div>
{{/zone}} {{/zone}}

@ -28,7 +28,7 @@ function onRequest(context) {
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"]; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return {"device": device.content, "backendApiUri" : devicemgtProps["httpsURL"] + "/raspberrypi/", "autoCompleteParams" : autoCompleteParams}; return {"device": device.content, "backendApiUri" : "/raspberrypi/", "autoCompleteParams" : autoCompleteParams};
} else { } else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
exit(); exit();

@ -32,7 +32,7 @@
Operations Operations
</div> </div>
<div class="add-margin-top-4x"> <div class="add-margin-top-4x">
{{unit "iot.unit.device.operation-bar" device=device backendApiUri=backendApiUri autoCompleteParams=autoCompleteParams}} {{unit "cdmf.unit.device.operation-bar" device=device backendApiUri=backendApiUri autoCompleteParams=autoCompleteParams}}
</div> </div>
{{/zone}} {{/zone}}

@ -28,7 +28,7 @@ function onRequest(context) {
var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"]; var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
var device = deviceModule.viewDevice(deviceType, deviceId); var device = deviceModule.viewDevice(deviceType, deviceId);
if (device && device.status != "error") { if (device && device.status != "error") {
return {"device": device.content, "backendApiUri" : devicemgtProps["httpsURL"] + "/virtual_firealarm/", "autoCompleteParams" : autoCompleteParams}; return {"device": device.content, "backendApiUri" : "/virtual_firealarm/", "autoCompleteParams" : autoCompleteParams};
} else { } else {
response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!"); response.sendError(404, "Device Id " + deviceId + " of type " + deviceType + " cannot be found!");
exit(); exit();

@ -15,4 +15,4 @@
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
}} }}
{{unit "iot.unit.policy.edit"}} {{unit "cdmf.unit.policy.edit"}}

@ -15,4 +15,4 @@
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
}} }}
{{unit "iot.unit.policy.view"}} {{unit "cdmf.unit.policy.view"}}

@ -15,4 +15,4 @@
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
}} }}
{{unit "iot.unit.policy.wizard"}} {{unit "cdmf.unit.policy.wizard"}}

@ -17,37 +17,59 @@
~ specific language governing permissions and limitations ~ specific language governing permissions and limitations
~ under the License. ~ under the License.
--> -->
<DeviceManagementConfiguration> <DeviceTypeConfiguration name="android_sense">
<DeviceType>android_sense</DeviceType> <Features>
<Feature code="keywords">
<Name>Add Keywords</Name>
<Description>Send keywords to the device</Description>
<Operation context="device/{deviceId}/words" method="POST">
<QueryParameters>
<Parameter>keywords</Parameter>
</QueryParameters>
</Operation>
</Feature>
<Feature code="threshold">
<Name>Add Threshold</Name>
<Description>Send Threshold to the device</Description>
<Operation context="device/{deviceId}/words/threshold" method="POST">
<QueryParameters>
<Parameter>threshold</Parameter>
</QueryParameters>
</Operation>
</Feature>
<Feature code="remove_words">
<Name>Remove words</Name>
<Description>Remove Threshold from the device</Description>
<Operation context="device/{deviceId}/words" method="DELETE">
<QueryParameters>
<Parameter>words</Parameter>
</QueryParameters>
</Operation>
</Feature>
</Features>
<ManagementRepository> <ProvisioningConfig>
<DeviceDefinition> <SharedWithAllTenants>false</SharedWithAllTenants>
<License> </ProvisioningConfig>
<Language>en_US</Language>
<Version>1.0.0</Version>
<Text>This is license text</Text>
</License>
<!--if generate is set to true then the feature information will be picked up from the annotation in the api-->
<Features generate="true"/>
</DeviceDefinition>
<ProvisioningConfig> <PushNotificationProvider type="MQTT">
<SharedWithAllTenants>false</SharedWithAllTenants> <FileBasedProperties>true</FileBasedProperties>
</ProvisioningConfig> <!--if file based properties is set to false then the configuration will be picked from platform configuration-->
</ManagementRepository> <ConfigProperties>
<Property Name="mqtt.adapter.name">androidsense.mqtt.adapter</Property>
<PushNotificationConfiguration>
<!--MQTT Config-->
<PushNotificationProvider>MQTT</PushNotificationProvider>
<Properties>
<Property Name="mqtt.adapter.name">android_sense.mqtt.adapter</Property>
<Property Name="url">tcp://localhost:1883</Property> <Property Name="url">tcp://localhost:1883</Property>
<Property Name="username">admin</Property> <Property Name="username">admin</Property>
<Property Name="dcrUrl">https://localhost:9443/dynamic-client-web/register</Property> <Property Name="dcrUrl">https://localhost:9443/dynamic-client-web/register</Property>
<Property Name="qos">0</Property> <Property Name="qos">0</Property>
<Property Name="scopes"/> <Property Name="scopes"/>
<Property Name="clearSession">true</Property> <Property Name="clearSession">true</Property>
</Properties> </ConfigProperties>
</PushNotificationConfiguration> </PushNotificationProvider>
</DeviceManagementConfiguration>
<License>
<Language>en_US</Language>
<Version>1.0.0</Version>
<Text>This is license text</Text>
</License>
</DeviceTypeConfiguration>

@ -17,22 +17,27 @@
~ specific language governing permissions and limitations ~ specific language governing permissions and limitations
~ under the License. ~ under the License.
--> -->
<DeviceManagementConfiguration> <DeviceTypeConfiguration name="arduino">
<DeviceType>arduino</DeviceType> <Features>
<Feature code="bulb">
<Name>Control Bulb</Name>
<Description>Control Bulb on Arduino Uno</Description>
<Operation context="device/{deviceId}/bulb" method="POST">
<QueryParameters>
<Parameter>state</Parameter>
</QueryParameters>
</Operation>
</Feature>
</Features>
<ManagementRepository> <ProvisioningConfig>
<DeviceDefinition> <SharedWithAllTenants>false</SharedWithAllTenants>
<License> </ProvisioningConfig>
<Language>en_US</Language>
<Version>1.0.0</Version>
<Text>This is license text</Text>
</License>
<!--if generate is set to true then the feature information will be picked up from the annotation in the api-->
<Features generate="true"/>
</DeviceDefinition>
<ProvisioningConfig> <License>
<SharedWithAllTenants>false</SharedWithAllTenants> <Language>en_US</Language>
</ProvisioningConfig> <Version>1.0.0</Version>
</ManagementRepository> <Text>This is license text</Text>
</DeviceManagementConfiguration> </License>
</DeviceTypeConfiguration>

@ -17,30 +17,27 @@
~ specific language governing permissions and limitations ~ specific language governing permissions and limitations
~ under the License. ~ under the License.
--> -->
<DeviceManagementConfiguration> <DeviceTypeConfiguration name="raspberrypi">
<DeviceType>raspberrypi</DeviceType> <Features>
<Feature code="bulb">
<Name>Control Bulb</Name>
<Description>Control Bulb on Raspberrypi</Description>
<Operation context="device/{deviceId}/bulb" method="POST">
<QueryParameters>
<Parameter>state</Parameter>
</QueryParameters>
</Operation>
</Feature>
</Features>
<ManagementRepository> <ProvisioningConfig>
<DeviceDefinition> <SharedWithAllTenants>false</SharedWithAllTenants>
<License> </ProvisioningConfig>
<Language>en_US</Language>
<Version>1.0.0</Version>
<Text>This is license text</Text>
</License>
<!--if generate is set to true then the feature information will be picked up from the annotation in the api-->
<Features generate="true"/>
</DeviceDefinition>
<ProvisioningConfig> <PushNotificationProvider type="MQTT">
<SharedWithAllTenants>false</SharedWithAllTenants> <FileBasedProperties>true</FileBasedProperties>
</ProvisioningConfig> <!--if file based properties is set to false then the configuration will be picked from platform configuration-->
</ManagementRepository> <ConfigProperties>
<PushNotificationConfiguration>
<!--MQTT Config-->
<PushNotificationProvider>MQTT</PushNotificationProvider>
<Properties>
<Property Name="mqtt.adapter.name">raspberrypi.mqtt.adapter</Property> <Property Name="mqtt.adapter.name">raspberrypi.mqtt.adapter</Property>
<Property Name="url">tcp://localhost:1883</Property> <Property Name="url">tcp://localhost:1883</Property>
<Property Name="username">admin</Property> <Property Name="username">admin</Property>
@ -48,6 +45,13 @@
<Property Name="qos">0</Property> <Property Name="qos">0</Property>
<Property Name="scopes"/> <Property Name="scopes"/>
<Property Name="clearSession">true</Property> <Property Name="clearSession">true</Property>
</Properties> </ConfigProperties>
</PushNotificationConfiguration> </PushNotificationProvider>
</DeviceManagementConfiguration>
<License>
<Language>en_US</Language>
<Version>1.0.0</Version>
<Text>This is license text</Text>
</License>
</DeviceTypeConfiguration>

@ -17,30 +17,27 @@
~ specific language governing permissions and limitations ~ specific language governing permissions and limitations
~ under the License. ~ under the License.
--> -->
<DeviceManagementConfiguration> <DeviceTypeConfiguration name="virtual_firealarm">
<DeviceType>virtual_firealarm</DeviceType> <Features>
<Feature code="buzz">
<Name>Control buzzer</Name>
<Description>Control buzzer on Virtual Firealarm</Description>
<Operation context="device/{deviceId}/buzz" method="POST">
<FormParameters>
<Parameter>state</Parameter>
</FormParameters>
</Operation>
</Feature>
</Features>
<ManagementRepository> <ProvisioningConfig>
<DeviceDefinition> <SharedWithAllTenants>false</SharedWithAllTenants>
<License> </ProvisioningConfig>
<Language>en_US</Language>
<Version>1.0.0</Version>
<Text>This is license text</Text>
</License>
<!--if generate is set to true then the feature information will be picked up from the annotation in the api-->
<Features generate="true"/>
</DeviceDefinition>
<ProvisioningConfig> <PushNotificationProvider type="MQTT">
<SharedWithAllTenants>false</SharedWithAllTenants> <FileBasedProperties>true</FileBasedProperties>
</ProvisioningConfig> <!--if file based properties is set to false then the configuration will be picked from platform configuration-->
</ManagementRepository> <ConfigProperties>
<PushNotificationConfiguration>
<!--MQTT Config-->
<PushNotificationProvider>MQTT</PushNotificationProvider>
<Properties>
<Property Name="mqtt.adapter.name">virtualfirealarm.mqtt.adapter</Property> <Property Name="mqtt.adapter.name">virtualfirealarm.mqtt.adapter</Property>
<Property Name="url">tcp://localhost:1883</Property> <Property Name="url">tcp://localhost:1883</Property>
<Property Name="username">admin</Property> <Property Name="username">admin</Property>
@ -48,17 +45,27 @@
<Property Name="qos">0</Property> <Property Name="qos">0</Property>
<Property Name="scopes"/> <Property Name="scopes"/>
<Property Name="clearSession">true</Property> <Property Name="clearSession">true</Property>
</Properties> </ConfigProperties>
<!--XMPP Config--> </PushNotificationProvider>
<!--PushNotificationProvider>XMPP</PushNotificationProvider>
<Properties> <!--<PushNotificationProvider type="XMPP">-->
<Property Name="xmpp.adapter.name">virtualfirealarm.xmpp.adapter</Property> <!--<FileBasedProperties>true</FileBasedProperties>-->
<Property Name="host">localhost</Property> <!--&lt;!&ndash;if file based properties is set to false then the configuration will be picked from platform configuration&ndash;&gt;-->
<Property Name="port">5222</Property> <!--<ConfigProperties>-->
<Property Name="username">admin</Property> <!--<Property Name="xmpp.adapter.name">virtualfirealarm.xmpp.adapter</Property>-->
<Property Name="password">admin</Property> <!--<Property Name="host">localhost</Property>-->
<Property Name="jid">admin@localhost</Property> <!--<Property Name="port">5222</Property>-->
<Property Name="server.name">localhost</Property> <!--<Property Name="username">admin</Property>-->
</Properties--> <!--<Property Name="password">admin</Property>-->
</PushNotificationConfiguration> <!--<Property Name="jid">admin@localhost</Property>-->
</DeviceManagementConfiguration> <!--<Property Name="server.name">localhost</Property>-->
<!--</ConfigProperties>-->
<!--</PushNotificationProvider>-->
<License>
<Language>en_US</Language>
<Version>1.0.0</Version>
<Text>This is license text</Text>
</License>
</DeviceTypeConfiguration>
Loading…
Cancel
Save