incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [CONF] Apache Sling > Supporting CRUD
Date Sun, 15 Apr 2012 16:38:00 GMT
    <base href="">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=SLING&amp;forWysiwyg=true"
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="">Supporting
    <h4>Page  <b>added</b> by             <a href="">Carsten
    <div class="notificationGreySide">
         <p>The current Sling resource API only allows reading of resources - with the
PersistableValueMap we have a simple mechanism to support updates, however this approach comes
with some problems (see below).</p>

<p>This is a concept how to fully implement CRUD via the resource API. As a first step
we angle the problem from the users via: the API to be used by Sling applications.</p>

<h2><a name="SupportingCRUD-UserAPI"></a>User API</h2>

<h3><a name="SupportingCRUD-Read"></a>Read</h3>

<p>The support for read is sufficient, we don't need to change that much.</p>

<h3><a name="SupportingCRUD-Delete"></a>Delete</h3>

<p>We add a <em>delete</em> method to the <b>Resource</b> interface,
so deleting a resource is a two way step: first getting the resource from the resource resolver
and then deleting it. The change is persisted immediately (see below).</p>

<h3><a name="SupportingCRUD-Create"></a>Create</h3>

<p>We add a new method <em>create(String absolutePath, ValueMap properties)</em>
to the resource resolver, we the value map is optional. This will create the resource at the
given path and add the provided properties. The change is persisted immediately (see below)<br/>
In the case of a JCR backed repository, the properties might contain <em>jcr:primaryType</em>
and <em>jcr:mixins</em> - which are used to set the node node and mixins. Otherwise
the defaults apply.</p>

<h3><a name="SupportingCRUD-Update"></a>Update</h3>


<h3><a name="SupportingCRUD-PersistingChanges"></a>Persisting Changes</h3>

<p>In general, a call to one of the methods, modifying a resource as outlined are persisted
immediately. However, transactions will be supported as well.</p>

<p>TBD Transaction handling</p>

    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href=""
class="grey">Change Notification Preferences</a>
       <a href="">View
       <a href=";showCommentArea=true#addcomment">Add

View raw message