You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2015/03/31 13:23:53 UTC

svn commit: r1670306 - /sling/site/trunk/content/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.mdtext

Author: bdelacretaz
Date: Tue Mar 31 11:23:53 2015
New Revision: 1670306

URL: http://svn.apache.org/r1670306
Log:
Automatic property values re-added, was somehow lost

Modified:
    sling/site/trunk/content/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.mdtext

Modified: sling/site/trunk/content/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.mdtext
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.mdtext?rev=1670306&r1=1670305&r2=1670306&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.mdtext Tue Mar 31 11:23:53 2015
@@ -140,7 +140,22 @@ Would assign the `/content/page/multi` p
     
 This is pretty much all there is to know about creating and modifying content. The following sections will now introduce more functionality which help you with more fine-grained control in your content management application.
     
-    
+##### Automatic property values: last modified and created by
+
+To make it easier to set "last modified" and "created by" property
+values from POST requests, values are generated automatically for the
+following property names _if they are supplied with empty values in such a request_:
+
+* `created` and `jcr:created` are set to the node creation time, as a Date value.
+
+* `lastModified`, `jcr:lastModified` are set to the node modification time, as a Date value.
+
+* `createdBy` and `jcr:createdBy` are set to the name of the user who created the node.
+
+* `lastModifiedBy`, `jcr:lastModifiedBy` are set to the name of the user who modified the node.
+
+This is demonstrated by the [SlingAutoPropertiesTest](https://svn.apache.org/repos/asf/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/SlingAutoPropertiesTest.java) which is part of our launchpad integration tests.
+
 ##### File Uploads
     
 File uploads are typically done using the `<input type="file""/>` element of an HTML form and ensuring the correct form encoding. The SlingPostServlet handles uploaded files specially, in that the file data is not simply written into a property, but a node is actually created with three properties: