Changes between Version 11 and Version 12 of Malted/PluginDevelopmentNotes
- Timestamp:
- 24.02.2014 17:10:38 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Malted/PluginDevelopmentNotes
v11 v12 18 18 === Referencing existing topic instances from client-side topic-models (JavaScript / JSON Syntax) serialization syntax === 19 19 20 For creating a complete composite (with all new/or existing child-topics) in one Request, the topic models (JSON) array of child-topics needs to use the following semantics like this:[[BR]] 21 (comment by jri, see updateAggregationMany() in AttachedCompositeValue. 4 cases are supported:) 22 20 23 {{{ 21 24 // for deleting or referencing existing topics, child topic array (of the one specific type) needs to look like this … … 24 27 }}} 25 28 26 For creating new child-topic instances with one big reuquese, the topc models child-topic array needs look like this:[[BR]] 27 (comment by jri, see updateAggregationMany() in AttachedCompositeValue. 3 cases are supported:) 29 An example request making use of all 4 cases could carry a payload (HTTP Body in the POST) could look like the following one (withou the // comments): 28 30 29 31 {{{ 30 // create new topic and assign it (when no prefix is found. In this case an entire topic object is expected (with ID -1 and URI "")), e.g.: 31 [ "del_id:40190", { "id":-1, "uri": "", "type_uri":"dm4.tags.tag", "value": "my_personal_tag"}, "ref_id:51131", "ref_id:11318"] 32 [ // deletes a reference to an existing topic 33 "del_id:40190", 34 // creates a new topic and references it 35 { "id":-1, "uri": "", "type_uri":"dm4.tags.tag", "value": "my_personal_tag"}, 36 // references an existing topic by id 37 "ref_id:51131", 38 // references an existing topic by uri 39 "ref_uri: "my.cool.instance.data_uri"] 32 40 }}} 33 41 34 As soon one knows this syntax, this frees one from the error-prone solution of creating topics in a 1st step, e.g. via AJAX-calls, and reference them in a 2nd step (and all that on client-side)42 As soon one knows this syntax, it frees the developer from the error-prone solutions of creating topics in multiple-steps, e.g. creating them independently (e.g. in JavaScript) in a 1st step and then reference them in a 2nd step. 35 43 36 44 == Working on DeepaMehta's server-side, resp. on your model ==