Changes between Version 11 and Version 12 of RestApi


Ignore:
Timestamp:
05.09.2011 02:49:35 (13 years ago)
Author:
jri
Comment:

Association Definition details

Legend:

Unmodified
Added
Removed
Modified
  • RestApi

    v11 v12  
    321321 
    322322||= Property =||= Mandatory / Optional =|| 
    323 || `uri` || Optional. Default URI is `domain.project.topic_type_<ID>`. You can change the URI later on through an update operation. However, the URI is typically specified at topic type creation time. || 
    324 || `value` || Optional. Default topic type name is an empty string. You can change the name later on through an update operation. However, the name is typically specified at topic type creation time. || 
     323|| `uri` || Optional. Default URI is `domain.project.topic_type_<ID>`. You can change the URI later on through an update operation. However, the URI is typically specified at creation time. || 
     324|| `value` || Optional. Default topic type name is an empty string. You can change the name later on through an update operation. However, the name is typically specified at creation time. || 
    325325|| `data_type_uri` || Mandatory. || 
    326326|| `index_mode_uris` || Optional. Default is no indexing. || 
    327 || `assoc_defs` || For complex topic types: Optional. Default is no child types. You can add child types later on through an update operation. However, the child types are typically specified at topic type creation time.\\\\For simple topic types: Do //not// specify child types. || 
     327|| `assoc_defs` || For complex topic types: Optional. Default is no child types. You can add child types later on through an update operation. However, the child types are typically specified at creation time.\\\\For simple topic types: Do //not// specify child types. || 
     328|| `view_config_topics` || Optional. Default is no view models. || 
     329 
     330When creating a complex topic type: For details about the association definition format see DataFormat#AssociationDefinition. 
     331 
     332For a create operation not all of the association definition's properties are involved: 
     333 
     334||= Property =||= Mandatory / Optional =|| 
     335|| `assoc_type_uri` || Mandatory. || 
     336|| `whole_cardinality_uri` || For a "composition": Do //not// specify the parent cardinality ("one" is assumed).\\\\For an "aggregation": Mandatory. || 
     337|| `part_topic_type_uri` || Mandatory. || 
     338|| `part_cardinality_uri` || Mandatory. || 
    328339|| `view_config_topics` || Optional. Default is no view models. || 
    329340 
     
    371382 
    372383{{{ 
    373 curl localhost:8080/core/topictype -X POST -H Content-Type:application/json -d ' 
    374   {uri: "spaceorg.planetarium.planet_name", 
    375    value: "Name", 
    376    data_type_uri: "dm4.core.text"}' 
    377  
    378 curl localhost:8080/core/topictype -X POST -H Content-Type:application/json -d ' 
    379   {uri: "spaceorg.planetarium.mass", 
    380    value: "Mass", 
    381    data_type_uri: "dm4.core.number"}' 
    382  
    383 curl localhost:8080/core/topictype -X POST -H Content-Type:application/json -d ' 
    384   {uri: "spaceorg.planetarium.distance_to_earth", 
    385    value: "Distance to Earth", 
    386    data_type_uri: "dm4.core.number"}' 
     384curl localhost:8080/core/topictype -X POST -H Content-Type:application/json \ 
     385-d '{uri: "spaceorg.planetarium.planet_name", 
     386     value: "Name", 
     387     data_type_uri: "dm4.core.text"}' 
     388 
     389curl localhost:8080/core/topictype -X POST -H Content-Type:application/json \ 
     390-d '{uri: "spaceorg.planetarium.mass", 
     391     value: "Mass", 
     392     data_type_uri: "dm4.core.number"}' 
     393 
     394curl localhost:8080/core/topictype -X POST -H Content-Type:application/json \ 
     395-d '{uri: "spaceorg.planetarium.distance_to_earth", 
     396     value: "Distance to Earth", 
     397     data_type_uri: "dm4.core.number"}' 
    387398}}} 
    388399 
     
    390401 
    391402{{{ 
    392 curl localhost:8080/core/topictype -i -X POST -H Content-Type:application/json -d ' 
    393   {uri: "spaceorg.planetarium.planet", 
    394    value: "Planet", 
    395    data_type_uri: "dm4.core.composite", 
    396    assoc_defs: [ 
    397      { 
    398        assoc_type_uri: "dm4.core.composition_def", 
    399        part_topic_type_uri: "spaceorg.planetarium.planet_name", 
    400        part_cardinality_uri: "dm4.core.one" 
    401      }, { 
    402        assoc_type_uri: "dm4.core.composition_def", 
    403        part_topic_type_uri: "spaceorg.planetarium.mass", 
    404        part_cardinality_uri: "dm4.core.one" 
    405      }, { 
    406        assoc_type_uri: "dm4.core.composition_def", 
    407        part_topic_type_uri: "spaceorg.planetarium.distance_to_earth", 
    408        part_cardinality_uri: "dm4.core.one" 
    409      }]}' \ 
     403curl localhost:8080/core/topictype -i -X POST -H Content-Type:application/json \ 
     404-d '{uri: "spaceorg.planetarium.planet", 
     405     value: "Planet", 
     406     data_type_uri: "dm4.core.composite", 
     407     assoc_defs: [ 
     408       { 
     409         assoc_type_uri: "dm4.core.composition_def", 
     410         part_topic_type_uri: "spaceorg.planetarium.planet_name", 
     411         part_cardinality_uri: "dm4.core.one" 
     412       }, { 
     413         assoc_type_uri: "dm4.core.composition_def", 
     414         part_topic_type_uri: "spaceorg.planetarium.mass", 
     415         part_cardinality_uri: "dm4.core.one" 
     416       }, { 
     417         assoc_type_uri: "dm4.core.composition_def", 
     418         part_topic_type_uri: "spaceorg.planetarium.distance_to_earth", 
     419         part_cardinality_uri: "dm4.core.one" 
     420       }]}' \ 
    410421| jsonpretty 
    411422}}}