-
Language:
English
-
Language:
English
Red Hat Training
A Red Hat training course is available for Red Hat JBoss Data Virtualization
5.2. REST Service 3.x
Represents the default version of the RESTful API distributed with the hierarchical database. It provides the following methods:
- Retrieve a list of available repositories
- URL : http://<host>:<port>/<context>HTTP Method : GETProduces : application/json; text/html; text/plain;Default Output : text/htmlResponse Code (if successful): OKResponse Format :
{ "repositories":[ { "name":"repo", "workspaces":"http://localhost:8080/modeshape-rest", "metadata":{ "custom.rep.name":"repo", "custom.rep.workspace.names":"default",} ..... } } ] }
- Retrieve a list of workspaces for a repository
- URL : http://<host>:<port>/<context>/<repository_name>HTTP Method : GETProduces : application/json; text/html; text/plain;Default Output : text/htmlResponse Code (if successful): OKResponse Format :
{ "workspaces":[ { "name":"default", "repository":"http://localhost:8080/modeshape-rest", "items":"http://localhost:8080/modeshape-rest/default/items", "query":"http://localhost:8080/modeshape-rest/default/query", "binary":"http://localhost:8080/modeshape-rest/default/binary", "nodeTypes":"http://localhost:8080/modeshape-rest/default/nodetypes" } ] }
- Retrieve a node or a property
- Retrieves an item at a given path.URL : http://<host>:<port>/<context>/<repository_name>/<workspace_name>/items/<item_path>HTTP Method : GETProduces : application/json; text/html; text/plain;Default Output : text/htmlResponse Code (if successful): OKOptional Query Parameters :
- depth - a numeric value indicating how many level of children should be retrieved under the node located at path. A negative value indicates all children
Response Format :{ "self":"http://localhost:8080/modeshape-rest/default/items/someNode", "up":"http://localhost:8080/modeshape-rest/default/items/", "id":"319a0554-3504-4984-b54b-3a9367caac92", "jcr:primaryType":"{http://www.modeshape.org/1.0}root", "jcr:uuid":"319a0554-3504-4984-b54b-3a9367caac92", "children":{ "jcr:system":{ "self":"http://localhost:8080/modeshape-rest/default/items/jcr:system", "up":"http://localhost:8080/modeshape-rest/default/items/", "id": "0a851519-e87d-4e02-b399-0503aa70ab3f" } } }
- Create a node
- Creates a node at the given path, using the body of request as JSON contentURL : http://<host>:<port>/<context>/<repository_name>/<workspace_name>/items/<node_path>HTTP Method : POSTProduces : application/json; text/html; text/plain;Default Output : application/jsonRequest Content-Type : application/jsonResponse Code (if successful): CREATEDRequest Format :
{ "jcr:primaryType":"nt:unstructured", "testProperty":"testValue", "multiValuedProperty":["value1", "value2"], "children":{ "childNode":{ "nestedProperty":"nestedValue" } } }
Response Format :{ "self":"http://localhost:8080/modeshape-rest/default/items/testNode", "up":"http://localhost:8080/modeshape-rest/default/items/", "id":"bf171df0-daa2-481d-a48a-b3965cd69d9c", "jcr:primaryType":"{http://www.jcp.org/jcr/nt/1.0}unstructured", "multiValuedProperty":[ "value1", "value2" ], "testProperty":"testValue", "children":{ "childNode":{ "self":"http://localhost:8080/modeshape-rest/default/items/testNode/childNode", "up":"http://localhost:8080/modeshape-rest/default/items/testNode", "id":"113e6eea-cbd2-4837-8344-5b28bbfd695c", } } }
- Update a node or a property
- Updates a node or a property at the given path, using the body of request as JSON contentURL : http://<host>:<port>/<context>/<repository_name>/<workspace_name>/items/<item_path>HTTP Method : PUTProduces : application/json; text/html; text/plain;Default Output : application/jsonRequest Content-Type : application/jsonResponse Code (if successful): OKRequest Format :Node: same as the one used when creatingProperty:
{"testProperty":"some_new_value"}
Response Format :Node: same as one used when creatingProperty:{"testProperty":"some_new_value"}
- Delete a node or a property
- Deletes the node or the property at the given path. If a node is being deleted, this will also delete all of its descendants.URL : http://<host>:<port>/<context>/<repository_name>/<workspace_name>/items/<item_path>HTTP Method : DELETEProduces : noneResponse Code (if successful): NO_CONTENT
- Retrieve a node by its identifier
- Retrieves a node with a specified identifier. This is equivalent to the
Session.getNodeByIdentifier(String)
method, where the identifier is obtained from theid
field (or thejcr:uuid
field if the node ismix:referenceable
) in a previous response. Remember that node identifiers are generated by the repository, are opaque (and are not always UUIDs), and always remains the same for a given node (even when moved or renamed) until the node is destroyed.URL : http://<host>:<port>/<context>/<repository_name>/<workspace_name>/nodes/<node_id>HTTP Method : GETProduces : application/json; text/html; text/plain;Default Output : text/htmlResponse Code (if successful): OKOptional Query Parameters :- depth - a numeric value indicating how many level of children should be retrieved under the node located at path. A negative value indicates all children
Response Format :{ "self":"http://localhost:8080/modeshape-rest/default/items/someNode", "up":"http://localhost:8080/modeshape-rest/default/items/", "id":"319a0554-3504-4984-b54b-3a9367caac92", "jcr:primaryType":"{http://www.modeshape.org/1.0}root", "jcr:uuid":"319a0554-3504-4984-b54b-3a9367caac92", "children":{ "jcr:system":{ "self":"http://localhost:8080/modeshape-rest/default/items/jcr:system", "up":"http://localhost:8080/modeshape-rest/default/items/", "id": "0a851519-e87d-4e02-b399-0503aa70ab3f" } } }
- Update a node by its identifier
- Updates a node with the given identifier, using the body of request as JSON content. The identifier must be obtained from the
id
field in a previous response.URL : http://<host>:<port>/<context>/<repository_name>/<workspace_name>/nodes/<node_id>HTTP Method : PUTProduces : application/json; text/html; text/plain;Default Output : application/jsonRequest Content-Type : application/jsonResponse Code (if successful): OKRequest Format :Node: same as the one used when creating a nodeProperty:{"testProperty":"some_new_value"}
Response Format :Node: same as one used when creating a nodeProperty:{"testProperty":"some_new_value"}
- Delete a node by its identifier
- Deletes the node with the given identifier, and all of its descendants. The identifier must be obtained from the
id
field in a previous response.URL : http://<host>:<port>/<context>/<repository_name>/<workspace_name>/nodes/<node_id>HTTP Method : DELETEProduces : noneResponse Code (if successful): NO_CONTENT - Execute a JCR query
- Executes a JCR query in either: XPath, SQL or SQL2 format, returning a JSON object in response.URL : http://<host>:<port>/<context>/<repository_name>/<workspace_name>/queryHTTP Method : POSTProduces : application/json; text/html; text/plain;Request Content-Type : application/jcr+sql; application/jcr+xpath; application/jcr+sql2; application/jcr+searchDefault Output : application/jsonResponse Code (if successful): OKOptional Query Parameters :
- offset - the index in the result set where to start the retrieval of data
- limit - the maximum number of rows to return
Response Format :{ "columns":{ "jcr:path":"STRING", "jcr:score":"DOUBLE", "foo":"STRING" }, "rows":[ { "jcr:path":"/{}testNode/{}child[2]", "jcr:score":"0.8575897812843323", "foo":"value", "mode:uri":"http://localhost:8080/modeshape-rest/default/items/testNode/child[2]" }, { "jcr:path":"/{}testNode/{}child[3]", "jcr:score":"0.8575897812843323", "foo":"value", "mode:uri":"http://localhost:8080/modeshape-rest/default/items/testNode/child[3]" } ] }
- Create multiple nodes
- Creates multiple nodes (bulk operation) in the repository, using a single session. If any of the nodes cannot be created, the entire operation fails.URL : _http://<host>:<port>/<context>/<repository_name>/<workspace_name>/itemsHTTP Method : POSTProduces : application/json; text/html; text/plain;Default Output : application/jsonRequest Content-Type : application/jsonResponse Code (if successful): OKRequest Format :
{ "testNode/child/subChild" : { "jcr:primaryType":"nt:unstructured", "testProperty":"testValue", "multiValuedProperty":["value1", "value2"] }, "testNode/child" : { "jcr:primaryType":"nt:unstructured", "testProperty":"testValue", "multiValuedProperty":["value1", "value2"] }, "testNode/otherChild" : { "jcr:primaryType":"nt:unstructured", "testProperty":"testValue", "multiValuedProperty":["value1", "value2"], "children":{ "otherSubChild":{ "nestedProperty":"nestedValue" } } } }
Response Format :[ { "self":"http://localhost:8080/modeshape-rest/default/items/testNode/child", "up":"http://localhost:8080/modeshape-rest/default/items/testNode", "id":"0ef2edc9-c873-4a2f-805e-2950b98225c6", "jcr:primaryType":"{http://www.jcp.org/jcr/nt/1.0}unstructured", "multiValuedProperty":[ "value1", "value2" ], "testProperty":"testValue" }, { "self":"http://localhost:8080/modeshape-rest/default/items/testNode/child/subChild", "up":"http://localhost:8080/modeshape-rest/default/items/testNode/child", "id":"fb6f4d82-33e1-4bc1-8048-d1f9a685779b", "jcr:primaryType":"{http://www.jcp.org/jcr/nt/1.0}unstructured", "multiValuedProperty":[ "value1", "value2" ], "testProperty":"testValue" }, { "self":"http://localhost:8080/modeshape-rest/default/items/testNode/otherChild", "up":"http://localhost:8080/modeshape-rest/default/items/testNode", "id":"da12f5f9-4ab9-48d7-a159-07144e378d54", "jcr:primaryType":"{http://www.jcp.org/jcr/nt/1.0}unstructured", "multiValuedProperty":[ "value1", "value2" ], "testProperty":"testValue", "children":{ "otherSubChild":{ "self":"http://localhost:8080/modeshape-rest/default/items/testNode/otherChild/otherSubChild", "up":"http://localhost:8080/modeshape-rest/default/items/testNode/otherChild" "id":"21ea01f5-e41c-4aea-9087-e241e02a4b2d", } } } ]
- Update multiple items
- Updates multiple nodes and/or properties (bulk operation) in the repository, using a single session. If any of the items cannot be updated, the entire operation fails.URL : _http://<host>:<port>/<context>/<repository_name>/<workspace_name>/itemsHTTP Method : PUTProduces : application/json; text/html; text/plain;Default Output : application/jsonRequest Content-Type : application/jsonResponse Code (if successful): OKRequest Format : same as the one used when creating multiple nodes.Response Format : same as the one used when creating multiple nodes.
- Delete multiple items
- Deletes multiple items (bulk operation) in the repository, using a single session. If any of the items cannot be removed, the entire operation fails.URL : _http://<host>:<port>/<context>/<repository_name>/<workspace_name>/itemsHTTP Method : DELETEProduces : none;Request Content-Type : application/jsonResponse Code (if successful): OKRequest Format :
["testNode/otherChild", "testNode/child", "testNode/child/subChild"]
- Retrieve a node type
- Retrieves the information about a registered node type in the repository.URL : http://<host>:<port>/<context>/<repository_name>/<workspace_name>/nodetypes/node_type_nameHTTP Method : GETProduces : application/json; text/html; text/plain;Default Output : text/htmlResponse Code (if successful): OKResponse Format :
{ "nt:base":{ "mixin":false, "abstract":true, "queryable":true, "hasOrderableChildNodes":false, "propertyDefinitions":[ { "jcr:primaryType":{ "requiredType":"Name", "declaringNodeTypeName":"nt:base", "mandatory":true, "multiple":false, "autocreated":true, "protected":true, "fullTextSearchable":true, "onParentVersion":"COMPUTE" } }, { "jcr:mixinTypes":{ "requiredType":"Name", "declaringNodeTypeName":"nt:base", "mandatory":false, "multiple":true, "autocreated":false, "protected":true, "fullTextSearchable":true, "onParentVersion":"COMPUTE" } } ], "subTypes":[ "http://localhost:8080/modeshape-rest/default/nodetypes/mode:lock", "http://localhost:8080/modeshape-rest/default/nodetypes/mode:locks", .... ] } }
- Import a CND file (via request content)
- Imports a CND file into the Repository, using the entire request body stream as the content of the CND. If you were using curl , this would be the equivalent of curl -dURL : _http://<host>:<port>/<context>/<repository_name>/<workspace_name>/nodetypesHTTP Method : POSTProduces : application/json; text/html; text/plain;Default Output : application/jsonResponse Code (if successful): OKResponse Format :
[ { "nt:base":{ "mixin":false, "abstract":true, "queryable":true, "hasOrderableChildNodes":false, "propertyDefinitions":[ { "jcr:primaryType":{ "requiredType":"Name", "declaringNodeTypeName":"nt:base", "mandatory":true, "multiple":false, "autocreated":true, "protected":true, "fullTextSearchable":true, "onParentVersion":"COMPUTE" } }, { "jcr:mixinTypes":{ "requiredType":"Name", "declaringNodeTypeName":"nt:base", "mandatory":false, "multiple":true, "autocreated":false, "protected":true, "fullTextSearchable":true, "onParentVersion":"COMPUTE" } } ], "subTypes":[ "http://localhost:8080/modeshape-rest/default/nodetypes/mode:lock", ... ] } }, { "nt:unstructured":{ "mixin":false, "abstract":false, "queryable":true, "hasOrderableChildNodes":true, "propertyDefinitions":[ { "*":{ "requiredType":"undefined", "declaringNodeTypeName":"nt:unstructured", "mandatory":false, "multiple":true, "autocreated":false, "protected":false, "fullTextSearchable":true, "onParentVersion":"COPY" } }, { "*":{ "requiredType":"undefined", "declaringNodeTypeName":"nt:unstructured", "mandatory":false, "multiple":false, "autocreated":false, "protected":false, "fullTextSearchable":true, "onParentVersion":"COPY" } } ], "superTypes":[ "http://localhost:8080/modeshape-rest/default/nodetypes/nt:base" ] } }, { "mix:created":{ "mixin":true, "abstract":false, "queryable":true, "hasOrderableChildNodes":false, "propertyDefinitions":[ { "jcr:created":{ "requiredType":"Date", "declaringNodeTypeName":"mix:created", "mandatory":false, "multiple":false, "autocreated":false, "protected":true, "fullTextSearchable":true, "onParentVersion":"COPY" } }, { "jcr:createdBy":{ "requiredType":"String", "declaringNodeTypeName":"mix:created", "mandatory":false, "multiple":false, "autocreated":false, "protected":true, "fullTextSearchable":true, "onParentVersion":"COPY" } } ], "subTypes":[ "http://localhost:8080/modeshape-rest/default/nodetypes/nt:hierarchyNode" ] } } ]
- Import a CND file (via "multipart/form-data")
- Imports a CND file into the Repository when the CND file came from a form submission, where the name of the HTML element is file . If you were using curl , this would be the equivalent of curl -FURL : _http://<host>:<port>/<context>/<repository_name>/<workspace_name>/nodetypesHTTP Method : POSTProduces : application/json; text/html; text/plain;Request Content-Type : multipart/form-dataDefault Output : application/jsonResponse Code (if successful): OKResponse Format : the same as when importing a CND via the request body.
- Retrieve a binary property
- Retrieves the content of a binary property from the repository, at a given path, by streaming it to the response.URL : http://<host>:<port>/<context>/<repository_name>/<workspace_name>/binary/binary_property_pathHTTP Method : GETProduces : the mime-type of the binary, or a default mime-typeResponse Code (if successful): OKOptional Query Parameters :
- mimeType - a string which can be provided by the client, in case it already knows the expected mimetype of the binary stream. Otherwise, the hierarchical database will try to detect the mimetype using its own detectors mechanism
- contentDisposition - a string which will be returned as the Content-Disposition response header. If none provide, the default is: attachment;filename=property_parent_name
- Create a binary property (via request content)
- Creates a new binary property in the repository, at the given path, using the entire request body stream as the content of the binary. If you were using curl , this would be the equivalent of curl -dURL : http://<host>:<port>/<context>/<repository_name>/<workspace_name>/binary/binary_property_pathHTTP Method : POSTProduces : application/json; text/html; text/plain;Default Output : application/jsonResponse Code (if successful): OKResponse Format :
{ "testProperty":"http://localhost:8080/modeshape-rest/default/binary/testNode/testProperty", "self":"http://localhost:8080/modeshape-rest/default/items/testNode/testProperty", "up":"http://localhost:8080/modeshape-rest/default/items/testNode" }
- Update a binary property (via request content)
- Updates the content of a binary property in the repository, at the given path, using the entire request body stream as the content of the binary. If you were using curl , this would be the equivalent of curl -dURL : http://<host>:<port>/<context>/<repository_name>/<workspace_name>/binary/binary_property_pathHTTP Method : POST, PUTProduces : application/json; text/html; text/plain;Default Output : application/jsonResponse Code (if successful): OKResponse Format : the same as in the case when creating a new binary property
- Create/Update a binary property (via "multipart/form-data")
- Creates or updates the content of a binary property in the repository, at the given path, when the content came from a form submission, where the name of the HTML element is file . If you were using curl , this would be the equivalent of curl -FURL : http://<host>:<port>/<context>/<repository_name>/<workspace_name>/binary/binary_property_pathHTTP Method : POSTProduces : application/json; text/html; text/plain;Default Output : application/jsonRequest Content-Type : multipart/form-dataResponse Code (if successful): OKResponse Format : the same as in the case when creating a new binary property
- Obtain a query plan for a JCR query
- Obtain the query plan for an XPath, SQL or SQL2 query, returning the string representation of the query plan.URL : http://<host>:<port>/<context>/<repository_name>/<workspace_name>/queryPlanHTTP Method : POSTProduces : application/json; text/html; text/plain;Default Output : text/plainRequest Content-Type : application/jcr+sql; application/jcr+xpath; application/jcr+sql2; application/jcr+searchResponse Code (if successful): OKOptional Query Parameters :
- offset - the index in the result set where to start the retrieval of data
- limit - the maximum number of rows to return
Response Format (as "application/json"):{ "statement":"SELECT * FROM [nt:unstructured] WHERE ISCHILDNODE('\/testNode')", "language":"JCR-SQL2", "abstractQueryModel":"SELECT * FROM [nt:unstructured] WHERE ISCHILDNODE([nt:unstructured],'\/testNode')", "queryPlan": [ "Access [nt:unstructured]", " Project [nt:unstructured] <PROJECT_COLUMNS=[[nt:unstructured].[jcr:primaryType] AS [nt:unstructured.jcr:primaryType], [nt:unstructured].[jcr:mixinTypes] AS [nt:unstructured.jcr:mixinTypes], [nt:unstructured].[jcr:path] AS [nt:unstructured.jcr:path], [nt:unstructured].[jcr:name] AS [nt:unstructured.jcr:name], [nt:unstructured].[jcr:score] AS [nt:unstructured.jcr:score], [nt:unstructured].[mode:localName] AS [nt:unstructured.mode:localName], [nt:unstructured].[mode:depth] AS [nt:unstructured.mode:depth]], PROJECT_COLUMN_TYPES=[STRING, STRING, STRING, STRING, DOUBLE, STRING, LONG]>", " Select [nt:unstructured] <SELECT_CRITERIA=ISCHILDNODE([nt:unstructured],'\/testNode')>", " Select [nt:unstructured] <SELECT_CRITERIA=[nt:unstructured].[jcr:primaryType] = 'nt:unstructured'>", " Source [nt:unstructured] <SOURCE_NAME=__ALLNODES__, SOURCE_COLUMNS=[jcr:frozenUuid(STRING), mode:sharedUuid(REFERENCE), mode:sessionScope(BOOLEAN), jcr:defaultValues(STRING), mode:projectedNodeKey(STRING), jcr:mixinTypes(STRING), jcr:frozenPrimaryType(STRING), jcr:defaultPrimaryType(STRING), jcr:statement(STRING), jcr:lastModifiedBy(STRING), jcr:mimeType(STRING), jcr:hasOrderableChildNodes(BOOLEAN), jcr:etag(STRING), jcr:encoding(STRING), jcr:root(REFERENCE), jcr:supertypes(STRING), jcr:successors(REFERENCE), jcr:primaryItemName(STRING), jcr:hold(STRING), jcr:workspace(STRING), jcr:description(STRING), jcr:primaryType(STRING), mode:externalNodeKey(STRING), mode:derivedFrom(STRING), mode:isHeldBySession(BOOLEAN), jcr:baseVersion(REFERENCE), jcr:lastModified(DATE), jcr:mergeFailed(REFERENCE), mode:derivedAt(DATE), jcr:requiredPrimaryTypes(STRING), jcr:multiple(BOOLEAN), mode:generated(BOOLEAN), jcr:activityTitle(STRING), jcr:lifecyclePolicy(REFERENCE), jcr:isMixin(BOOLEAN), jcr:availableQueryOperators(STRING), jcr:childVersionHistory(REFERENCE), jcr:content(REFERENCE), jcr:autoCreated(BOOLEAN), mode:alias(STRING), jcr:createdBy(STRING), jcr:isFullTextSearchable(BOOLEAN), jcr:uuid(STRING), jcr:onParentVersion(STRING), mode:expirationDate(DATE), jcr:lockIsDeep(BOOLEAN), jcr:copiedFrom(REFERENCE), jcr:isDeep(BOOLEAN), jcr:title(STRING), jcr:versionableUuid(STRING), jcr:versionHistory(REFERENCE), jcr:isAbstract(BOOLEAN), jcr:predecessors(REFERENCE), jcr:lockOwner(STRING), mode:sha1(STRING), jcr:repository(STRING), jcr:created(DATE), jcr:frozenMixinTypes(STRING), mode:lockedKey(STRING), jcr:text(STRING), jcr:host(STRING), jcr:configuration(REFERENCE), jcr:port(STRING), mode:workspace(STRING), jcr:nodeTypeName(STRING), jcr:data(BINARY), jcr:isQueryable(BOOLEAN), jcr:language(STRING), jcr:isQueryOrderable(BOOLEAN), jcr:mandatory(BOOLEAN), jcr:isCheckedOut(BOOLEAN), jcr:protected(BOOLEAN), jcr:sameNameSiblings(BOOLEAN), jcr:requiredType(STRING), jcr:protocol(STRING), mode:lockingSession(STRING), jcr:messageId(STRING), jcr:id(REFERENCE), mode:uri(STRING), jcr:valueConstraints(STRING), jcr:retentionPolicy(REFERENCE), jcr:activity(REFERENCE), jcr:currentLifecycleState(STRING), jcr:path(STRING), jcr:name(STRING), jcr:score(DOUBLE), mode:localName(STRING), mode:depth(LONG)], SOURCE_ALIAS=nt:unstructured>" ] }
Note that the JSON response contains several fields, including the original query statement, the language, the abstract query model (or AQM, which is always equivalent to the JCR-SQL2 form of the query), and the query plan (as an array of strings).Response Format (as "text/plain"):Access [nt:unstructured] Project [nt:unstructured] <PROJECT_COLUMNS=[[nt:unstructured].[jcr:primaryType] AS [nt:unstructured.jcr:primaryType], [nt:unstructured].[jcr:mixinTypes] AS [nt:unstructured.jcr:mixinTypes], [nt:unstructured].[jcr:path] AS [nt:unstructured.jcr:path], [nt:unstructured].[jcr:name] AS [nt:unstructured.jcr:name], [nt:unstructured].[jcr:score] AS [nt:unstructured.jcr:score], [nt:unstructured].[mode:localName] AS [nt:unstructured.mode:localName], [nt:unstructured].[mode:depth] AS [nt:unstructured.mode:depth]], PROJECT_COLUMN_TYPES=[STRING, STRING, STRING, STRING, DOUBLE, STRING, LONG]> Select [nt:unstructured] <SELECT_CRITERIA=ISCHILDNODE([nt:unstructured],'/testNode')> Select [nt:unstructured] <SELECT_CRITERIA=[nt:unstructured].[jcr:primaryType] = 'nt:unstructured'> Source [nt:unstructured] <SOURCE_ALIAS=nt:unstructured, SOURCE_NAME=__ALLNODES__, SOURCE_COLUMNS=[jcr:frozenUuid(STRING), mode:sharedUuid(REFERENCE), mode:sessionScope(BOOLEAN), jcr:defaultValues(STRING), mode:projectedNodeKey(STRING), jcr:mixinTypes(STRING), jcr:frozenPrimaryType(STRING), jcr:defaultPrimaryType(STRING), jcr:statement(STRING), jcr:lastModifiedBy(STRING), jcr:mimeType(STRING), jcr:hasOrderableChildNodes(BOOLEAN), jcr:etag(STRING), jcr:encoding(STRING), jcr:root(REFERENCE), jcr:supertypes(STRING), jcr:successors(REFERENCE), jcr:primaryItemName(STRING), jcr:hold(STRING), jcr:workspace(STRING), jcr:description(STRING), jcr:primaryType(STRING), mode:externalNodeKey(STRING), mode:derivedFrom(STRING), mode:isHeldBySession(BOOLEAN), jcr:baseVersion(REFERENCE), jcr:lastModified(DATE), jcr:mergeFailed(REFERENCE), mode:derivedAt(DATE), jcr:requiredPrimaryTypes(STRING), jcr:multiple(BOOLEAN), mode:generated(BOOLEAN), jcr:activityTitle(STRING), jcr:lifecyclePolicy(REFERENCE), jcr:isMixin(BOOLEAN), jcr:availableQueryOperators(STRING), jcr:childVersionHistory(REFERENCE), jcr:content(REFERENCE), jcr:autoCreated(BOOLEAN), mode:alias(STRING), jcr:createdBy(STRING), jcr:isFullTextSearchable(BOOLEAN), jcr:uuid(STRING), jcr:onParentVersion(STRING), mode:expirationDate(DATE), jcr:lockIsDeep(BOOLEAN), jcr:copiedFrom(REFERENCE), jcr:isDeep(BOOLEAN), jcr:title(STRING), jcr:versionableUuid(STRING), jcr:versionHistory(REFERENCE), jcr:isAbstract(BOOLEAN), jcr:predecessors(REFERENCE), jcr:lockOwner(STRING), mode:sha1(STRING), jcr:repository(STRING), jcr:created(DATE), jcr:frozenMixinTypes(STRING), mode:lockedKey(STRING), jcr:text(STRING), jcr:host(STRING), jcr:configuration(REFERENCE), jcr:port(STRING), mode:workspace(STRING), jcr:nodeTypeName(STRING), jcr:data(BINARY), jcr:isQueryable(BOOLEAN), jcr:language(STRING), jcr:isQueryOrderable(BOOLEAN), jcr:mandatory(BOOLEAN), jcr:isCheckedOut(BOOLEAN), jcr:protected(BOOLEAN), jcr:sameNameSiblings(BOOLEAN), jcr:requiredType(STRING), jcr:protocol(STRING), mode:lockingSession(STRING), jcr:messageId(STRING), jcr:id(REFERENCE), mode:uri(STRING), jcr:valueConstraints(STRING), jcr:retentionPolicy(REFERENCE), jcr:activity(REFERENCE), jcr:currentLifecycleState(STRING), jcr:path(STRING), jcr:name(STRING), jcr:score(DOUBLE), mode:localName(STRING), mode:depth(LONG)]>
The text response only contains the string representation of the query plan. - Reordering nodes
- Assuming you create a parent node POSTing the following request:
{ "jcr:primaryType":"nt:unstructured", "children":{ "child1":{ "prop":"child1" }, "child2":{ "prop":"child2" }, "child3":{ "prop":"child3" } } }
Then you can reorder its children by issuing a PUT request with the following format:{ "children":{ "child3":{ }, "child2":{ }, "child1":{ } } }
- Moving nodes
- In order to move a node using the REST service, 2 steps are required:
- Retrieve the node which should be moved and store its ID (the
id
member of the JSON response) - Edit the parent-to-be node (aka. the new parent) via a PUT request which contains the ID of the node:
{ "children":{ "child1":{ }, "child2":{ }, "child3":{ }, "41e666ff-0997-4ee0-9eb8-b41319f9f403": { } } }