mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-4247 Merge master into RM-4247_UpdateDispositionProperty.
This commit is contained in:
@@ -274,4 +274,12 @@ public interface DispositionService
|
||||
* @return the initial disposition
|
||||
*/
|
||||
DispositionSchedule getOriginDispositionSchedule(NodeRef nodeRef);
|
||||
|
||||
/**
|
||||
* Updates disposition action step when linking or unlinking
|
||||
* the given record to/from a record folder
|
||||
*
|
||||
* @param record
|
||||
*/
|
||||
void recalculateNextDispositionStep(NodeRef record);
|
||||
}
|
||||
|
@@ -1105,6 +1105,32 @@ public class DispositionServiceImpl extends ServiceBaseImpl
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void recalculateNextDispositionStep(NodeRef record)
|
||||
{
|
||||
List<NodeRef> recordFolders = recordFolderService.getRecordFolders(record);
|
||||
|
||||
DispositionAction nextDispositionAction = getNextDispositionAction(record);
|
||||
|
||||
if (nextDispositionAction != null)
|
||||
{
|
||||
NextActionFromDisposition dsNextAction = getNextDispositionAction(record, recordFolders, nextDispositionAction);
|
||||
if (dsNextAction != null)
|
||||
{
|
||||
final NodeRef action = dsNextAction.getNextActionNodeRef();
|
||||
final Date dispositionActionDate = dsNextAction.getNextActionDateAsOf();
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void doWork()
|
||||
{
|
||||
nodeService.setProperty(action, PROP_DISPOSITION_AS_OF, dispositionActionDate);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to determine if a node is frozen or has frozen children
|
||||
|
@@ -28,10 +28,15 @@
|
||||
package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
|
||||
import org.alfresco.module.org_alfresco_module_rm.search.RecordsManagementSearchService;
|
||||
@@ -55,6 +60,8 @@ import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.alfresco.util.PropertyMap;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
/**
|
||||
* Behaviour associated with the RM Site type
|
||||
*
|
||||
@@ -68,12 +75,14 @@ import org.alfresco.util.PropertyMap;
|
||||
public class RmSiteType extends BaseBehaviourBean
|
||||
implements NodeServicePolicies.OnCreateNodePolicy,
|
||||
NodeServicePolicies.OnUpdatePropertiesPolicy,
|
||||
NodeServicePolicies.BeforeDeleteNodePolicy
|
||||
NodeServicePolicies.BeforeDeleteNodePolicy,
|
||||
NodeServicePolicies.OnCreateChildAssociationPolicy
|
||||
{
|
||||
/** Constant values */
|
||||
public static final String COMPONENT_DOCUMENT_LIBRARY = "documentLibrary";
|
||||
public static final String DEFAULT_SITE_NAME = "rm";
|
||||
public static final QName DEFAULT_FILE_PLAN_TYPE = TYPE_FILE_PLAN;
|
||||
private final static List<QName> ACCEPTED_NON_UNIQUE_CHILD_TYPES = Arrays.asList(ContentModel.TYPE_FOLDER);
|
||||
|
||||
/** Site service */
|
||||
protected SiteService siteService;
|
||||
@@ -295,4 +304,53 @@ public class RmSiteType extends BaseBehaviourBean
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the limitation of creating only one rma:filePlan or one dod:filePlan depending on the type of rm site.
|
||||
* Also added the limitation of crating two cm:folder type under rm site.
|
||||
*
|
||||
* Other than this nothing can be created under rm site nodeRef
|
||||
*
|
||||
* @author Silviu Dinuta
|
||||
* @since 2.6
|
||||
*/
|
||||
@Override
|
||||
@Behaviour(kind = BehaviourKind.ASSOCIATION)
|
||||
public void onCreateChildAssociation(final ChildAssociationRef childAssocRef, boolean isNewNode)
|
||||
{
|
||||
AuthenticationUtil.runAsSystem(new RunAsWork<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void doWork()
|
||||
{
|
||||
final NodeRef child = childAssocRef.getChildRef();
|
||||
final NodeRef parent = childAssocRef.getParentRef();
|
||||
List<QName> acceptedUniqueChildTypes = new ArrayList<QName>();
|
||||
SiteInfo siteInfo = siteService.getSite(parent);
|
||||
acceptedUniqueChildTypes.add(getFilePlanType(siteInfo));
|
||||
// check the created child is of an accepted type
|
||||
validateNewChildAssociation(parent, child, acceptedUniqueChildTypes, ACCEPTED_NON_UNIQUE_CHILD_TYPES);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Overridden this because in this case we need to have multiple cm:folder types but not more than two of them.
|
||||
* The two mentioned folders are created when rm site is created and one of them is Saved Searches and the other surf-config folder.
|
||||
After that creation of cm:folder should not be allowed under rm site node
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
protected void validateNewChildAssociation(NodeRef parent, NodeRef child, List<QName> acceptedUniqueChildType,
|
||||
List<QName> acceptedMultipleChildType) throws InvalidParameterException
|
||||
{
|
||||
super.validateNewChildAssociation(parent, child, acceptedUniqueChildType, acceptedMultipleChildType);
|
||||
|
||||
// check the user is not trying to create more than 2 folders that are created by default.
|
||||
if(nodeService.getChildAssocs(parent, Sets.newHashSet(ContentModel.TYPE_FOLDER)).size() > 2)
|
||||
{
|
||||
throw new InvalidParameterException("Operation failed. Children of type " + ContentModel.TYPE_FOLDER + " are not allowed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -26,8 +26,7 @@
|
||||
*/
|
||||
package org.alfresco.module.org_alfresco_module_rm.model.rma.type;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.security.InvalidParameterException;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
@@ -38,7 +37,6 @@ import org.alfresco.repo.policy.annotation.BehaviourBean;
|
||||
import org.alfresco.repo.policy.annotation.BehaviourKind;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
@@ -52,20 +50,41 @@ public class TransferContainerType extends BaseBehaviourBean
|
||||
implements NodeServicePolicies.OnCreateChildAssociationPolicy, NodeServicePolicies.OnCreateNodePolicy
|
||||
{
|
||||
private final static String MSG_ERROR_ADD_CONTENT_CONTAINER = "rm.service.error-add-content-container";
|
||||
private final static List<QName> ACCEPTED_NON_UNIQUE_CHILD_TYPES = Arrays.asList(TYPE_TRANSFER);
|
||||
private static final String BEHAVIOUR_NAME = "onCreateChildAssocsForTransferContainer";
|
||||
|
||||
/**
|
||||
* On every event
|
||||
* Disable the behaviours for this transaction
|
||||
*
|
||||
*/
|
||||
public void disable()
|
||||
{
|
||||
getBehaviour(BEHAVIOUR_NAME).disable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable behaviours for this transaction
|
||||
*
|
||||
*/
|
||||
public void enable()
|
||||
{
|
||||
getBehaviour(BEHAVIOUR_NAME).enable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent creating a node inside transfer container, this will be possible only through internal services in a controlled manner.
|
||||
*
|
||||
* @see org.alfresco.repo.node.NodeServicePolicies.OnCreateChildAssociationPolicy#onCreateChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef,
|
||||
* boolean)
|
||||
*/
|
||||
@Override
|
||||
@Behaviour(kind = BehaviourKind.ASSOCIATION)
|
||||
@Behaviour
|
||||
(
|
||||
kind = BehaviourKind.ASSOCIATION,
|
||||
name = BEHAVIOUR_NAME
|
||||
)
|
||||
public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean bNew)
|
||||
{
|
||||
// check the created child is of an accepted type
|
||||
validateNewChildAssociationSubTypesIncluded(childAssocRef.getChildRef(), ACCEPTED_NON_UNIQUE_CHILD_TYPES);
|
||||
throw new InvalidParameterException("Operation failed. Creation is not allowed in Transfer Container");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 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.model.rma.type;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
|
||||
import org.alfresco.repo.node.NodeServicePolicies;
|
||||
import org.alfresco.repo.policy.annotation.Behaviour;
|
||||
import org.alfresco.repo.policy.annotation.BehaviourBean;
|
||||
import org.alfresco.repo.policy.annotation.BehaviourKind;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
|
||||
/**
|
||||
* rma:transfer behaviour bean
|
||||
*
|
||||
* @author Silviu Dinuta
|
||||
* @since 2.6
|
||||
*/
|
||||
@BehaviourBean(defaultType = "rma:transfer")
|
||||
public class TransferType extends BaseBehaviourBean implements NodeServicePolicies.OnCreateChildAssociationPolicy
|
||||
{
|
||||
private static final String BEHAVIOUR_NAME = "onCreateChildAssocsForTransferType";
|
||||
|
||||
/**
|
||||
* Disable the behaviours for this transaction
|
||||
*
|
||||
*/
|
||||
public void disable()
|
||||
{
|
||||
getBehaviour(BEHAVIOUR_NAME).disable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable behaviours for this transaction
|
||||
*
|
||||
*/
|
||||
public void enable()
|
||||
{
|
||||
getBehaviour(BEHAVIOUR_NAME).enable();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent creating a node inside transfer folder, this will be possible only through internal services in a controlled manner.
|
||||
*/
|
||||
@Override
|
||||
@Behaviour
|
||||
(
|
||||
kind = BehaviourKind.ASSOCIATION,
|
||||
name = BEHAVIOUR_NAME
|
||||
)
|
||||
public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean isNewNode)
|
||||
{
|
||||
throw new InvalidParameterException("Operation failed. Creation is not allowed in Transfer Folders");
|
||||
}
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* #%L
|
||||
* Alfresco Records Management Module
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2016 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.model.rma.type;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.BaseBehaviourBean;
|
||||
import org.alfresco.repo.node.NodeServicePolicies;
|
||||
import org.alfresco.repo.policy.annotation.Behaviour;
|
||||
import org.alfresco.repo.policy.annotation.BehaviourBean;
|
||||
import org.alfresco.repo.policy.annotation.BehaviourKind;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* rma:unfiledRecordFolder behaviour bean
|
||||
*
|
||||
* @author Silviu Dinuta
|
||||
* @since 2.6
|
||||
*/
|
||||
@BehaviourBean(defaultType = "rma:unfiledRecordFolder")
|
||||
public class UnfiledRecordFolderType extends BaseBehaviourBean
|
||||
implements NodeServicePolicies.OnCreateChildAssociationPolicy
|
||||
{
|
||||
private final static List<QName> ACCEPTED_NON_UNIQUE_CHILD_TYPES = Arrays.asList(TYPE_UNFILED_RECORD_FOLDER, ContentModel.TYPE_CONTENT, TYPE_NON_ELECTRONIC_DOCUMENT);
|
||||
|
||||
@Override
|
||||
@Behaviour(kind = BehaviourKind.ASSOCIATION)
|
||||
public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean isNewNode)
|
||||
{
|
||||
// check the created child is of an accepted type
|
||||
validateNewChildAssociationSubTypesIncluded(childAssocRef.getChildRef(), ACCEPTED_NON_UNIQUE_CHILD_TYPES);
|
||||
}
|
||||
}
|
@@ -45,14 +45,12 @@ import java.util.Set;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementServiceRegistry;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementPolicies.BeforeFileRecord;
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementPolicies.OnFileRecord;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.Capability;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.CapabilityService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.capability.RMPermissionModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionScheduleImpl;
|
||||
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model;
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
@@ -560,6 +558,8 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
||||
|
||||
// create and file the content as a record
|
||||
file(nodeRef);
|
||||
// recalculate disposition schedule for the record when linking it
|
||||
dispositionService.recalculateNextDispositionStep(nodeRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1716,7 +1716,7 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
||||
// ensure we are linking a record to a record folder
|
||||
if(isRecord(record) && isRecordFolder(recordFolder))
|
||||
{
|
||||
// ensure that we are not linking a record to an exisiting location
|
||||
// ensure that we are not linking a record to an existing location
|
||||
List<ChildAssociationRef> parents = nodeService.getParentAssocs(record);
|
||||
for (ChildAssociationRef parent : parents)
|
||||
{
|
||||
@@ -1739,6 +1739,9 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
||||
record,
|
||||
ContentModel.ASSOC_CONTAINS,
|
||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, name));
|
||||
|
||||
// recalculate disposition schedule for the record when linking it
|
||||
dispositionService.recalculateNextDispositionStep(record);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1795,6 +1798,9 @@ public class RecordServiceImpl extends BaseBehaviourBean
|
||||
|
||||
// remove the link
|
||||
nodeService.removeChild(recordFolder, record);
|
||||
|
||||
// recalculate disposition schedule for record after unlinking it
|
||||
dispositionService.recalculateNextDispositionStep(record);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -41,6 +41,8 @@ import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService
|
||||
import org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.freeze.FreezeService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.rma.type.TransferContainerType;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.rma.type.TransferType;
|
||||
import org.alfresco.module.org_alfresco_module_rm.record.RecordService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.recordfolder.RecordFolderService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.util.ServiceBaseImpl;
|
||||
@@ -87,6 +89,10 @@ public class TransferServiceImpl extends ServiceBaseImpl
|
||||
/** Freeze Service */
|
||||
protected FreezeService freezeService;
|
||||
|
||||
protected TransferContainerType transferContainerType;
|
||||
|
||||
protected TransferType transferType;
|
||||
|
||||
/**
|
||||
* @param filePlanService file plan service
|
||||
*/
|
||||
@@ -127,6 +133,16 @@ public class TransferServiceImpl extends ServiceBaseImpl
|
||||
this.freezeService = freezeService;
|
||||
}
|
||||
|
||||
public void setTransferContainerType(TransferContainerType transferContainerType)
|
||||
{
|
||||
this.transferContainerType = transferContainerType;
|
||||
}
|
||||
|
||||
public void setTransferType(TransferType transferType)
|
||||
{
|
||||
this.transferType = transferType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.module.org_alfresco_module_rm.transfer.TransferService#transfer(NodeRef, boolean)
|
||||
*/
|
||||
@@ -164,12 +180,21 @@ public class TransferServiceImpl extends ServiceBaseImpl
|
||||
}
|
||||
|
||||
NodeRef transferContainer = filePlanService.getTransferContainer(root);
|
||||
transferNodeRef = nodeService.createNode(transferContainer,
|
||||
ContentModel.ASSOC_CONTAINS,
|
||||
QName.createQName(RM_URI, transferName),
|
||||
TYPE_TRANSFER,
|
||||
transferProps).getChildRef();
|
||||
|
||||
transferContainerType.disable();
|
||||
try
|
||||
{
|
||||
transferNodeRef = nodeService.createNode(transferContainer,
|
||||
ContentModel.ASSOC_CONTAINS,
|
||||
QName.createQName(RM_URI, transferName),
|
||||
TYPE_TRANSFER,
|
||||
transferProps).getChildRef();
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
transferContainerType.enable();
|
||||
}
|
||||
// Bind the hold node reference to the transaction
|
||||
AlfrescoTransactionSupport.bindResource(KEY_TRANSFER_NODEREF, transferNodeRef);
|
||||
}
|
||||
@@ -188,10 +213,18 @@ public class TransferServiceImpl extends ServiceBaseImpl
|
||||
}
|
||||
|
||||
// Link the record to the trasnfer object
|
||||
nodeService.addChild(transferNodeRef,
|
||||
nodeRef,
|
||||
ASSOC_TRANSFERRED,
|
||||
ASSOC_TRANSFERRED);
|
||||
transferType.disable();
|
||||
try
|
||||
{
|
||||
nodeService.addChild(transferNodeRef,
|
||||
nodeRef,
|
||||
ASSOC_TRANSFERRED,
|
||||
ASSOC_TRANSFERRED);
|
||||
}
|
||||
finally
|
||||
{
|
||||
transferType.enable();
|
||||
}
|
||||
|
||||
// Set PDF indicator flag
|
||||
setPDFIndicationFlag(transferNodeRef, nodeRef);
|
||||
@@ -253,12 +286,12 @@ public class TransferServiceImpl extends ServiceBaseImpl
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Could not complete a transfer that contains held folders");
|
||||
}
|
||||
|
||||
|
||||
if(freezeService.hasFrozenChildren(assoc.getChildRef()))
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Cound not complete a transfer that contains folders with held children");
|
||||
}
|
||||
|
||||
|
||||
markComplete(assoc.getChildRef(), accessionIndicator, transferLocation);
|
||||
}
|
||||
|
||||
|
@@ -45,12 +45,4 @@ public interface RMNodes extends Nodes
|
||||
public static String PARAM_INCLUDE_HAS_RETENTION_SCHEDULE = "hasRetentionSchedule";
|
||||
public static String PARAM_INCLUDE_IS_CLOSED = "isClosed";
|
||||
public static String PARAM_INCLUDE_IS_COMPLETED = "isCompleted";
|
||||
|
||||
/**
|
||||
* Identifies if one node is RM site node.
|
||||
*
|
||||
* @param nodeId
|
||||
* @return
|
||||
*/
|
||||
boolean isRMSite(String nodeId);
|
||||
}
|
||||
|
@@ -59,8 +59,6 @@ import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.site.SiteInfo;
|
||||
import org.alfresco.service.cmr.site.SiteService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.Pair;
|
||||
@@ -86,7 +84,6 @@ public class RMNodesImpl extends NodesImpl implements RMNodes
|
||||
private Repository repositoryHelper;
|
||||
private DictionaryService dictionaryService;
|
||||
private DispositionService dispositionService;
|
||||
private SiteService siteService;
|
||||
|
||||
/**
|
||||
* TODO to remove this after isSpecialNode is made protected in core implementation(REPO-1459)
|
||||
@@ -98,7 +95,6 @@ public class RMNodesImpl extends NodesImpl implements RMNodes
|
||||
this.nodeService = serviceRegistry.getNodeService();
|
||||
this.dictionaryService = serviceRegistry.getDictionaryService();
|
||||
this.dispositionService = serviceRegistry.getDispositionService();
|
||||
this.siteService = serviceRegistry.getSiteService();
|
||||
}
|
||||
|
||||
public void setRecordsManagementServiceRegistry(RecordsManagementServiceRegistry serviceRegistry)
|
||||
@@ -402,21 +398,4 @@ public class RMNodesImpl extends NodesImpl implements RMNodes
|
||||
}
|
||||
super.deleteNode(nodeId, parameters);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRMSite(String nodeId)
|
||||
{
|
||||
NodeRef nodeRef = validateOrLookupNode(nodeId, null);
|
||||
|
||||
SiteInfo siteInfo = siteService.getSite(FilePlanService.DEFAULT_RM_SITE_ID);
|
||||
if(siteInfo !=null)
|
||||
{
|
||||
NodeRef rmNodeRef = siteInfo.getNodeRef();
|
||||
if(rmNodeRef.equals(nodeRef))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.rest.api.model.Node;
|
||||
import org.alfresco.rest.framework.core.exceptions.PermissionDeniedException;
|
||||
import org.alfresco.rest.framework.resource.RelationshipResource;
|
||||
import org.alfresco.rest.framework.resource.actions.interfaces.MultiPartRelationshipResourceAction;
|
||||
import org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction;
|
||||
@@ -68,10 +67,6 @@ public class FileplanComponentChildrenRelation implements RelationshipResourceAc
|
||||
@Override
|
||||
public List<Node> create(String parentFolderNodeId, List<Node> nodeInfos, Parameters parameters)
|
||||
{
|
||||
if(nodes.isRMSite(parentFolderNodeId))
|
||||
{
|
||||
throw new PermissionDeniedException("POST request not allowed in RM site.");
|
||||
}
|
||||
List<Node> result = new ArrayList<>(nodeInfos.size());
|
||||
|
||||
for (Node nodeInfo : nodeInfos)
|
||||
@@ -85,10 +80,6 @@ public class FileplanComponentChildrenRelation implements RelationshipResourceAc
|
||||
@Override
|
||||
public Node create(String parentFolderNodeId, FormData formData, Parameters parameters, WithResponse withResponse)
|
||||
{
|
||||
if(nodes.isRMSite(parentFolderNodeId))
|
||||
{
|
||||
throw new PermissionDeniedException("POST request not allowed in RM site.");
|
||||
}
|
||||
return nodes.upload(parentFolderNodeId, formData, parameters);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user