mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-4586 (Record can be declared a record) / RM-4587 (Folder in collaboration site can be declared a record)
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2017 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* -
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
* -
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
* -
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
* -
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
* #L%
|
||||
*/
|
||||
|
||||
package org.alfresco.module.org_alfresco_module_rm.record;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
|
||||
/**
|
||||
* Record creation exception class
|
||||
*
|
||||
* @author Tuna Aksoy
|
||||
* @since 2.6
|
||||
*/
|
||||
public class RecordCreationException extends AlfrescoRuntimeException
|
||||
{
|
||||
private static final long serialVersionUID = 1331453363788941681L;
|
||||
|
||||
public RecordCreationException(String msgId, Throwable cause)
|
||||
{
|
||||
super(msgId, cause);
|
||||
}
|
||||
|
||||
public RecordCreationException(String msgId, Object[] msgParams, Throwable cause)
|
||||
{
|
||||
super(msgId, msgParams, cause);
|
||||
}
|
||||
|
||||
public RecordCreationException(String msgId, Object[] msgParams)
|
||||
{
|
||||
super(msgId, msgParams);
|
||||
}
|
||||
|
||||
public RecordCreationException(String msgId)
|
||||
{
|
||||
super(msgId);
|
||||
}
|
||||
}
|
@@ -975,7 +975,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
||||
{
|
||||
String msg = "Cannot create record, because the default file plan cannot be determined. Make sure at least one file plan has been created.";
|
||||
LOGGER.debug(msg);
|
||||
throw new AlfrescoRuntimeException(msg);
|
||||
throw new RecordCreationException(msg);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -985,7 +985,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
||||
{
|
||||
String msg = "Cannot create record, because the provided file plan node reference is not a file plan.";
|
||||
LOGGER.debug(msg);
|
||||
throw new AlfrescoRuntimeException(msg);
|
||||
throw new RecordCreationException(msg);
|
||||
}
|
||||
|
||||
result = filePlan;
|
||||
@@ -1017,7 +1017,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
||||
{
|
||||
String msg = "Cannot create record, because " + nodeRef.toString() + " does not exist.";
|
||||
LOGGER.debug(msg);
|
||||
throw new AlfrescoRuntimeException(msg);
|
||||
throw new RecordCreationException(msg);
|
||||
}
|
||||
|
||||
// TODO eventually we should support other types .. either as record folders or as composite records
|
||||
@@ -1025,7 +1025,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
||||
{
|
||||
String msg = "Cannot create record, because " + nodeRef.toString() + " is not a supported type.";
|
||||
LOGGER.debug(msg);
|
||||
throw new AlfrescoRuntimeException(msg);
|
||||
throw new RecordCreationException(msg);
|
||||
}
|
||||
|
||||
// Do not create record if the node is already a record!
|
||||
@@ -1033,7 +1033,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
||||
{
|
||||
String msg = "Cannot create record, because " + nodeRef.toString() + " is already a record.";
|
||||
LOGGER.debug(msg);
|
||||
throw new AlfrescoRuntimeException(msg);
|
||||
throw new RecordCreationException(msg);
|
||||
}
|
||||
|
||||
// We cannot create records from working copies
|
||||
@@ -1041,7 +1041,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
||||
{
|
||||
String msg = "Can node create record, because " + nodeRef.toString() + " is a working copy.";
|
||||
LOGGER.debug(msg);
|
||||
throw new AlfrescoRuntimeException(msg);
|
||||
throw new RecordCreationException(msg);
|
||||
}
|
||||
|
||||
// Cannot create a record from a previously rejected one
|
||||
@@ -1049,7 +1049,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
||||
{
|
||||
String msg = "Cannot create record, because " + nodeRef.toString() + " has previously been rejected.";
|
||||
LOGGER.debug(msg);
|
||||
throw new AlfrescoRuntimeException(msg);
|
||||
throw new RecordCreationException(msg);
|
||||
}
|
||||
|
||||
// can't declare the record if the node is sync'ed
|
||||
@@ -1057,7 +1057,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
||||
{
|
||||
String msg = "Can't declare as record, because " + nodeRef.toString() + " is synched content.";
|
||||
LOGGER.debug(msg);
|
||||
throw new AlfrescoRuntimeException(msg);
|
||||
throw new RecordCreationException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user