Fork me on GitHub

Command Line Examples

Here are examples with `curl` command (See for detail about the original examples.):

Creating a node - creates 'hello' node under the root node:

$ curl --request MKCOL --data @- --user admin:admin \
> http://localhost:8080/cms/server/default/jcr:root/hello/ <<END
> <sv:node sv:name="hello" xmlns:sv="">
> <sv:property sv:name="message" sv:type="String">
> <sv:value>Hello, World!</sv:value>
> </sv:property>
> <sv:property sv:name="date" sv:type="Date">
> <sv:value>2012-12-31T12:00:00.000Z</sv:value>
> </sv:property>
> </sv:node>

Read the node:

$ curl --user admin:admin http://localhost:8080/cms/server/default/jcr:root/hello/
<?xml version="1.0" encoding="UTF-8"?>
<sv:node xmlns:sv="" sv:name="hello">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
  <sv:property sv:name="date" sv:type="Date">
  <sv:property sv:name="message" sv:type="String">
    <sv:value>Hello, World!</sv:value>

Update 'date' property of the 'hello' node:

$ curl --request PUT --header "Content-Type: jcr-value/date" \
> --data "2012-12-30T12:00:00.000Z" --user admin:admin \
> http://localhost:8080/server/default/jcr:root/hello/date

Update 'history' property of the 'hello' node:

$ curl --request PUT --header "Content-Type: jcr-value/string" \> --data "Document data updated" --user admin:admin \
> http://localhost:8080/cms/server/default/jcr:root/hello/history

Delete the node:

$ curl --request DELETE --user admin:admin \
> http://localhost:8080/cms/server/default/jcr:root/hello/