Hi, thank you for the quick fix and the screencast!
I agree with the reservation against an 'objects of type' resource from the DDD perspective. However, people with prior experience with other types of restful APIs will find it quite natural to have to POST to an URL which represents a type to create a new persistent object. I don't have any strong feelings about this (until I have more experience with Isis and RO), but I think that alignment with what has become mainstream in restful API development would help a lot for spreading RO and Isis. Especially if the service is to be consumed by front-end developers who hand-craft the client code. Thanks again Kambiz On 2015-07-17 12:17 CEST, Dan Haywood <[email protected]> wrote: > Hi Kambiz, > > as Jorg says, welcome to the list. Nice to hear that you are looking to > Apache Isis and RO for your project. > > I took a look at the code, and it turns out it's not suprising you were > having difficulties ... that bit of the code was actually broken. > > I've raised a ticket [1] and just pushed a release, so it's now working in > 1.9.0-SNAPSHOT. > > I've also recorded a quick screencast [2] (the second one in that section), > so you can see it working. (Apologies for the slightly duff audio on it... > I don't actually have a lisp!). You might also want to check out the other > screencast on RO there, too. > > Of course, if you want to try this out then you'll need to build Isis from > source; it's not difficult to do [3]. > > ~~~ > Also, in the video I do make the remark that I may very well remove the > "objects for type" resource; it breaks hypermedia, and - as Udi Dahan > pointed out in this old blog post [4] - I don't actually think it's good > domain modelling either. You might have your own opinions on that? > > Cheers > Dan > > > [1] https://issues.apache.org/jira/browse/ISIS-1174 > [2] http://localhost:4000/screencasts.html#_restful_objects_viewer > [3] http://isis.apache.org/guides/cg.html#_cg_building-isis > [4] http://www.udidahan.com/2009/06/29/dont-create-aggregate-roots/ > > > > On 14 July 2015 at 17:50, Kambiz Darabi <[email protected]> wrote: > >> Hello, >> >> as a new user of Isis, I would first like to thank you for open-sourcing >> the software. I am a developer from Germany who is interested in using >> Isis (and RO) for a customer project. >> >> Reading section 9 in the RO spec, I would have expected to be able to >> POST the following to http://~/objects/simple.SimpleObject/ (in >> SimpleApp-PROTOTYPE-with-fixtures): >> >> { >> "members": { >> "name": { >> "value": "Quux" >> } >> } >> } >> >> but this leads to a 400 with the following warning: >> >> 199 RestfulObjects Could not find properties list (no >> members[objectMemberType=property]); got >> {"members":{"name":{"value":"Quux"}}} >> >> I then debugged the application and had the impression that members must >> be an array and that each element must have the attribute >> objectMemberType set to "property": >> >> { >> "members" : [ { >> "name" : { >> "value": "Quux" >> }, >> "objectMemberType": "property" >> } ] >> } >> >> With such a JSON, the response is a '500 Server Error' and the logs show >> >> Caused by: org.hsqldb.HsqlException: integrity constraint violation: NOT >> NULL check constraint; SYS_CT_10102 table: "SimpleObject" column: "name" >> >> Debugging again shows that in ObjectAdapterUpdateHelper's >> copyOverProperties, the following is called with the id "name": >> >> propertiesList.getRepresentation(id) >> >> which returns null, so the property name is not copied to the object >> which is to be persisted, resulting in the NOT NULL exception. >> >> >> I guess that I'm completely misunderstanding how I should use the >> resource. >> >> Would someone be so kind to put me on the right track? >> >> >> Thank you >> >> >> Kambiz Darabi >> -- >> m-creations gmbh >> Acker 2 >> 55116 Mainz >> Germany >> >> W: http://www.m-creations.com >> E: [email protected] >> -- >> Registered Office: Mainz, HRB Mainz 7382 >> Managing Directors: Frank Pacholak, Kambiz Darabi >>
