Class SlingPropertyValueHandler
- java.lang.Object
-
- org.apache.sling.servlets.post.impl.helper.SlingPropertyValueHandler
-
public class SlingPropertyValueHandler extends Object
Sets a property on the given resource, in some cases with a specific type and value. For example, "lastModified" with an empty value is stored as the current Date. Special handling might apply if the resource is backed by a JCR node.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSlingPropertyValueHandler.Modifiable
-
Constructor Summary
Constructors Constructor Description SlingPropertyValueHandler(DateParser dateParser, JCRSupport jcrSupport, List<Modification> changes)Constructs a property value handler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetProperty(org.apache.sling.api.resource.Resource parent, RequestProperty prop)Set property on given node, with some automatic values when user provides the field name but no value.
-
-
-
Constructor Detail
-
SlingPropertyValueHandler
public SlingPropertyValueHandler(DateParser dateParser, JCRSupport jcrSupport, List<Modification> changes)
Constructs a property value handler- Parameters:
dateParser- the dateParserjcrSupport- the jcrSupportchanges- the changes
-
-
Method Detail
-
setProperty
public void setProperty(org.apache.sling.api.resource.Resource parent, RequestProperty prop) throws org.apache.sling.api.resource.PersistenceExceptionSet property on given node, with some automatic values when user provides the field name but no value. html example for testing:<input type="hidden" name="created"/> <input type="hidden" name="lastModified"/> <input type="hidden" name="createdBy" /> <input type="hidden" name="lastModifiedBy"/>- Parameters:
parent- the parent nodeprop- the request property- Throws:
org.apache.sling.api.resource.PersistenceException- if a resource error occurs
-
-