mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-4418 - added comments and localization
This commit is contained in:
@@ -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=Final
|
||||||
rm.service.final-version-description=The final archived record version
|
rm.service.final-version-description=The final archived record version
|
||||||
rm.service.enable-autoversion-on-record-creation=Auto Version on Record Creation
|
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.
|
@@ -54,6 +54,7 @@ import org.alfresco.service.cmr.repository.ContentData;
|
|||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.ScriptService;
|
import org.alfresco.service.cmr.repository.ScriptService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
|
import org.springframework.extensions.surf.util.I18NUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rma:record behaviour bean
|
* rma:record behaviour bean
|
||||||
@@ -85,7 +86,10 @@ public class RecordAspect extends AbstractDisposableItem
|
|||||||
|
|
||||||
/** record service */
|
/** record service */
|
||||||
protected RecordService recordService;
|
protected RecordService recordService;
|
||||||
|
|
||||||
|
/** I18N */
|
||||||
|
private static final String MSG_CANNOT_UPDATE_RECORD_CONTENT = "rm.service.update-record-content";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param extendedSecurityService extended security service
|
* @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)
|
public void onContentPropertyUpdate(NodeRef nodeRef, QName propertyQName, ContentData beforeValue, ContentData afterValue)
|
||||||
{
|
{
|
||||||
|
// Allow creation of content but not update
|
||||||
if (beforeValue != null)
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user