[deepamehta-users] Address Model in DM Webclient

Juergen Neumann j.neumann at junes.eu
Sun Mar 1 17:20:47 CET 2015


Thank you Jörg! 

I have implemted the checking into my script. Now I would like to
actually change the association definition from composition definition
to aggregation definition. But as it is not assigned to any workspace,
it seem that I cannot change it, at least not with the GUI. What shall I
do?

Thx, JuergeN

Am Donnerstag, den 26.02.2015, 19:19 +0100 schrieb Jörg Richter:
> Hi JuergeN,
> 
> yes, you can check the respective Association Type by GETing the type definition for Address Entry:
> 
> 	curl http://localhost:8080/core/topictype/dm4.contacts.address_entry
> 
> The complete result is printed below.
> The interesting part is the "assoc_defs" property, an array. The 1st Assoc Def (at index 0) is for Address Label and the 2nd (at index 1) -- this is what you're interesting in -- is for Address. As being itself an Association an Assoc Def has a "type_uri" property. That is what you're finally interested in.
> 
> So, by help of the "json" tool you can access the Association Type this way:
> 
> 	curl http://localhost:8080/core/topictype/dm4.contacts.address_entry | json assoc_defs[1].type_uri
> 
> With the DM standard distro you'll get:
> 
> 	dm4.core.composition_def
> 
> If you've changed the Assoc Def (between Address Entry and Address) to Aggregation Definition you'll get:
> 
> 	dm4.core.aggregation_def
> 
> BTW: thank you very much for pointing me to the "json" tool (http://trentm.com/json/). This is indeed really nice :-)
> 
> Cheers,
> Jörg
> 
> And here the (prettified) complete Topic Type definition for Address Entry as initially GET:
> 
> {
>   "id": 2553,
>   "uri": "dm4.contacts.address_entry",
>   "type_uri": "dm4.core.topic_type",
>   "value": "Address Entry",
>   "childs": {
>     "dm4.time.created": {
>       "id": -1,
>       "uri": "",
>       "type_uri": "dm4.time.created",
>       "value": 0,
>       "childs": {}
>     },
>     "dm4.time.modified": {
>       "id": -1,
>       "uri": "",
>       "type_uri": "dm4.time.modified",
>       "value": 1424972225289,
>       "childs": {}
>     }
>   },
>   "data_type_uri": "dm4.core.composite",
>   "index_mode_uris": [],
>   "assoc_defs": [
>     {
>       "id": 2558,
>       "uri": "",
>       "type_uri": "dm4.core.aggregation_def",
>       "value": "",
>       "childs": {},
>       "role_1": {
>         "topic_uri": "dm4.contacts.address_entry",
>         "role_type_uri": "dm4.core.parent_type"
>       },
>       "role_2": {
>         "topic_uri": "dm4.contacts.address_label",
>         "role_type_uri": "dm4.core.child_type"
>       },
>       "parent_cardinality_uri": "dm4.core.many",
>       "child_cardinality_uri": "dm4.core.one",
>       "view_config_topics": []
>     },
>     {
>       "id": 2564,
>       "uri": "",
>       "type_uri": "dm4.core.composition_def",
>       "value": "",
>       "childs": {},
>       "role_1": {
>         "topic_uri": "dm4.contacts.address_entry",
>         "role_type_uri": "dm4.core.parent_type"
>       },
>       "role_2": {
>         "topic_uri": "dm4.contacts.address",
>         "role_type_uri": "dm4.core.child_type"
>       },
>       "parent_cardinality_uri": "dm4.core.one",
>       "child_cardinality_uri": "dm4.core.one",
>       "view_config_topics": []
>     }
>   ],
>   "label_config": [],
>   "view_config_topics": []
> }
> 
> 
> On Feb 25, 2015, at 17:55, Juergen Neumann wrote:
> 
> > Hi Jörg, 
> > 
> > thanks, I will try it. Is there a way to check through the REST API what
> > kind of AssocType is currently defined between AddressEntry and
> > AddressType. I ould like to implement an automatic check to see if I can
> > use the ref_ID or not.
> > 
> > Thank you very much in advance!
> > 
> > JuergeN
> 




More information about the users mailing list