mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.1 to HEAD
14955: Merged V2.2 to V3.1 14352: Fixed ETWOTWO-1113: Creation date / modification date reset to current date during import 14956: Fix for ETHREEOH-2198 and ALFCOM-2972 - Thumbnail Service now allows creation of system managed thumbnails nodes by Consumer users or on Locked items - Explicit permission check to ensure user must at least be able to Read the original doc - Now correctly ensures that the 'modifier' properties are not updated on the original doc due to thumbnail generation git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14957 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -208,6 +208,65 @@ public class AuditableProperties
|
||||
auditModified = dateStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set all <b>cm:auditable</b> parameters as required, giving precedence to the supplied
|
||||
* property map.
|
||||
*
|
||||
* @param user the username
|
||||
* @param date the creation or modification date
|
||||
* @param properties the properties to override the user and date
|
||||
*/
|
||||
public void setAuditValues(String user, Date date, Map<QName, Serializable> properties)
|
||||
{
|
||||
String dateStr = DefaultTypeConverter.INSTANCE.convert(String.class, date);
|
||||
if (properties.containsKey(ContentModel.PROP_CREATOR))
|
||||
{
|
||||
auditCreator = DefaultTypeConverter.INSTANCE.convert(
|
||||
String.class,
|
||||
properties.get(ContentModel.PROP_CREATOR));
|
||||
}
|
||||
else if (auditCreator == null)
|
||||
{
|
||||
auditCreator = user;
|
||||
}
|
||||
if (properties.containsKey(ContentModel.PROP_MODIFIER))
|
||||
{
|
||||
auditModifier = DefaultTypeConverter.INSTANCE.convert(
|
||||
String.class,
|
||||
properties.get(ContentModel.PROP_MODIFIER));
|
||||
}
|
||||
else if (auditModifier == null)
|
||||
{
|
||||
auditModifier = user;
|
||||
}
|
||||
if (properties.containsKey(ContentModel.PROP_CREATED))
|
||||
{
|
||||
auditCreated = DefaultTypeConverter.INSTANCE.convert(
|
||||
String.class,
|
||||
properties.get(ContentModel.PROP_CREATED));
|
||||
}
|
||||
else if (auditCreated == null)
|
||||
{
|
||||
auditCreated = dateStr;
|
||||
}
|
||||
if (properties.containsKey(ContentModel.PROP_MODIFIED))
|
||||
{
|
||||
auditModified = DefaultTypeConverter.INSTANCE.convert(
|
||||
String.class,
|
||||
properties.get(ContentModel.PROP_MODIFIED));
|
||||
}
|
||||
else if (auditModified == null)
|
||||
{
|
||||
auditModified = dateStr;
|
||||
}
|
||||
if (properties.containsKey(ContentModel.PROP_ACCESSED))
|
||||
{
|
||||
auditAccessed = DefaultTypeConverter.INSTANCE.convert(
|
||||
String.class,
|
||||
properties.get(ContentModel.PROP_ACCESSED));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For persistance use
|
||||
*/
|
||||
|
Reference in New Issue
Block a user