RM-4418 - added comments and localization

This commit is contained in:
Ana Bozianu
2016-12-16 14:27:01 +02:00
parent 9701b0020f
commit ede1386710
2 changed files with 9 additions and 3 deletions

View File

@@ -20,4 +20,5 @@ rm.service.node-has-aspect=The record type {1} is already showing for record {0}
rm.service.final-version=Final
rm.service.final-version-description=The final archived record version
rm.service.enable-autoversion-on-record-creation=Auto Version on Record Creation
rm.service.add-children-to-closed-record-folder=You can't add new items to a closed record folder
rm.service.add-children-to-closed-record-folder=You can't add new items to a closed record folder
rm.service.update-record-content=Could not update content property as it's immutable for records.

View File

@@ -54,6 +54,7 @@ import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.ScriptService;
import org.alfresco.service.namespace.QName;
import org.springframework.extensions.surf.util.I18NUtil;
/**
* rma:record behaviour bean
@@ -85,7 +86,10 @@ public class RecordAspect extends AbstractDisposableItem
/** record service */
protected RecordService recordService;
/** I18N */
private static final String MSG_CANNOT_UPDATE_RECORD_CONTENT = "rm.service.update-record-content";
/**
* @param extendedSecurityService extended security service
*/
@@ -349,9 +353,10 @@ public class RecordAspect extends AbstractDisposableItem
)
public void onContentPropertyUpdate(NodeRef nodeRef, QName propertyQName, ContentData beforeValue, ContentData afterValue)
{
// Allow creation of content but not update
if (beforeValue != null)
{
throw new IntegrityException("Content property cannot be updated for records", null);
throw new IntegrityException(I18NUtil.getMessage(MSG_CANNOT_UPDATE_RECORD_CONTENT), null);
}
}
}