mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
RM-2045 Fix references to "document" to refer to "content".
We can use the same API to classify documents and records. +review RM-25 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@102160 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -52,18 +52,18 @@ public interface ClassificationService
|
||||
List<ClassificationReason> getClassificationReasons();
|
||||
|
||||
/**
|
||||
* Classify a document.
|
||||
* Classify a piece of content.
|
||||
*
|
||||
* @param classificationLevelId The security clearance needed to access the document.
|
||||
* @param classificationAuthority The name of the authority responsible for the classification of this document.
|
||||
* @param classificationReasonIds A non-empty set of ids of reasons for classifying the document in this way.
|
||||
* @param document The node to classify.
|
||||
* @param classificationLevelId The security clearance needed to access the content.
|
||||
* @param classificationAuthority The name of the authority responsible for the classification of this content.
|
||||
* @param classificationReasonIds A non-empty set of ids of reasons for classifying the content in this way.
|
||||
* @param content The node to classify.
|
||||
* @throws LevelIdNotFound If the supplied level id is not found.
|
||||
* @throws ReasonIdNotFound If any of the supplied reason ids are not found.
|
||||
* @throws InvalidNodeRefException If the node could not be found.
|
||||
* @throws InvalidNode If the supplied node is not a document node.
|
||||
* @throws InvalidNode If the supplied node is not a content node.
|
||||
*/
|
||||
void addClassificationToDocument(String classificationLevelId, String classificationAuthority,
|
||||
Set<String> classificationReasonIds, NodeRef document) throws LevelIdNotFound, ReasonIdNotFound,
|
||||
void classifyContent(String classificationLevelId, String classificationAuthority,
|
||||
Set<String> classificationReasonIds, NodeRef content) throws LevelIdNotFound, ReasonIdNotFound,
|
||||
InvalidNodeRefException, InvalidNode;
|
||||
}
|
||||
|
@@ -218,24 +218,24 @@ public class ClassificationServiceImpl extends ServiceBaseImpl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addClassificationToDocument(String classificationLevelId, String classificationAuthority,
|
||||
Set<String> classificationReasonIds, NodeRef document)
|
||||
public void classifyContent(String classificationLevelId, String classificationAuthority,
|
||||
Set<String> classificationReasonIds, NodeRef content)
|
||||
{
|
||||
mandatory("classificationLevelId", classificationLevelId);
|
||||
mandatory("classificationAuthority", classificationAuthority);
|
||||
mandatory("classificationReasonIds", classificationReasonIds);
|
||||
mandatory("document", document);
|
||||
mandatory("content", content);
|
||||
|
||||
if (!nodeService.getType(document).equals(ContentModel.TYPE_CONTENT))
|
||||
if (!nodeService.getType(content).equals(ContentModel.TYPE_CONTENT))
|
||||
{
|
||||
throw new InvalidNode(document, "The supplied node is not a content node.");
|
||||
throw new InvalidNode(content, "The supplied node is not a content node.");
|
||||
}
|
||||
|
||||
Map<QName, Serializable> properties = new HashMap<QName, Serializable>();
|
||||
checkClassificationLevelId(classificationLevelId);
|
||||
|
||||
// Initial classification id
|
||||
if (nodeService.getProperty(document, PROP_INITIAL_CLASSIFICATION) == null)
|
||||
if (nodeService.getProperty(content, PROP_INITIAL_CLASSIFICATION) == null)
|
||||
{
|
||||
properties.put(PROP_INITIAL_CLASSIFICATION, classificationLevelId);
|
||||
}
|
||||
@@ -256,7 +256,7 @@ public class ClassificationServiceImpl extends ServiceBaseImpl
|
||||
properties.put(PROP_CLASSIFICATION_REASONS, classificationReasons);
|
||||
|
||||
// Add aspect
|
||||
nodeService.addAspect(document, ASPECT_CLASSIFIED, properties);
|
||||
nodeService.addAspect(content, ASPECT_CLASSIFIED, properties);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -83,7 +83,7 @@ public class ClassifyContentPost extends AbstractRmWebScript
|
||||
Set<String> classificationReasonIds = getClassificationReasonIds(jsonObject);
|
||||
NodeRef document = parseRequestForNodeRef(req);
|
||||
|
||||
getClassificationService().addClassificationToDocument(classificationLevelId, classificationAuthority, classificationReasonIds, document);
|
||||
getClassificationService().classifyContent(classificationLevelId, classificationAuthority, classificationReasonIds, document);
|
||||
|
||||
Map<String, Object> model = new HashMap<String, Object>(1);
|
||||
model.put(SUCCESS, true);
|
||||
|
Reference in New Issue
Block a user