Changes between Version 9 and Version 10 of RestApi


Ignore:
Timestamp:
04.09.2011 17:27:37 (9 years ago)
Author:
jri
Comment:

Create a topic type

Legend:

Unmodified
Added
Removed
Modified
  • RestApi

    v9 v10  
    8989For details about the topic format see DataFormat#Topic. 
    9090 
    91 For a create operation not all properties are involved: 
     91For a create operation not all of the topic's properties are involved: 
    9292 
    9393||= Property =||= Mandatory / Optional =|| 
    94 || `id` || Do //not// provide an ID. The ID will be system-generated. || 
    95 || `uri` || Optional. Default URI is an empty string.  || 
     94|| `uri` || Optional. Default URI is an empty string. || 
    9695|| `type_uri` || Mandatory. || 
    9796|| `value` || For a simple topic: Optional. Default value is an empty string. You can change the value later on through an update operation.\\\\For a complex topic: Do //not// specify a value. The value will be system-generated. || 
     
    104103-X POST \ 
    105104-H Content-Type:application/json \ 
    106 -d '{type_uri: "dm4.contacts.city", value: "Port-au-Prince"}' \ 
     105-d '{type_uri: "dm4.contacts.city", 
     106     value: "Port-au-Prince"}' \ 
    107107| jsonpretty 
    108108}}} 
     
    159159== Topic Types == 
    160160 
    161 === Getting all topic type URIs === 
     161=== Get all topic type URIs === 
    162162 
    163163{{{ 
     
    247247}}} 
    248248 
    249 === Getting a topic type === 
     249=== Get a topic type === 
    250250 
    251251{{{ 
     
    308308For details about the topic type format see DataFormat#TopicType. 
    309309 
     310=== Create a topic type === 
     311 
     312{{{ 
     313POST /core/topictype 
     314 
     315<the topic type to create> 
     316}}} 
     317 
     318For details about the topic type format see DataFormat#TopicType. 
     319 
     320For a create operation not all of the topic type's properties are involved: 
     321 
     322||= 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. || 
     325|| `data_type_uri` || Mandatory. || 
     326|| `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. || 
     328|| `view_config_topics` || Optional. Default is no view models. || 
     329 
     330==== Example 1: Creating a simple topic type ==== 
     331 
     332{{{ 
     333curl localhost:8080/core/topictype -i \ 
     334-X POST \ 
     335-H Content-Type:application/json \ 
     336-d '{uri: "spaceorg.planetarium.planet", 
     337     value: "Planet", 
     338     data_type_uri: "dm4.core.text"}' \ 
     339| jsonpretty 
     340}}} 
     341 
     342Response: 
     343 
     344{{{ 
     345HTTP/1.1 200 OK 
     346Content-Type: application/json 
     347 
     348{ 
     349  "id": 3505, 
     350  "uri": "spaceorg.planetarium.planet", 
     351  "type_uri": "dm4.core.topic_type", 
     352  "value": "Planet", 
     353  "composite": { 
     354  }, 
     355  "data_type_uri": "dm4.core.text", 
     356  "index_mode_uris": [ 
     357 
     358  ], 
     359  "assoc_defs": [ 
     360 
     361  ], 
     362  "view_config_topics": [ 
     363 
     364  ] 
     365} 
     366}}} 
     367 
    310368== Association Types == 
    311369 
    312 === Getting all association type URIs === 
     370=== Get all association type URIs === 
    313371 
    314372{{{