mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge branch 'release/V2.4' of gitlab.alfresco.com:records-management/records-management into RM-2969_UpdateLicenseHeaders
This commit is contained in:
@@ -791,6 +791,7 @@
|
|||||||
<property name="filePlanService" ref="FilePlanService" />
|
<property name="filePlanService" ref="FilePlanService" />
|
||||||
<property name="publicAction" value="true"/>
|
<property name="publicAction" value="true"/>
|
||||||
<property name="allowParameterSubstitutions" value="true"/>
|
<property name="allowParameterSubstitutions" value="true"/>
|
||||||
|
<property name="retryingTransactionHelper" ref="retryingTransactionHelper" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- Move To -->
|
<!-- Move To -->
|
||||||
@@ -819,6 +820,7 @@
|
|||||||
<property name="filePlanService" ref="FilePlanService" />
|
<property name="filePlanService" ref="FilePlanService" />
|
||||||
<property name="publicAction" value="true"/>
|
<property name="publicAction" value="true"/>
|
||||||
<property name="allowParameterSubstitutions" value="true"/>
|
<property name="allowParameterSubstitutions" value="true"/>
|
||||||
|
<property name="retryingTransactionHelper" ref="retryingTransactionHelper" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- Link Record -->
|
<!-- Link Record -->
|
||||||
@@ -847,6 +849,7 @@
|
|||||||
<property name="filePlanService" ref="FilePlanService" />
|
<property name="filePlanService" ref="FilePlanService" />
|
||||||
<property name="publicAction" value="true"/>
|
<property name="publicAction" value="true"/>
|
||||||
<property name="allowParameterSubstitutions" value="true"/>
|
<property name="allowParameterSubstitutions" value="true"/>
|
||||||
|
<property name="retryingTransactionHelper" ref="retryingTransactionHelper" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<!-- Unlink Record -->
|
<!-- Unlink Record -->
|
||||||
|
@@ -138,7 +138,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
|||||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected synchronized void executeImpl(final Action action, final NodeRef actionedUponNodeRef)
|
protected synchronized void executeImpl(Action action, final NodeRef actionedUponNodeRef)
|
||||||
{
|
{
|
||||||
String actionName = action.getActionDefinitionName();
|
String actionName = action.getActionDefinitionName();
|
||||||
if (isOkToProceedWithAction(actionedUponNodeRef, actionName))
|
if (isOkToProceedWithAction(actionedUponNodeRef, actionName))
|
||||||
@@ -161,24 +161,7 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
|||||||
if (recordFolder == null)
|
if (recordFolder == null)
|
||||||
{
|
{
|
||||||
final boolean finaltargetIsUnfiledRecords = targetIsUnfiledRecords;
|
final boolean finaltargetIsUnfiledRecords = targetIsUnfiledRecords;
|
||||||
recordFolder = retryingTransactionHelper.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<NodeRef>()
|
recordFolder = createOrResolvePath(action, actionedUponNodeRef, finaltargetIsUnfiledRecords);
|
||||||
{
|
|
||||||
public NodeRef execute() throws Throwable
|
|
||||||
{
|
|
||||||
NodeRef result = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// get the reference to the record folder based on the relative path
|
|
||||||
result = createOrResolvePath(action, actionedUponNodeRef, finaltargetIsUnfiledRecords);
|
|
||||||
}
|
|
||||||
catch (DuplicateChildNodeNameException ex)
|
|
||||||
{
|
|
||||||
throw new ConcurrencyFailureException("Cannot create or resolve path.", ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}, false, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// now we have the reference to the target folder we can do some final checks to see if the action is valid
|
// now we have the reference to the target folder we can do some final checks to see if the action is valid
|
||||||
@@ -304,23 +287,39 @@ public abstract class CopyMoveLinkFileToBaseAction extends RMActionExecuterAbstr
|
|||||||
* @param targetisUnfiledRecords true is the target is in unfiled records
|
* @param targetisUnfiledRecords true is the target is in unfiled records
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private NodeRef createOrResolvePath(Action action, NodeRef actionedUponNodeRef, boolean targetisUnfiledRecords)
|
private NodeRef createOrResolvePath(final Action action, final NodeRef actionedUponNodeRef, final boolean targetisUnfiledRecords)
|
||||||
{
|
{
|
||||||
// get the starting context
|
// get the starting context
|
||||||
NodeRef context = getContext(action, actionedUponNodeRef, targetisUnfiledRecords);
|
final NodeRef context = getContext(action, actionedUponNodeRef, targetisUnfiledRecords);
|
||||||
NodeRef path = context;
|
NodeRef path = context;
|
||||||
|
|
||||||
// get the path we wish to resolve
|
// get the path we wish to resolve
|
||||||
String pathParameter = (String)action.getParameterValue(PARAM_PATH);
|
String pathParameter = (String)action.getParameterValue(PARAM_PATH);
|
||||||
String[] pathElementsArray = StringUtils.tokenizeToStringArray(pathParameter, "/", false, true);
|
final String[] pathElementsArray = StringUtils.tokenizeToStringArray(pathParameter, "/", false, true);
|
||||||
if((pathElementsArray != null) && (pathElementsArray.length > 0))
|
if((pathElementsArray != null) && (pathElementsArray.length > 0))
|
||||||
{
|
{
|
||||||
// get the create parameter
|
// get the create parameter
|
||||||
Boolean createValue = (Boolean)action.getParameterValue(PARAM_CREATE_RECORD_PATH);
|
Boolean createValue = (Boolean)action.getParameterValue(PARAM_CREATE_RECORD_PATH);
|
||||||
boolean create = createValue == null ? false : createValue.booleanValue();
|
final boolean create = createValue == null ? false : createValue.booleanValue();
|
||||||
|
|
||||||
// create or resolve the specified path
|
// create or resolve the specified path
|
||||||
path = createOrResolvePath(action, context, actionedUponNodeRef, Arrays.asList(pathElementsArray), targetisUnfiledRecords, create, false);
|
path = retryingTransactionHelper.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<NodeRef>()
|
||||||
|
{
|
||||||
|
public NodeRef execute() throws Throwable
|
||||||
|
{
|
||||||
|
NodeRef path = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
path = createOrResolvePath(action, context, actionedUponNodeRef, Arrays.asList(pathElementsArray), targetisUnfiledRecords,
|
||||||
|
create, false);
|
||||||
|
}
|
||||||
|
catch (DuplicateChildNodeNameException ex)
|
||||||
|
{
|
||||||
|
throw new ConcurrencyFailureException("Cannot create or resolve path.", ex);
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
}, false, true);
|
||||||
}
|
}
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user