<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to UpdateSensorModel</title><link>https://sourceforge.net/p/m2mlabs/wiki/UpdateSensorModel/</link><description>Recent changes to UpdateSensorModel</description><atom:link href="https://sourceforge.net/p/m2mlabs/wiki/UpdateSensorModel/feed" rel="self"/><language>en</language><lastBuildDate>Sat, 22 Sep 2012 17:13:17 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/m2mlabs/wiki/UpdateSensorModel/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage UpdateSensorModel modified by Jim</title><link>https://sourceforge.net/p/m2mlabs/wiki/UpdateSensorModel/</link><description>&lt;pre&gt;--- v5
+++ v6
@@ -16,18 +16,18 @@
 &lt;sensormodel&gt;
    1..n attributes containing name and datatype of the attribute
    &lt;attribute&gt;
-      &lt;name&gt;Temperature&lt;/name&gt;
-      &lt;type&gt;Number&lt;/type&gt;
+      &lt;name&gt;...&lt;/name&gt;
+      &lt;type&gt;...&lt;/type&gt;  one of Number, Date, Boolean, Text, GpsData
    &lt;/attribute&gt;
    ...
    1..n configuration parameters containing a display name and an internal name
    values are assigned when a sensor based on the sensor model is created
    &lt;config&gt;
-      &lt;displayname&gt;Unit&lt;/displayname&gt;
-      &lt;name&gt;unit&lt;/name&gt;
+      &lt;displayname&gt;...&lt;/displayname&gt;
+      &lt;name&gt;...&lt;/name&gt;
    &lt;/config&gt;
    ...
-   &lt;name&gt;NewSensorModel&lt;/name&gt;
+   &lt;name&gt;...&lt;/name&gt;
 &lt;/sensormodel&gt;
 ~~~~~~
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jim</dc:creator><pubDate>Sat, 22 Sep 2012 17:13:17 -0000</pubDate><guid>https://sourceforge.net507fa0c5adc9749d746d8e5fff814cba0f734075</guid></item><item><title>WikiPage UpdateSensorModel modified by Jim</title><link>https://sourceforge.net/p/m2mlabs/wiki/UpdateSensorModel/</link><description>&lt;pre&gt;--- v4
+++ v5
@@ -1,6 +1,6 @@
 ### Update Sensor Model ###
 
-changes the data of a sensor model in the domain of an owner identified by the apikey
+changes the sensor model in the domain of an owner identified by the apikey
 the full sensor model is replaced, not a delta to the existing one
 
 Path: cs-ws/resources/admin/sensormodel        Method: PUT
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jim</dc:creator><pubDate>Sat, 22 Sep 2012 09:53:58 -0000</pubDate><guid>https://sourceforge.net41e8f8ae69c021924e7759b2f605d2c96c0ee97a</guid></item><item><title>WikiPage UpdateSensorModel modified by Jim</title><link>https://sourceforge.net/p/m2mlabs/wiki/UpdateSensorModel/</link><description>&lt;pre&gt;--- v3
+++ v4
@@ -1,6 +1,6 @@
 ### Update Sensor Model ###
 
-changes the data of a sensor model in the namespace of an owner identified by the apikey
+changes the data of a sensor model in the domain of an owner identified by the apikey
 the full sensor model is replaced, not a delta to the existing one
 
 Path: cs-ws/resources/admin/sensormodel        Method: PUT
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jim</dc:creator><pubDate>Sat, 22 Sep 2012 09:46:25 -0000</pubDate><guid>https://sourceforge.neta129a8d7f51ce9a0be947d8da448c35674c11bba</guid></item><item><title>WikiPage UpdateSensorModel modified by Jim</title><link>https://sourceforge.net/p/m2mlabs/wiki/UpdateSensorModel/</link><description>&lt;pre&gt;--- v2
+++ v3
@@ -10,7 +10,7 @@
 
 * apikey
 
-PUT Data
+Data
 
 ~~~~~~
 &lt;sensormodel&gt;
@@ -40,15 +40,17 @@
 
 ~~~~~~
 PUT http://localhost/cs-ws/resources/admin/sensormodel?apikey=1234 HTTP/1.1
-Accept-Encoding: gzip,deflate
-Content-Type: application/xml
-User-Agent: Jakarta Commons-HttpClient/3.1
-Host: localhost
-Content-Length: 234
+&lt;sensormodel&gt;
+   &lt;attribute&gt;
+      &lt;name&gt;Temperature&lt;/name&gt;
+      &lt;type&gt;Number&lt;/type&gt;
+   &lt;/attribute&gt;
+   &lt;config&gt;
+      &lt;displayname&gt;Unit&lt;/displayname&gt;
+      &lt;name&gt;unit&lt;/name&gt;
+   &lt;/config&gt;
+   &lt;name&gt;SensorModel&lt;/name&gt;
+&lt;/sensormodel&gt;
 
 HTTP/1.1 200 OK
-Server: GlassFish Server Open Source Edition 3.1.2
-Content-Length: 0
-Date: Sat, 22 Sep 2012 08:31:10 GMT
-
 ~~~~~~
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jim</dc:creator><pubDate>Sat, 22 Sep 2012 08:48:44 -0000</pubDate><guid>https://sourceforge.netf536094508eec47b25d61c4c72f932def661dea1</guid></item><item><title>WikiPage UpdateSensorModel modified by Jim</title><link>https://sourceforge.net/p/m2mlabs/wiki/UpdateSensorModel/</link><description>&lt;pre&gt;--- v1
+++ v2
@@ -1,6 +1,7 @@
 ### Update Sensor Model ###
 
 changes the data of a sensor model in the namespace of an owner identified by the apikey
+the full sensor model is replaced, not a delta to the existing one
 
 Path: cs-ws/resources/admin/sensormodel        Method: PUT
 Alternative: cs-ws/resources/admin/sensormodel/put        Method: POST
@@ -12,38 +13,42 @@
 PUT Data
 
 ~~~~~~
-&lt;owner&gt;
-   &lt;apikey&gt;...&lt;/apikey&gt;        new apikey for the owner 
-   &lt;id&gt;...&lt;/id&gt;                has to be the same as the existing id
-   &lt;name&gt;...&lt;/name&gt;            has to be the same as the existing name
-&lt;/owner&gt;
+&lt;sensormodel&gt;
+   1..n attributes containing name and datatype of the attribute
+   &lt;attribute&gt;
+      &lt;name&gt;Temperature&lt;/name&gt;
+      &lt;type&gt;Number&lt;/type&gt;
+   &lt;/attribute&gt;
+   ...
+   1..n configuration parameters containing a display name and an internal name
+   values are assigned when a sensor based on the sensor model is created
+   &lt;config&gt;
+      &lt;displayname&gt;Unit&lt;/displayname&gt;
+      &lt;name&gt;unit&lt;/name&gt;
+   &lt;/config&gt;
+   ...
+   &lt;name&gt;NewSensorModel&lt;/name&gt;
+&lt;/sensormodel&gt;
 ~~~~~~
 
 Errors:
 
 * 401 UNAUTHORIZED if key is invalid or not admin key
+* 404 NOT FOUND if the sensor model  in the post data is not existing
 
 Example
 
 ~~~~~~
-PUT http://localhost/cs-ws/resources/admin/owners/test6?apikey=1234 HTTP/1.1
+PUT http://localhost/cs-ws/resources/admin/sensormodel?apikey=1234 HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/xml
 User-Agent: Jakarta Commons-HttpClient/3.1
 Host: localhost
-Content-Length: 84
+Content-Length: 234
 
 HTTP/1.1 200 OK
 Server: GlassFish Server Open Source Edition 3.1.2
-Content-Type: application/xml
-Content-Length: 174
-Date: Fri, 21 Sep 2012 19:51:20 GMT
-&lt;ownerEntity&gt;
-   &lt;data&gt;
-      &lt;apikey&gt;9999988&lt;/apikey&gt;
-      &lt;id&gt;test6&lt;/id&gt;
-      &lt;name&gt;test6&lt;/name&gt;
-   &lt;/data&gt;
-   &lt;success&gt;true&lt;/success&gt;
-&lt;/ownerEntity&gt;
+Content-Length: 0
+Date: Sat, 22 Sep 2012 08:31:10 GMT
+
 ~~~~~~
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jim</dc:creator><pubDate>Sat, 22 Sep 2012 08:38:24 -0000</pubDate><guid>https://sourceforge.net2258fcfa4f00d06c90db4b83bfcb747221d08378</guid></item><item><title>WikiPage UpdateSensorModel modified by Jim</title><link>https://sourceforge.net/p/m2mlabs/wiki/UpdateSensorModel/</link><description>### Update Sensor Model ###

changes the data of a sensor model in the namespace of an owner identified by the apikey

Path: cs-ws/resources/admin/sensormodel        Method: PUT
Alternative: cs-ws/resources/admin/sensormodel/put        Method: POST

Parameters

* apikey

PUT Data

~~~~~~
&lt;owner&gt;
   &lt;apikey&gt;...&lt;/apikey&gt;        new apikey for the owner 
   &lt;id&gt;...&lt;/id&gt;                has to be the same as the existing id
   &lt;name&gt;...&lt;/name&gt;            has to be the same as the existing name
&lt;/owner&gt;
~~~~~~

Errors:

* 401 UNAUTHORIZED if key is invalid or not admin key

Example

~~~~~~
PUT http://localhost/cs-ws/resources/admin/owners/test6?apikey=1234 HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/xml
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost
Content-Length: 84

HTTP/1.1 200 OK
Server: GlassFish Server Open Source Edition 3.1.2
Content-Type: application/xml
Content-Length: 174
Date: Fri, 21 Sep 2012 19:51:20 GMT
&lt;ownerEntity&gt;
   &lt;data&gt;
      &lt;apikey&gt;9999988&lt;/apikey&gt;
      &lt;id&gt;test6&lt;/id&gt;
      &lt;name&gt;test6&lt;/name&gt;
   &lt;/data&gt;
   &lt;success&gt;true&lt;/success&gt;
&lt;/ownerEntity&gt;
~~~~~~
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jim</dc:creator><pubDate>Sat, 22 Sep 2012 08:32:54 -0000</pubDate><guid>https://sourceforge.net21dcb77b1546db6988c98607fa6c1b2485d7e2a7</guid></item></channel></rss>