[deepamehta-users] Address Model in DM Webclient
Jörg Richter
jri at deepamehta.de
Thu Feb 26 19:19:18 CET 2015
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