mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-2401, RM-2400, RM-2409 Store classification schedule properties.
Update Java API to store the classification schedule properties. Fix the classification aspect behaviour to check newly classified documents. Add an application context test that the downgrade instructions are mandatory when the downgrade date is set. +review RM git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@109015 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -19,8 +19,11 @@
|
||||
package org.alfresco.module.org_alfresco_module_rm.classification;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
/**
|
||||
* A data transfer object for properties from the classification aspect.
|
||||
*
|
||||
@@ -36,7 +39,7 @@ public class ClassificationAspectProperties
|
||||
/** The name of the agency responsible for the classification of this content. */
|
||||
private String classificationAgency;
|
||||
/** A non-empty set of ids of reasons for classifying the content in this way. */
|
||||
private Set<String> classificationReasonIds;
|
||||
private Set<String> classificationReasonIds = new HashSet<>();
|
||||
/** If provided, this is the date of the next downgrade evaluation. */
|
||||
private Date downgradeDate;
|
||||
/** If provided, this is the event at which the next downgrade evaluation will take place. */
|
||||
@@ -47,8 +50,8 @@ public class ClassificationAspectProperties
|
||||
private Date declassificationDate;
|
||||
/** If provided, this is the event at which the next declassification evaluation will take place. */
|
||||
private String declassificationEvent;
|
||||
/** This is an optional list of exemption category ids. */
|
||||
private Set<String> exemptionCategoryIds;
|
||||
/** An optional list of exemption category ids. */
|
||||
private Set<String> exemptionCategoryIds = new HashSet<>();
|
||||
|
||||
/** @return The security clearance needed to access the content. */
|
||||
public String getClassificationLevelId()
|
||||
@@ -85,10 +88,14 @@ public class ClassificationAspectProperties
|
||||
{
|
||||
return classificationReasonIds;
|
||||
}
|
||||
/** @param classificationReasonIds A non-empty set of ids of reasons for classifying the content in this way. */
|
||||
/**
|
||||
* Store an immutable copy of the given set of classification reason ids.
|
||||
*
|
||||
* @param classificationReasonIds A non-empty set of ids of reasons for classifying the content in this way.
|
||||
*/
|
||||
public void setClassificationReasonIds(Set<String> classificationReasonIds)
|
||||
{
|
||||
this.classificationReasonIds = classificationReasonIds;
|
||||
this.classificationReasonIds = ImmutableSet.copyOf(classificationReasonIds);
|
||||
}
|
||||
/** @return If provided, this is the date of the next downgrade evaluation. */
|
||||
public Date getDowngradeDate()
|
||||
@@ -145,9 +152,13 @@ public class ClassificationAspectProperties
|
||||
{
|
||||
return exemptionCategoryIds;
|
||||
}
|
||||
/** @param exemptionCategoryIds This is an optional list of exemption category ids. */
|
||||
/**
|
||||
* Store an immutable copy of the given set of exemption category ids.
|
||||
*
|
||||
* @param exemptionCategoryIds This is an optional list of exemption category ids.
|
||||
*/
|
||||
public void setExemptionCategoryIds(Set<String> exemptionCategoryIds)
|
||||
{
|
||||
this.exemptionCategoryIds = exemptionCategoryIds;
|
||||
this.exemptionCategoryIds = ImmutableSet.copyOf(exemptionCategoryIds);
|
||||
}
|
||||
}
|
||||
|
@@ -177,6 +177,15 @@ public class ContentClassificationServiceImpl extends ServiceBaseImpl
|
||||
HashSet<String> classificationReasons = new HashSet<>(propertiesDTO.getClassificationReasonIds());
|
||||
propertiesMap.put(PROP_CLASSIFICATION_REASONS, classificationReasons);
|
||||
|
||||
propertiesMap.put(PROP_DOWNGRADE_DATE, propertiesDTO.getDowngradeDate());
|
||||
propertiesMap.put(PROP_DOWNGRADE_EVENT, propertiesDTO.getDowngradeEvent());
|
||||
propertiesMap.put(PROP_DOWNGRADE_INSTRUCTIONS, propertiesDTO.getDowngradeInstructions());
|
||||
propertiesMap.put(PROP_DECLASSIFICATION_DATE, propertiesDTO.getDeclassificationDate());
|
||||
propertiesMap.put(PROP_DECLASSIFICATION_EVENT, propertiesDTO.getDeclassificationEvent());
|
||||
|
||||
HashSet<String> declassificationExemptions = new HashSet<>(propertiesDTO.getExemptionCategoryIds());
|
||||
propertiesMap.put(PROP_DECLASSIFICATION_EXEMPTIONS, declassificationExemptions);
|
||||
|
||||
return propertiesMap;
|
||||
}
|
||||
|
||||
|
@@ -115,6 +115,11 @@ public class ClassifiedAspect extends BaseBehaviourBean implements NodeServicePo
|
||||
* Validates the consistency of the properties.
|
||||
*/
|
||||
@Override
|
||||
@Behaviour
|
||||
(
|
||||
kind = BehaviourKind.CLASS,
|
||||
notificationFrequency = NotificationFrequency.EVERY_EVENT
|
||||
)
|
||||
public void onAddAspect(final NodeRef nodeRef, final QName aspectTypeQName)
|
||||
{
|
||||
AuthenticationUtil.runAs(new RunAsWork<Void>()
|
||||
|
Reference in New Issue
Block a user