mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Throw exception when trying to create records from different types other than cm:content
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
||||||
|
|
||||||
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.identifier.IdentifierService;
|
import org.alfresco.module.org_alfresco_module_rm.identifier.IdentifierService;
|
||||||
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
|
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
|
||||||
@@ -147,6 +148,13 @@ public class RecordsManagementContainerType extends BaseBehaviourBean
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Throw exception if the type is not cm:content
|
||||||
|
if (!ContentModel.TYPE_FOLDER.equals(childType) &&
|
||||||
|
!dictionaryService.isSubClass(childType, ContentModel.TYPE_CONTENT))
|
||||||
|
{
|
||||||
|
throw new AlfrescoRuntimeException("Record can't be created from this type.");
|
||||||
|
}
|
||||||
|
|
||||||
// We need to automatically cast the created folder to RM type if it is a plain folder
|
// We need to automatically cast the created folder to RM type if it is a plain folder
|
||||||
// This occurs if the RM folder has been created via IMap, WebDav, etc
|
// This occurs if the RM folder has been created via IMap, WebDav, etc
|
||||||
if (!nodeService.hasAspect(child, ASPECT_FILE_PLAN_COMPONENT))
|
if (!nodeService.hasAspect(child, ASPECT_FILE_PLAN_COMPONENT))
|
||||||
|
Reference in New Issue
Block a user