|
Page Created :
SLINGxSITE :
Modifying Content - The SlingPostServlet
Modifying Content - The SlingPostServlet has been created by Felix Meschberger (May 15, 2008). Content:Modifying Content: The SlingPostServlet
Multiple Ways to Modify ContentAs always in life there is more than one way to do it. So to modify content in a JCR repository underlying Sling, you have multiple options, two of which are WebDAV and the Sling default POST Servlet also called the SlingPostServlet. This page is about how you can modify - create, modify, copy, move, delete - content through the SlingPostServlet. In addition it also explains how to extend the SlingPostServlet with new operations. What is Content anyway ? In the following discussion, I use the terms Content and Item interchangeably. With Content I just mean some data to be stored in the JCR repository to be later used as the basis for some presentation. In this sense Content is a rather conceptual term. Item is the name of the parent interface of the JCR Node and Property interfaces. When speaking of Items we mean some actual data stored in the repository ignoring whether the data is actually stored as a Node with child nodes and properties or just a single Property. Quickstart: Creating ContentTo create content you simply send an HTTP request using the path of the node to store the content in and include the actual content as request parameters. So one possibility to do just that is by having an HTML Form like the following: <form method="POST" action="" class="code-quote">"http://host/some/new/content" > <input type="text" name="title" value="" /> <input type="text" name="text" value="" /> </form>
|
Unsubscribe or edit your notifications preferences
