Package org.alfresco.repo.domain.node
Class AuditablePropertiesEntity
java.lang.Object
org.alfresco.repo.domain.node.AuditablePropertiesEntity
- All Implemented Interfaces:
Serializable
Class holding properties associated with the cm:auditable aspect. This aspect is common enough to warrant direct inclusion on the Node entity.
- Since:
- 3.4
- Author:
- Derek Hulley
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor with all null values.Copy constructor to create an unlocked instance -
Method Summary
Modifier and TypeMethodDescriptiongetAuditableProperty(QName qname) For persistance useFor persistance useFor persistance useFor persistance useFor persistance usestatic booleanhasAuditableAspect(QName typeQName, DictionaryService dictionaryService) static booleanhasAuditableProperty(Set<QName> qnames) static booleanisAuditableProperty(QName qname) voidlock()Lock the entity against further updates to prevent accidental modificationvoidsetAuditAccessed(String auditAccessed) For persistance usevoidsetAuditCreated(String auditCreated) For persistance usevoidsetAuditCreator(String auditCreator) For persistance usevoidsetAuditModified(String auditModified) For persistance usebooleansetAuditModified(Date date, long modifiedDateToleranceMs) voidsetAuditModifier(String auditModifier) For persistance usebooleansetAuditValues(String user, Date date, boolean force, long modifiedDateToleranceMs) Set all cm:auditable parameters as required.booleansetAuditValues(String user, Date date, Map<QName, Serializable> properties) Set all cm:auditable parameters as required, giving precedence to the supplied property map.toString()
-
Constructor Details
-
AuditablePropertiesEntity
public AuditablePropertiesEntity()Default constructor with all null values. -
AuditablePropertiesEntity
Copy constructor to create an unlocked instance
-
-
Method Details
-
getAuditablePropertyQNames
- Returns:
- Returns the QNames of the cm:auditable properties
-
hasAuditableProperty
- Parameters:
qnames- the property names to check- Returns:
- Returns true if the set contains a cm:auditable property
-
isAuditableProperty
- Returns:
- Returns true if the property belongs to the cm:auditable aspect
-
hasAuditableAspect
- Parameters:
typeQName- a node type- Returns:
- true if the type given has the cm:auditable aspect by default
-
toString
-
lock
public void lock()Lock the entity against further updates to prevent accidental modification -
getAuditableProperty
- Parameters:
qname- the property name- Returns:
- Returns the value of the cm:auditable property or null
-
getAuditableProperties
- Returns:
- Returns a Map of auditable properties
-
setAuditValues
Set all cm:auditable parameters as required. Where possible, the creation and modification data will be shared so as to reduce data duplication.- Parameters:
user- the username; null to use thefully-authenticated userdate- the creation or modification date; null to use the current system timeforce- true to force the values to overwrite any pre-existing valuesmodifiedDateToleranceMs- the number of milliseconds' to tolerate before updating the modification date. Setting this to 1000L (say) will mean that the modification time will not be changed if the existing value is withing 1000 ms of the new time.- Returns:
- Returns true if there were any changes made, otherwise false
-
setAuditValues
Set all cm:auditable parameters as required, giving precedence to the supplied property map.- Parameters:
user- the usernamedate- the creation or modification dateproperties- the properties to override the user and date- Returns:
- Returns true if there were any changes made, otherwise false
-
getAuditCreator
For persistance use -
setAuditCreator
For persistance use -
getAuditCreated
For persistance use -
setAuditCreated
For persistance use -
getAuditModifier
For persistance use -
setAuditModifier
For persistance use -
getAuditModified
For persistance use -
setAuditModified
For persistance use -
setAuditModified
- Parameters:
modifiedDateToleranceMs- the number of milliseconds' to tolerate before updating the modification date. Setting this to 1000L (say) will mean that the modification time will not be changed if the existing value is withing 1000 ms of the new time.- Returns:
- Returns true if there were any changes made, otherwise false
-
getAuditAccessed
For persistance use -
setAuditAccessed
For persistance use
-