From c0c0c225c0e13a25bf144e682781b259e665f4be Mon Sep 17 00:00:00 2001 From: Roxana Lucanu-Ghetu Date: Fri, 17 Jun 2016 12:05:19 +0300 Subject: [PATCH] Created a property for AlfrescoRuntimeException instead ot the message. --- .../messages/action-service.properties | 3 ++- .../model/rma/type/RecordFolderType.java | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/action-service.properties b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/action-service.properties index 5c6a7d4daf..dbb53e0559 100644 --- a/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/action-service.properties +++ b/rm-community/rm-community-repo/config/alfresco/module/org_alfresco_module_rm/messages/action-service.properties @@ -36,4 +36,5 @@ rm.action.records_only_undeclared=Only records can be completed. rm.action.event-not-undone=The event {0} can't be undone, because it's not defined on the disposition lifecycle. rm.action.node-not-record-category=The disposition schedule could not be created, because the actioned upon node ({0}) was not a record category. rm.action.parameter-not-supplied=The parameter ''{0}'' has not been supplied. -rm.action.delete-not-hold-type=The hold couldn't be deleted, because the node isn't of type {0}. (actionedUponNodeRef={1}) \ No newline at end of file +rm.action.delete-not-hold-type=The hold couldn't be deleted, because the node isn't of type {0}. (actionedUponNodeRef={1}) +rm.action.record-folder-create=Operation failed, because you can't place a record folder into another record folder. diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordFolderType.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordFolderType.java index 7d2aff1e47..5974c922a6 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordFolderType.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordFolderType.java @@ -50,6 +50,7 @@ import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName; import org.apache.commons.lang.ArrayUtils; +import org.springframework.extensions.surf.util.I18NUtil; /** * rma:recordFolder behaviour bean @@ -74,6 +75,9 @@ public class RecordFolderType extends AbstractDisposableItem /** vital record service */ protected VitalRecordService vitalRecordService; + /** I18N */ + private static final String MSG_CANNOT_CREATE_RECORD_FOLDER = "rm.action.record-folder-create"; + /** * @param recordService record service */ @@ -243,7 +247,7 @@ public class RecordFolderType extends AbstractDisposableItem // only records can be added in a record folder or hidden folders(is the case of e-mail attachments) if (!instanceOf(recordFolder, ContentModel.TYPE_CONTENT) && !nodeService.hasAspect(recordFolder, ContentModel.ASPECT_HIDDEN)) { - throw new AlfrescoRuntimeException("Operation failed, because you can only place content into a record folder."); + throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_CANNOT_CREATE_RECORD_FOLDER)); } behaviourFilter.disableBehaviour();