few changes in sample device types to load cdmc specific units

revert-dabc3590
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">
<ManagementRepository> <Name>Add Keywords</Name>
<DeviceDefinition> <Description>Send keywords to the device</Description>
<License> <Operation context="device/{deviceId}/words" method="POST">
<Language>en_US</Language> <QueryParameters>
<Version>1.0.0</Version> <Parameter>keywords</Parameter>
<Text>This is license text</Text> </QueryParameters>
</License> </Operation>
<!--if generate is set to true then the feature information will be picked up from the annotation in the api--> </Feature>
<Features generate="true"/> <Feature code="threshold">
</DeviceDefinition> <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>
<ProvisioningConfig> <ProvisioningConfig>
<SharedWithAllTenants>false</SharedWithAllTenants> <SharedWithAllTenants>false</SharedWithAllTenants>
</ProvisioningConfig> </ProvisioningConfig>
</ManagementRepository>
<PushNotificationConfiguration> <PushNotificationProvider type="MQTT">
<!--MQTT Config--> <FileBasedProperties>true</FileBasedProperties>
<PushNotificationProvider>MQTT</PushNotificationProvider> <!--if file based properties is set to false then the configuration will be picked from platform configuration-->
<Properties> <ConfigProperties>
<Property Name="mqtt.adapter.name">android_sense.mqtt.adapter</Property> <Property Name="mqtt.adapter.name">androidsense.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>
<ProvisioningConfig>
<SharedWithAllTenants>false</SharedWithAllTenants>
</ProvisioningConfig>
<ManagementRepository>
<DeviceDefinition>
<License> <License>
<Language>en_US</Language> <Language>en_US</Language>
<Version>1.0.0</Version> <Version>1.0.0</Version>
<Text>This is license text</Text> <Text>This is license text</Text>
</License> </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> </DeviceTypeConfiguration>
<SharedWithAllTenants>false</SharedWithAllTenants>
</ProvisioningConfig>
</ManagementRepository>
</DeviceManagementConfiguration>

@ -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">
<ManagementRepository> <Name>Control Bulb</Name>
<DeviceDefinition> <Description>Control Bulb on Raspberrypi</Description>
<License> <Operation context="device/{deviceId}/bulb" method="POST">
<Language>en_US</Language> <QueryParameters>
<Version>1.0.0</Version> <Parameter>state</Parameter>
<Text>This is license text</Text> </QueryParameters>
</License> </Operation>
<!--if generate is set to true then the feature information will be picked up from the annotation in the api--> </Feature>
<Features generate="true"/> </Features>
</DeviceDefinition>
<ProvisioningConfig> <ProvisioningConfig>
<SharedWithAllTenants>false</SharedWithAllTenants> <SharedWithAllTenants>false</SharedWithAllTenants>
</ProvisioningConfig> </ProvisioningConfig>
</ManagementRepository>
<PushNotificationConfiguration> <PushNotificationProvider type="MQTT">
<!--MQTT Config--> <FileBasedProperties>true</FileBasedProperties>
<PushNotificationProvider>MQTT</PushNotificationProvider> <!--if file based properties is set to false then the configuration will be picked from platform configuration-->
<Properties> <ConfigProperties>
<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">
<ManagementRepository> <Name>Control buzzer</Name>
<DeviceDefinition> <Description>Control buzzer on Virtual Firealarm</Description>
<License> <Operation context="device/{deviceId}/buzz" method="POST">
<Language>en_US</Language> <FormParameters>
<Version>1.0.0</Version> <Parameter>state</Parameter>
<Text>This is license text</Text> </FormParameters>
</License> </Operation>
<!--if generate is set to true then the feature information will be picked up from the annotation in the api--> </Feature>
<Features generate="true"/> </Features>
</DeviceDefinition>
<ProvisioningConfig> <ProvisioningConfig>
<SharedWithAllTenants>false</SharedWithAllTenants> <SharedWithAllTenants>false</SharedWithAllTenants>
</ProvisioningConfig> </ProvisioningConfig>
</ManagementRepository>
<PushNotificationProvider type="MQTT">
<PushNotificationConfiguration> <FileBasedProperties>true</FileBasedProperties>
<!--MQTT Config--> <!--if file based properties is set to false then the configuration will be picked from platform configuration-->
<PushNotificationProvider>MQTT</PushNotificationProvider> <ConfigProperties>
<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