Hi Bhargav,
sorry not to get back to you sooner.

couple of things:
1. the PUT resource on the object (RO spec 14.2) is for updating ALL
properties, not just a single one.
2. the "complete" property is ALWAYS disabled (you can see that from the
code [1], and from the arguments map in the representation[2]
3. notwithstanding, I think there's a bug in the RO viewer.  I tried
several different formats for the body [3], [4], [5], but got the same
error in each case [6]

So, if you want to raise a ticket for this, then either go ahead and fix
it, or wait for me to do so...

In the meantime, you could workaround by doing a PUT to each of the
individual property resources (per 16.2 of the spec); I believe this is
working fine.

Thx
Dan



[1]
https://github.com/apache/isis/blob/f38fdb92941172eabb12e0943509f239e6d5925f/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.java#L219
[2]

http://localhost:8080/restful/objects/TODO/L_11
, {

   - members:
   {
      - ownedBy:
      {
         - memberType: "property",
         - value: "sven",
         - format: "decimal",
         - x-isis-format: "bigdecimal"
         },
      - dueBy:
      {
         - memberType: "property",
         - value: "2013-07-24",
         - format: "date",
         - x-isis-format: "jodalocaldate"
         },
      - cost:
      {
         - memberType: "property",
         - value: 1.75,
         - format: "decimal",
         - x-isis-format: "bigdecimal"
         },
      - notes:
      {
         - memberType: "property",
         - value: null,
         - format: "decimal",
         - x-isis-format: "bigdecimal"
         },
      - attachment:
      {
         - memberType: "property",
         - value: null,
         - format: "decimal",
         - x-isis-format: "bigdecimal"
         },
      - description:
      {
         - memberType: "property",
         - value: "Buy bread",
         - format: "decimal",
         - x-isis-format: "bigdecimal"
         },
      - category:
      {
         - memberType: "property",
         - value: "Domestic",
         - format: "decimal",
         - x-isis-format: "bigdecimal"
         },
      - complete:
      {
         - memberType: "property",
         - value: false,
         - x-isis-format: "boolean",
         - disabledReason: "Always disabled"
         },
      - versionSequence:
      {
         - memberType: "property",
         - value: 1,
         - format: "int",
         - x-isis-format: "long",
         - disabledReason: "Always disabled"
         }
      }



[3] this - which is valid according to the spec, I think - didn't work:
{
    "cost" : {
      "value" : 2.75
    },
    "description" : {
      "value" : "An updated description"
    },
    "category" : {
      "value" : "Professional"
    }
}

[4] nor did this:
{
  "members:" {
    "cost" : {
      "memberType": "property",
      "value" : 2.75
    },
    "description" : {
      "memberType": "property",
      "value" : "An updated description"
    },
    "category" : {
      "memberType": "property",
      "value" : "Professional"
    }
  }
}


[5] nor did this:
{
    "cost" : {
      "memberType": "property",
      "value" : 2.75
    },
    "description" : {
      "memberType": "property",
      "value" : "An updated description"
    },
    "category" : {
      "memberType": "property",
      "value" : "Professional"
    }
}


[6]

   1. Status Code: 400
   2. Server: Jetty(6.1.26)
   3. Content-Length: 0
   4. Warning: 199 RestfulObjects Could not find properties list (no members
   [memberType=property]); got {"cost":{"memberType":"property","value":2.75
   },"description":{"memberType":"property","value":"An updated description"
   },"category":{"memberType":"property","value":"Professional"}}
   5. Content-Type: application/json




On 23 July 2013 18:05, Bhargav Golla <[email protected]> wrote:

> Hi Dan
>
> I am trying to edit the properties of an object and am following 14.2 in
> ROSpec to do the same. I tried to make a PUT request to the URL by chagning
> few properties and putting them into JSON. My request is as follows:
> PUT /myapp-webapp/restful/objects/TODO/L_0 HTTP/1.1
> Host: localhost:8080
> Accept: application/json
> Authorization: Basic c3ZlbjpwYXNz
> Cache-Control: no-cache
>
> { "complete": { "value": "true" } }
>
> But it is giving me a 400 error. Do you have any help here?
>
> Regards
>
> Bhargav Golla
> Developer. Freelancer.
> B.E (Hons.) Computer Science
> BITS-Pilani
> Github <http://www.github.com/bhargavgolla> | 
> LinkedIN<http://www.linkedin.com/in/bhargavgolla>
>  | Website <http://www.bhargavgolla.com/>
>

Reply via email to