From f11454f4877692a8d2ce7dfba6e158d881bbc2e9 Mon Sep 17 00:00:00 2001 From: Tuna Aksoy Date: Mon, 18 May 2015 21:22:17 +0000 Subject: [PATCH] RM-2204 (Hover over classification reason id on properties page reveals nothing) +review RM @rwetherall git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@104476 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../forms/RecordsManagementNodeFormFilter.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/forms/RecordsManagementNodeFormFilter.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/forms/RecordsManagementNodeFormFilter.java index 3e037a690e..ddc411c2f6 100644 --- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/forms/RecordsManagementNodeFormFilter.java +++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/forms/RecordsManagementNodeFormFilter.java @@ -22,6 +22,7 @@ import static org.alfresco.repo.security.authentication.AuthenticationUtil.runAs import static org.apache.commons.lang.StringUtils.isNotBlank; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; @@ -76,6 +77,7 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter protected static final String TRANSIENT_DISPOSITION_INSTRUCTIONS = "rmDispositionInstructions"; protected static final String TRANSIENT_CURRENT_CLASSIFICATION = "clfCurrentClassification"; protected static final String TRANSIENT_INITIAL_CLASSIFICATION = "clfInitialClassification"; + protected static final String TRANSIENT_CLASSIFICATION_REASON_LABELS = "clfClassificationReasonLabels"; /** Disposition service */ private DispositionService dispositionService; @@ -215,6 +217,21 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter String currentClassificationDisplayLabel = getClassificationService().getClassificationLevelById(currentClassificationId).getDisplayLabel(); addTransientPropertyField(form, TRANSIENT_CURRENT_CLASSIFICATION, DataTypeDefinition.TEXT, currentClassificationDisplayLabel); } + + @SuppressWarnings("unchecked") + List classificationReasons = (List) nodeService.getProperty(nodeRef, ClassifiedContentModel.PROP_CLASSIFICATION_REASONS); + if (classificationReasons != null && !classificationReasons.isEmpty()) + { + List classificationReasonLabels = new ArrayList<>(); + int size = classificationReasons.size(); + for (int i = 0; i < size; i++) + { + String id = classificationReasons.get(i); + String displayLabel = getClassificationService().getClassificationReasonById(id).getDisplayLabel(); + classificationReasonLabels.add(id + ": " + displayLabel + (i < size - 1 ? "|": "")); + } + addTransientPropertyField(form, TRANSIENT_CLASSIFICATION_REASON_LABELS, DataTypeDefinition.TEXT, classificationReasonLabels); + } } }