use of org.apache.sling.servlets.post.impl.helper.SlingPropertyValueHandler in project sling by apache.
the class ModifyOperation method writeContent.
/**
* Writes back the content
*
* @throws PersistenceException if a persistence error occurs
*/
private void writeContent(final ResourceResolver resolver, final Map<String, RequestProperty> reqProperties, final List<Modification> changes, final VersioningConfiguration versioningConfiguration) throws PersistenceException {
final SlingPropertyValueHandler propHandler = new SlingPropertyValueHandler(dateParser, this.jcrSsupport, changes);
for (final RequestProperty prop : reqProperties.values()) {
if (prop.hasValues()) {
final Resource parent = deepGetOrCreateResource(resolver, prop.getParentPath(), reqProperties, changes, versioningConfiguration);
this.jcrSsupport.checkoutIfNecessary(parent, changes, versioningConfiguration);
// skip jcr special properties
if (prop.getName().equals(JcrConstants.JCR_PRIMARYTYPE) || prop.getName().equals(JcrConstants.JCR_MIXINTYPES)) {
continue;
}
if (prop.isFileUpload()) {
uploadHandler.setFile(parent, prop, changes);
} else {
propHandler.setProperty(parent, prop);
}
}
}
}
Aggregations