Questo contenuto non è disponibile nella lingua selezionata.
17.22. Access a Repository Item
Once you know the path to a repository's workspaces, you can retrieve the root item of the repository:
GET http://www.example.com/modeshape-rest/eds/default/items
Any other item in the repository could be accessed by appending its path to the URI above. In a default repository with no content, this would return the following response:
{
"properties": {
"jcr:primaryType": "mode:root",
"jcr:uuid": "97d7e2ef-996e-4d99-8ec2-dc623e6c2239"
},
"children": ["jcr:system"]
The response contains a mapping of property names to their values and an array of child names. Had one of the properties been multi-valued, the values for that property would have been provided as an array as well, as will shortly be shown.
The items resource also contains an option query parameter:
mode:depth. This parameter, which defaults to 1, controls how deep the hierarchy of returned nodes should be. Had the request had the parameter:
GET http://www.example.com/modeshape-rest/eds/default/items?mode:depth=2
Then the response would have contained details for the children of the root node as well.
{
"properties": {
"jcr:primaryType": "mode:root",
"jcr:uuid": "163bc5e5-3b57-4e63-b2ae-ededf43d3445"
},
"children": {
"jcr:system": {
"properties": {"jcr:primaryType": "mode:system"},
"children": ["mode:namespaces"]
}
}
}