mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Fix code formatting for code in 'org.alfresco.repo.action' packages
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@133311 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -42,7 +42,7 @@ import java.util.Comparator;
|
||||
*/
|
||||
public abstract class AbstractAsynchronousActionFilter implements Comparator<OngoingAsyncAction>
|
||||
{
|
||||
private String name;
|
||||
private String name;
|
||||
private String actionDefinitionName;
|
||||
private AsynchronousActionExecutionQueueImpl asynchronousActionExecutionQueue;
|
||||
|
||||
@@ -50,42 +50,42 @@ public abstract class AbstractAsynchronousActionFilter implements Comparator<Ong
|
||||
* Gets the name of this comparator.
|
||||
* @return String
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
public String getName()
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name of this comparator.
|
||||
* @param name String
|
||||
*/
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
/**
|
||||
* Sets the name of this comparator.
|
||||
* @param name String
|
||||
*/
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the action definition name against which this comparator is registered.
|
||||
* @return String
|
||||
*/
|
||||
public String getActionDefinitionName()
|
||||
{
|
||||
return this.actionDefinitionName;
|
||||
}
|
||||
/**
|
||||
* Gets the action definition name against which this comparator is registered.
|
||||
* @return String
|
||||
*/
|
||||
public String getActionDefinitionName()
|
||||
{
|
||||
return this.actionDefinitionName;
|
||||
}
|
||||
|
||||
public void setActionDefinitionName(String actionDefinitionName)
|
||||
{
|
||||
this.actionDefinitionName = actionDefinitionName;
|
||||
}
|
||||
public void setActionDefinitionName(String actionDefinitionName)
|
||||
{
|
||||
this.actionDefinitionName = actionDefinitionName;
|
||||
}
|
||||
|
||||
public void setAsynchronousActionExecutionQueue(
|
||||
AsynchronousActionExecutionQueueImpl asynchronousActionExecutionQueue)
|
||||
{
|
||||
this.asynchronousActionExecutionQueue = asynchronousActionExecutionQueue;
|
||||
}
|
||||
|
||||
public void init()
|
||||
{
|
||||
this.asynchronousActionExecutionQueue.registerActionFilter(this);
|
||||
}
|
||||
public void setAsynchronousActionExecutionQueue(
|
||||
AsynchronousActionExecutionQueueImpl asynchronousActionExecutionQueue)
|
||||
{
|
||||
this.asynchronousActionExecutionQueue = asynchronousActionExecutionQueue;
|
||||
}
|
||||
|
||||
public void init()
|
||||
{
|
||||
this.asynchronousActionExecutionQueue.registerActionFilter(this);
|
||||
}
|
||||
}
|
||||
|
@@ -35,8 +35,10 @@ import org.alfresco.service.cmr.action.CancellableAction;
|
||||
*/
|
||||
public class ActionCancelledException extends AlfrescoRuntimeException
|
||||
{
|
||||
public ActionCancelledException(CancellableAction action)
|
||||
{
|
||||
super(action.toString());
|
||||
}
|
||||
private static final long serialVersionUID = -3895466153727814956L;
|
||||
|
||||
public ActionCancelledException(CancellableAction action)
|
||||
{
|
||||
super(action.toString());
|
||||
}
|
||||
}
|
||||
|
@@ -35,9 +35,6 @@ import org.alfresco.service.cmr.action.ActionConditionDefinition;
|
||||
public class ActionConditionDefinitionImpl extends ParameterizedItemDefinitionImpl
|
||||
implements ActionConditionDefinition
|
||||
{
|
||||
/**
|
||||
* Serial version UID
|
||||
*/
|
||||
private static final long serialVersionUID = 3688505493618177331L;
|
||||
|
||||
/**
|
||||
|
@@ -25,32 +25,32 @@
|
||||
*/
|
||||
package org.alfresco.repo.action;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.alfresco.repo.cache.SimpleCache;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.TransactionListenerAdapter;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionServiceTransientException;
|
||||
import org.alfresco.service.cmr.action.ActionStatus;
|
||||
import org.alfresco.service.cmr.action.ActionTrackingService;
|
||||
import org.alfresco.service.cmr.action.CancellableAction;
|
||||
import org.alfresco.service.cmr.action.ExecutionDetails;
|
||||
import org.alfresco.service.cmr.action.ExecutionSummary;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.alfresco.repo.cache.SimpleCache;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionServiceTransientException;
|
||||
import org.alfresco.service.cmr.action.ActionStatus;
|
||||
import org.alfresco.service.cmr.action.ActionTrackingService;
|
||||
import org.alfresco.service.cmr.action.CancellableAction;
|
||||
import org.alfresco.service.cmr.action.ExecutionDetails;
|
||||
import org.alfresco.service.cmr.action.ExecutionSummary;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.transaction.TransactionListenerAdapter;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* Action execution tracking service implementation
|
||||
|
@@ -35,90 +35,90 @@ import org.alfresco.util.GUID;
|
||||
*/
|
||||
public class ActionTransactionListener implements TransactionListener
|
||||
{
|
||||
/**
|
||||
* Id used in equals and hash
|
||||
*/
|
||||
private String id = GUID.generate();
|
||||
|
||||
/**
|
||||
* The action service (runtime interface)
|
||||
*/
|
||||
private RuntimeActionService actionService;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param actionService the action service
|
||||
*/
|
||||
public ActionTransactionListener(RuntimeActionService actionService)
|
||||
{
|
||||
this.actionService = actionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.transaction.TransactionListener#flush()
|
||||
*/
|
||||
public void flush()
|
||||
{
|
||||
}
|
||||
/**
|
||||
* Id used in equals and hash
|
||||
*/
|
||||
private String id = GUID.generate();
|
||||
|
||||
/**
|
||||
* The action service (runtime interface)
|
||||
*/
|
||||
private RuntimeActionService actionService;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param actionService the action service
|
||||
*/
|
||||
public ActionTransactionListener(RuntimeActionService actionService)
|
||||
{
|
||||
this.actionService = actionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.transaction.TransactionListener#flush()
|
||||
*/
|
||||
public void flush()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.transaction.TransactionListener#beforeCommit(boolean)
|
||||
*/
|
||||
public void beforeCommit(boolean readOnly)
|
||||
{
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.repo.transaction.TransactionListener#beforeCommit(boolean)
|
||||
*/
|
||||
public void beforeCommit(boolean readOnly)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.transaction.TransactionListener#beforeCompletion()
|
||||
*/
|
||||
public void beforeCompletion()
|
||||
{
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.repo.transaction.TransactionListener#beforeCompletion()
|
||||
*/
|
||||
public void beforeCompletion()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.transaction.TransactionListener#afterCommit()
|
||||
*/
|
||||
public void afterCommit()
|
||||
{
|
||||
this.actionService.postCommit();
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.repo.transaction.TransactionListener#afterCommit()
|
||||
*/
|
||||
public void afterCommit()
|
||||
{
|
||||
this.actionService.postCommit();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.transaction.TransactionListener#afterRollback()
|
||||
*/
|
||||
public void afterRollback()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return this.id.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
/**
|
||||
* @see org.alfresco.repo.transaction.TransactionListener#afterRollback()
|
||||
*/
|
||||
public void afterRollback()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return this.id.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (obj instanceof ActionTransactionListener)
|
||||
{
|
||||
ActionTransactionListener that = (ActionTransactionListener) obj;
|
||||
ActionTransactionListener that = (ActionTransactionListener) obj;
|
||||
return (this.id.equals(that.id));
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -37,17 +37,17 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
*/
|
||||
public interface AsynchronousActionExecutionQueue
|
||||
{
|
||||
/**
|
||||
* @param actionService RuntimeActionService
|
||||
* @param action Action
|
||||
* @param actionedUponNodeRef NodeRef
|
||||
* @param checkConditions boolean
|
||||
*/
|
||||
void executeAction(
|
||||
RuntimeActionService actionService,
|
||||
Action action,
|
||||
NodeRef actionedUponNodeRef,
|
||||
boolean checkConditions,
|
||||
/**
|
||||
* @param actionService RuntimeActionService
|
||||
* @param action Action
|
||||
* @param actionedUponNodeRef NodeRef
|
||||
* @param checkConditions boolean
|
||||
*/
|
||||
void executeAction(
|
||||
RuntimeActionService actionService,
|
||||
Action action,
|
||||
NodeRef actionedUponNodeRef,
|
||||
boolean checkConditions,
|
||||
Set<String> actionChain);
|
||||
|
||||
|
||||
}
|
||||
|
@@ -25,32 +25,32 @@
|
||||
*/
|
||||
package org.alfresco.repo.action;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.Vector;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.error.StackTraceUtil;
|
||||
import org.alfresco.repo.action.AsynchronousActionExecutionQueuePolicies.OnAsyncActionExecute;
|
||||
import org.alfresco.repo.policy.ClassPolicyDelegate;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.rule.RuleServiceImpl;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationContext;
|
||||
import org.alfresco.repo.tenant.TenantUtil;
|
||||
import org.alfresco.repo.tenant.TenantUtil.TenantRunAsWork;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.repo.transaction.TransactionListenerAdapter;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionServiceException;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.Vector;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.error.StackTraceUtil;
|
||||
import org.alfresco.repo.action.AsynchronousActionExecutionQueuePolicies.OnAsyncActionExecute;
|
||||
import org.alfresco.repo.policy.ClassPolicyDelegate;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.rule.RuleServiceImpl;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationContext;
|
||||
import org.alfresco.repo.tenant.TenantUtil;
|
||||
import org.alfresco.repo.tenant.TenantUtil.TenantRunAsWork;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionServiceException;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.transaction.TransactionListenerAdapter;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* The asynchronous action execution queue implementation
|
||||
@@ -70,11 +70,11 @@ public class AsynchronousActionExecutionQueueImpl implements AsynchronousActionE
|
||||
actionFilters = new ConcurrentHashMap<String, AbstractAsynchronousActionFilter>();
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* We keep a record of ongoing asynchronous actions (this includes those being executed and
|
||||
* those that are in the queue).
|
||||
* This needs to be thread-safe - hence the Vector.
|
||||
*/
|
||||
/**
|
||||
* We keep a record of ongoing asynchronous actions (this includes those being executed and
|
||||
* those that are in the queue).
|
||||
* This needs to be thread-safe - hence the Vector.
|
||||
*/
|
||||
List<OngoingAsyncAction> ongoingActions = new Vector<OngoingAsyncAction>();
|
||||
|
||||
// Policy delegates
|
||||
@@ -170,27 +170,27 @@ public class AsynchronousActionExecutionQueueImpl implements AsynchronousActionE
|
||||
*/
|
||||
public void registerActionFilter(AbstractAsynchronousActionFilter filter)
|
||||
{
|
||||
String filterName = filter.getName();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Registered asynchronous action filter ")
|
||||
.append(filter.getName()).append(" for action ")
|
||||
.append(filter.getActionDefinitionName());
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
|
||||
AbstractAsynchronousActionFilter existingFilter = actionFilters.get(filterName);
|
||||
if (logger.isDebugEnabled() && existingFilter != null)
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("This replaces previous filter ")
|
||||
.append(existingFilter.getName());
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
|
||||
this.actionFilters.put(filter.getName(), filter);
|
||||
String filterName = filter.getName();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Registered asynchronous action filter ")
|
||||
.append(filter.getName()).append(" for action ")
|
||||
.append(filter.getActionDefinitionName());
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
|
||||
AbstractAsynchronousActionFilter existingFilter = actionFilters.get(filterName);
|
||||
if (logger.isDebugEnabled() && existingFilter != null)
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("This replaces previous filter ")
|
||||
.append(existingFilter.getName());
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
|
||||
this.actionFilters.put(filter.getName(), filter);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -203,26 +203,26 @@ public class AsynchronousActionExecutionQueueImpl implements AsynchronousActionE
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void executeAction(RuntimeActionService actionService, Action action, NodeRef actionedUponNodeRef,
|
||||
public void executeAction(RuntimeActionService actionService, Action action, NodeRef actionedUponNodeRef,
|
||||
boolean checkConditions, Set<String> actionChain, NodeRef actionExecutionHistoryNodeRef)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Received request to execute async action ").append(action.getActionDefinitionName())
|
||||
.append(" on ").append(actionedUponNodeRef);
|
||||
logger.debug(msg.toString());
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Received request to execute async action ").append(action.getActionDefinitionName())
|
||||
.append(" on ").append(actionedUponNodeRef);
|
||||
logger.debug(msg.toString());
|
||||
|
||||
msg = new StringBuilder();
|
||||
msg.append("ThreadPool's active count = ").append(this.threadPoolExecutor.getActiveCount());
|
||||
logger.debug(msg.toString());
|
||||
msg = new StringBuilder();
|
||||
msg.append("ThreadPool's active count = ").append(this.threadPoolExecutor.getActiveCount());
|
||||
logger.debug(msg.toString());
|
||||
|
||||
msg = new StringBuilder();
|
||||
msg.append("ThreadPool's queue size = ").append(this.threadPoolExecutor.getQueue().size());
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
msg = new StringBuilder();
|
||||
msg.append("ThreadPool's queue size = ").append(this.threadPoolExecutor.getQueue().size());
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
|
||||
Set<RuleServiceImpl.ExecutedRuleData> executedRules =
|
||||
Set<RuleServiceImpl.ExecutedRuleData> executedRules =
|
||||
(Set<RuleServiceImpl.ExecutedRuleData>) AlfrescoTransactionSupport.getResource("RuleServiceImpl.ExecutedRules");
|
||||
Runnable runnable = new ActionExecutionWrapper(
|
||||
actionService,
|
||||
@@ -238,56 +238,56 @@ public class AsynchronousActionExecutionQueueImpl implements AsynchronousActionE
|
||||
|
||||
for (Entry<String, AbstractAsynchronousActionFilter> entry : actionFilters.entrySet())
|
||||
{
|
||||
AbstractAsynchronousActionFilter comparator = entry.getValue();
|
||||
String actionDefinitionName = comparator.getActionDefinitionName();
|
||||
|
||||
if (actionDefinitionName.equals(action.getActionDefinitionName()) == false)
|
||||
{
|
||||
// We're only interested in registered actions with the same name as this one.
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Now we've found a registered action that matches the current one.
|
||||
// So we'll go through the actions that are ongoing and consider them for matches with this one.
|
||||
// Need to synchronize to prevent changes to ongoingActions whilst iterating. Assume that ongoingActions
|
||||
// is not going to be too big and the loop will execute quite quickly, so that the synchronization
|
||||
// will not impact concurrency too much.
|
||||
synchronized(this.ongoingActions)
|
||||
{
|
||||
for (OngoingAsyncAction ongoingAction : this.ongoingActions)
|
||||
{
|
||||
if (comparator.compare(ongoingAction, nodeBeingNewlyActioned) == 0)
|
||||
{
|
||||
newActionShouldBeFilteredOut = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
AbstractAsynchronousActionFilter comparator = entry.getValue();
|
||||
String actionDefinitionName = comparator.getActionDefinitionName();
|
||||
|
||||
if (actionDefinitionName.equals(action.getActionDefinitionName()) == false)
|
||||
{
|
||||
// We're only interested in registered actions with the same name as this one.
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Now we've found a registered action that matches the current one.
|
||||
// So we'll go through the actions that are ongoing and consider them for matches with this one.
|
||||
// Need to synchronize to prevent changes to ongoingActions whilst iterating. Assume that ongoingActions
|
||||
// is not going to be too big and the loop will execute quite quickly, so that the synchronization
|
||||
// will not impact concurrency too much.
|
||||
synchronized(this.ongoingActions)
|
||||
{
|
||||
for (OngoingAsyncAction ongoingAction : this.ongoingActions)
|
||||
{
|
||||
if (comparator.compare(ongoingAction, nodeBeingNewlyActioned) == 0)
|
||||
{
|
||||
newActionShouldBeFilteredOut = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (newActionShouldBeFilteredOut)
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Dropping action ").append(action).append(" as equivalent is ongoing.");
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
return;
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Dropping action ").append(action).append(" as equivalent is ongoing.");
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Executing action ").append(action);
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
|
||||
// Queue it and do it.
|
||||
ongoingActions.add(nodeBeingNewlyActioned);
|
||||
threadPoolExecutor.execute(runnable);
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Executing action ").append(action);
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
|
||||
// Queue it and do it.
|
||||
ongoingActions.add(nodeBeingNewlyActioned);
|
||||
threadPoolExecutor.execute(runnable);
|
||||
}
|
||||
|
||||
// Done
|
||||
@@ -309,14 +309,14 @@ public class AsynchronousActionExecutionQueueImpl implements AsynchronousActionE
|
||||
}
|
||||
|
||||
private void handleAsyncActionIsCompleted(NodeRef n, Action action) {
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Completed action ").append(action);
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
OngoingAsyncAction ongoing = new OngoingAsyncAction(n, action);
|
||||
ongoingActions.remove(ongoing);
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("Completed action ").append(action);
|
||||
logger.debug(msg.toString());
|
||||
}
|
||||
OngoingAsyncAction ongoing = new OngoingAsyncAction(n, action);
|
||||
ongoingActions.remove(ongoing);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -52,5 +52,5 @@ public interface AsynchronousActionExecutionQueuePolicies
|
||||
*/
|
||||
public void onAsyncActionExecute(Action action, NodeRef actionedUponNodeRef);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ package org.alfresco.repo.action;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import org.alfresco.service.cmr.action.ActionCondition;
|
||||
import org.alfresco.service.cmr.action.CompositeActionCondition;
|
||||
|
||||
@@ -52,6 +52,7 @@ public class CompositeActionConditionImpl extends ActionConditionImpl implements
|
||||
*/
|
||||
private List<ActionCondition> actionConditions = new ArrayList<ActionCondition>();
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static Boolean OR = true;
|
||||
private static Boolean AND = false;
|
||||
|
||||
|
@@ -36,51 +36,51 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
*/
|
||||
public class CreateThumbnailActionFilter extends AbstractAsynchronousActionFilter
|
||||
{
|
||||
private static final String PARAM_THUMBNAIL_NAME = "thumbnail-name";
|
||||
private static final String PARAM_THUMBNAIL_NAME = "thumbnail-name";
|
||||
|
||||
public int compare(OngoingAsyncAction nodeAction1, OngoingAsyncAction nodeAction2)
|
||||
{
|
||||
NodeRef n1 = nodeAction1.getNodeRef();
|
||||
NodeRef n2 = nodeAction2.getNodeRef();
|
||||
|
||||
// Handle n1 potentially being null without triggering a NPE
|
||||
if (n1 == null && n2 == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if(n1 == null && n2 != null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
// We can now do a regular compare without worrying about null nodes
|
||||
if (n1.equals(n2) == false)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
String thName1 = (String)nodeAction1.getAction().getParameterValue(PARAM_THUMBNAIL_NAME);
|
||||
String thName2 = (String)nodeAction2.getAction().getParameterValue(PARAM_THUMBNAIL_NAME);
|
||||
public int compare(OngoingAsyncAction nodeAction1, OngoingAsyncAction nodeAction2)
|
||||
{
|
||||
NodeRef n1 = nodeAction1.getNodeRef();
|
||||
NodeRef n2 = nodeAction2.getNodeRef();
|
||||
|
||||
// Handle n1 potentially being null without triggering a NPE
|
||||
if (n1 == null && n2 == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if(n1 == null && n2 != null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
// We can now do a regular compare without worrying about null nodes
|
||||
if (n1.equals(n2) == false)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
String thName1 = (String)nodeAction1.getAction().getParameterValue(PARAM_THUMBNAIL_NAME);
|
||||
String thName2 = (String)nodeAction2.getAction().getParameterValue(PARAM_THUMBNAIL_NAME);
|
||||
|
||||
// Need to allow for the possibility of null values for thumbnail-name. (ALF-4946)
|
||||
if (thName1 == null && thName2 == null)
|
||||
{
|
||||
// Two null-valued thumbnail-names are considered equal under the compareTo contract.
|
||||
return 0;
|
||||
}
|
||||
else if (thName1 == null && thName2 != null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else if (thName1 != null && thName2 == null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return thName1.compareTo(thName2);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Need to allow for the possibility of null values for thumbnail-name. (ALF-4946)
|
||||
if (thName1 == null && thName2 == null)
|
||||
{
|
||||
// Two null-valued thumbnail-names are considered equal under the compareTo contract.
|
||||
return 0;
|
||||
}
|
||||
else if (thName1 == null && thName2 != null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else if (thName1 != null && thName2 == null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return thName1.compareTo(thName2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -34,48 +34,48 @@ import org.alfresco.util.EqualsHelper;
|
||||
*/
|
||||
public class OngoingAsyncAction
|
||||
{
|
||||
private final NodeRef node;
|
||||
private final Action action;
|
||||
|
||||
public OngoingAsyncAction(NodeRef node, Action action)
|
||||
{
|
||||
this.node = node;
|
||||
this.action = action;
|
||||
}
|
||||
private final NodeRef node;
|
||||
private final Action action;
|
||||
|
||||
public OngoingAsyncAction(NodeRef node, Action action)
|
||||
{
|
||||
this.node = node;
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public NodeRef getNodeRef()
|
||||
{
|
||||
return node;
|
||||
}
|
||||
public NodeRef getNodeRef()
|
||||
{
|
||||
return node;
|
||||
}
|
||||
|
||||
public Action getAction()
|
||||
{
|
||||
return action;
|
||||
}
|
||||
public Action getAction()
|
||||
{
|
||||
return action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object otherObj)
|
||||
{
|
||||
if (otherObj == null || !otherObj.getClass().equals(this.getClass()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
OngoingAsyncAction otherNodeBeingActioned = (OngoingAsyncAction)otherObj;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object otherObj)
|
||||
{
|
||||
if (otherObj == null || !otherObj.getClass().equals(this.getClass()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
OngoingAsyncAction otherNodeBeingActioned = (OngoingAsyncAction)otherObj;
|
||||
|
||||
return EqualsHelper.nullSafeEquals(this.node, otherNodeBeingActioned.node) &&
|
||||
EqualsHelper.nullSafeEquals(this.action.getActionDefinitionName(), otherNodeBeingActioned.action.getActionDefinitionName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.node.hashCode() + 7 * this.action.getActionDefinitionName().hashCode();
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.node.hashCode() + 7 * this.action.getActionDefinitionName().hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append(node).append(", ").append(action.getActionDefinitionName());
|
||||
return msg.toString();
|
||||
}
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append(node).append(", ").append(action.getActionDefinitionName());
|
||||
return msg.toString();
|
||||
}
|
||||
}
|
||||
|
@@ -25,11 +25,10 @@
|
||||
*/
|
||||
package org.alfresco.repo.action;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.service.cmr.action.ParameterConstraint;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Parameter definition implementation class.
|
||||
@@ -62,14 +61,14 @@ public class ParameterDefinitionImpl implements ParameterDefinition, Serializabl
|
||||
* The display label
|
||||
*/
|
||||
private String displayLabel;
|
||||
|
||||
|
||||
/** Parameter constraint name */
|
||||
private String parameterConstraintName;
|
||||
|
||||
/**
|
||||
* Indicates whether it is mandatory for the parameter to be set
|
||||
*/
|
||||
private boolean isMandatory = false;
|
||||
/**
|
||||
* Indicates whether it is mandatory for the parameter to be set
|
||||
*/
|
||||
private boolean isMandatory = false;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -87,7 +86,7 @@ public class ParameterDefinitionImpl implements ParameterDefinition, Serializabl
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.displayLabel = displayLabel;
|
||||
this.isMandatory = isMandatory;
|
||||
this.isMandatory = isMandatory;
|
||||
this.isMultiValued = false;
|
||||
}
|
||||
|
||||
@@ -149,14 +148,14 @@ public class ParameterDefinitionImpl implements ParameterDefinition, Serializabl
|
||||
{
|
||||
return this.type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.action.ParameterDefinition#isMandatory()
|
||||
*/
|
||||
public boolean isMandatory()
|
||||
{
|
||||
return this.isMandatory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.action.ParameterDefinition#isMandatory()
|
||||
*/
|
||||
public boolean isMandatory()
|
||||
{
|
||||
return this.isMandatory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.action.ParameterDefinition#isMultiValued()
|
||||
|
@@ -43,23 +43,23 @@ import org.alfresco.service.cmr.rule.RuleServiceException;
|
||||
*/
|
||||
public abstract class ParameterizedItemAbstractBase extends CommonResourceAbstractBase
|
||||
{
|
||||
/**
|
||||
* Error messages
|
||||
*/
|
||||
private static final String ERR_MAND_PROP = "A value for the mandatory parameter {0} has not been set on the rule item {1}";
|
||||
|
||||
/**
|
||||
* Look-up constants
|
||||
*/
|
||||
private static final String TITLE = "title";
|
||||
private static final String DESCRIPTION = "description";
|
||||
protected static final String DISPLAY_LABEL = "display-label";
|
||||
|
||||
/**
|
||||
* Indicates whether or not ad-hoc properties can be provided. Default so false.
|
||||
*/
|
||||
protected boolean adhocPropertiesAllowed = false;
|
||||
|
||||
/**
|
||||
* Error messages
|
||||
*/
|
||||
private static final String ERR_MAND_PROP = "A value for the mandatory parameter {0} has not been set on the rule item {1}";
|
||||
|
||||
/**
|
||||
* Look-up constants
|
||||
*/
|
||||
private static final String TITLE = "title";
|
||||
private static final String DESCRIPTION = "description";
|
||||
protected static final String DISPLAY_LABEL = "display-label";
|
||||
|
||||
/**
|
||||
* Indicates whether or not ad-hoc properties can be provided. Default so false.
|
||||
*/
|
||||
protected boolean adhocPropertiesAllowed = false;
|
||||
|
||||
/**
|
||||
* Action service
|
||||
*/
|
||||
@@ -140,84 +140,84 @@ public abstract class ParameterizedItemAbstractBase extends CommonResourceAbstra
|
||||
/**
|
||||
* Sets the action service
|
||||
*
|
||||
* @param runtimeActionService the action service
|
||||
* @param runtimeActionService the action service
|
||||
*/
|
||||
public void setRuntimeActionService(RuntimeActionService runtimeActionService)
|
||||
{
|
||||
this.runtimeActionService = runtimeActionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the title I18N key
|
||||
*
|
||||
* @return the title key
|
||||
*/
|
||||
protected String getTitleKey()
|
||||
{
|
||||
/**
|
||||
* Gets the title I18N key
|
||||
*
|
||||
* @return the title key
|
||||
*/
|
||||
protected String getTitleKey()
|
||||
{
|
||||
return this.name + "." + TITLE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the description I18N key
|
||||
*
|
||||
* @return the description key
|
||||
*/
|
||||
protected String getDescriptionKey()
|
||||
{
|
||||
return this.name + "." + DESCRIPTION;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for Spring injection of adhocPropertiesAllowed property
|
||||
*
|
||||
* @param allowed boolean
|
||||
*/
|
||||
public void setAdhocPropertiesAllowed(boolean allowed)
|
||||
{
|
||||
this.adhocPropertiesAllowed = allowed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether adhoc property definitions are allowed or not
|
||||
*
|
||||
* @return true if they are, by default false
|
||||
*/
|
||||
protected boolean getAdhocPropertiesAllowed()
|
||||
{
|
||||
// By default adhoc properties are not allowed
|
||||
return this.adhocPropertiesAllowed;
|
||||
}
|
||||
/**
|
||||
* Gets the description I18N key
|
||||
*
|
||||
* @return the description key
|
||||
*/
|
||||
protected String getDescriptionKey()
|
||||
{
|
||||
return this.name + "." + DESCRIPTION;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for Spring injection of adhocPropertiesAllowed property
|
||||
*
|
||||
* @param allowed boolean
|
||||
*/
|
||||
public void setAdhocPropertiesAllowed(boolean allowed)
|
||||
{
|
||||
this.adhocPropertiesAllowed = allowed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether adhoc property definitions are allowed or not
|
||||
*
|
||||
* @return true if they are, by default false
|
||||
*/
|
||||
protected boolean getAdhocPropertiesAllowed()
|
||||
{
|
||||
// By default adhoc properties are not allowed
|
||||
return this.adhocPropertiesAllowed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parameter definition display label from the properties file.
|
||||
*
|
||||
* @param paramName the name of the parameter
|
||||
* @return the diaplay label of the parameter
|
||||
*/
|
||||
protected String getParamDisplayLabel(String paramName)
|
||||
{
|
||||
return I18NUtil.getMessage(this.name + "." + paramName + "." + DISPLAY_LABEL);
|
||||
}
|
||||
/**
|
||||
* Gets the parameter definition display label from the properties file.
|
||||
*
|
||||
* @param paramName the name of the parameter
|
||||
* @return the diaplay label of the parameter
|
||||
*/
|
||||
protected String getParamDisplayLabel(String paramName)
|
||||
{
|
||||
return I18NUtil.getMessage(this.name + "." + paramName + "." + DISPLAY_LABEL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parameter definition display label from the properties file.
|
||||
*
|
||||
* @param paramName the name of the parameter
|
||||
* @param locale the name of the locale
|
||||
* @return the display label of the parameter
|
||||
* @return the display label of the parameter
|
||||
*/
|
||||
protected String getParamDisplayLabel(String paramName, Locale locale)
|
||||
{
|
||||
return I18NUtil.getMessage(this.name + "." + paramName + "." + DISPLAY_LABEL, locale);
|
||||
}
|
||||
/**
|
||||
* Checked whether all the mandatory parameters for the rule item have been assigned.
|
||||
*
|
||||
* @param ruleItem the rule item
|
||||
* @param ruleItemDefinition the rule item definition
|
||||
*/
|
||||
protected void checkMandatoryProperties(ParameterizedItem ruleItem, ParameterizedItemDefinition ruleItemDefinition)
|
||||
{
|
||||
/**
|
||||
* Checked whether all the mandatory parameters for the rule item have been assigned.
|
||||
*
|
||||
* @param ruleItem the rule item
|
||||
* @param ruleItemDefinition the rule item definition
|
||||
*/
|
||||
protected void checkMandatoryProperties(ParameterizedItem ruleItem, ParameterizedItemDefinition ruleItemDefinition)
|
||||
{
|
||||
List<ParameterDefinition> definitions = ruleItemDefinition.getParameterDefinitions();
|
||||
if (definitions!= null && definitions.size()>0)
|
||||
{
|
||||
@@ -235,7 +235,5 @@ public abstract class ParameterizedItemAbstractBase extends CommonResourceAbstra
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -44,6 +44,8 @@ import org.alfresco.service.cmr.rule.RuleServiceException;
|
||||
*/
|
||||
public abstract class ParameterizedItemDefinitionImpl implements ParameterizedItemDefinition, Serializable
|
||||
{
|
||||
private static final long serialVersionUID = -114215660281683946L;
|
||||
|
||||
/**
|
||||
* The name of the rule item
|
||||
*/
|
||||
@@ -140,18 +142,18 @@ public abstract class ParameterizedItemDefinitionImpl implements ParameterizedIt
|
||||
*/
|
||||
public boolean getAdhocPropertiesAllowed()
|
||||
{
|
||||
return this.adhocPropertiesAllowed;
|
||||
return this.adhocPropertiesAllowed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether adhoc properties are allowed
|
||||
*
|
||||
* @param adhocPropertiesAllowed true is adhoc properties are allowed, false otherwise
|
||||
* @param adhocPropertiesAllowed true is adhoc properties are allowed, false otherwise
|
||||
*/
|
||||
public void setAdhocPropertiesAllowed(boolean adhocPropertiesAllowed)
|
||||
{
|
||||
this.adhocPropertiesAllowed = adhocPropertiesAllowed;
|
||||
}
|
||||
{
|
||||
this.adhocPropertiesAllowed = adhocPropertiesAllowed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the parameter definitions for the rule item with the locale specified
|
||||
|
@@ -36,14 +36,15 @@ import org.alfresco.service.cmr.action.ParameterizedItem;
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class ParameterizedItemImpl implements ParameterizedItem, Serializable
|
||||
{
|
||||
/**
|
||||
* The id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
private static final long serialVersionUID = 3578052215076397741L;
|
||||
|
||||
/**
|
||||
* The id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* The parameter values
|
||||
*/
|
||||
@@ -67,15 +68,15 @@ public abstract class ParameterizedItemImpl implements ParameterizedItem, Serial
|
||||
*/
|
||||
public ParameterizedItemImpl(String id, Map<String, Serializable> parameterValues)
|
||||
{
|
||||
// Set the action id
|
||||
this.id = id;
|
||||
|
||||
// Set the action id
|
||||
this.id = id;
|
||||
|
||||
if (parameterValues != null)
|
||||
{
|
||||
// TODO need to check that the parameter values being set correspond
|
||||
// correctly to the parameter definions on the rule item defintion
|
||||
this.parameterValues = parameterValues;
|
||||
}
|
||||
{
|
||||
// TODO need to check that the parameter values being set correspond
|
||||
// correctly to the parameter definions on the rule item defintion
|
||||
this.parameterValues = parameterValues;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,7 +84,7 @@ public abstract class ParameterizedItemImpl implements ParameterizedItem, Serial
|
||||
*/
|
||||
public String getId()
|
||||
{
|
||||
return this.id;
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,63 +99,63 @@ public abstract class ParameterizedItemImpl implements ParameterizedItem, Serial
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.action.ParameterizedItem#getParameterValue(String)
|
||||
*/
|
||||
public Serializable getParameterValue(String name)
|
||||
{
|
||||
return this.parameterValues.get(name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.action.ParameterizedItem#getParameterValue(String)
|
||||
*/
|
||||
public Serializable getParameterValue(String name)
|
||||
{
|
||||
return this.parameterValues.get(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.action.ParameterizedItem#setParameterValues(java.util.Map)
|
||||
*/
|
||||
public void setParameterValues(Map<String, Serializable> parameterValues)
|
||||
{
|
||||
if (parameterValues != null)
|
||||
{
|
||||
// TODO need to check that the parameter values being set correspond
|
||||
// correctly to the parameter definions on the rule item defintion
|
||||
this.parameterValues = parameterValues;
|
||||
}
|
||||
if (parameterValues != null)
|
||||
{
|
||||
// TODO need to check that the parameter values being set correspond
|
||||
// correctly to the parameter definions on the rule item defintion
|
||||
this.parameterValues = parameterValues;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.action.ParameterizedItem#setParameterValue(String, Serializable)
|
||||
*/
|
||||
public void setParameterValue(String name, Serializable value)
|
||||
{
|
||||
this.parameterValues.put(name, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hash code implementation
|
||||
*/
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return this.id.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Equals implementation
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.action.ParameterizedItem#setParameterValue(String, Serializable)
|
||||
*/
|
||||
public void setParameterValue(String name, Serializable value)
|
||||
{
|
||||
this.parameterValues.put(name, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hash code implementation
|
||||
*/
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return this.id.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Equals implementation
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (obj instanceof ParameterizedItemImpl)
|
||||
{
|
||||
ParameterizedItemImpl that = (ParameterizedItemImpl) obj;
|
||||
ParameterizedItemImpl that = (ParameterizedItemImpl) obj;
|
||||
return (this.id.equals(that.id));
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -38,9 +38,8 @@ import org.springframework.extensions.surf.util.I18NUtil;
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public abstract class BaseParameterConstraint implements ParameterConstraint,
|
||||
BeanNameAware
|
||||
{
|
||||
public abstract class BaseParameterConstraint implements ParameterConstraint, BeanNameAware
|
||||
{
|
||||
/** Constraint name */
|
||||
protected String name;
|
||||
|
||||
|
@@ -68,6 +68,4 @@ public class PropertyParameterConstraint extends BaseParameterConstraint
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -68,6 +68,4 @@ public class TypeParameterConstraint extends BaseParameterConstraint
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -41,8 +41,8 @@ public interface ActionConditionEvaluator
|
||||
*
|
||||
* @return the action condition definition
|
||||
*/
|
||||
public ActionConditionDefinition getActionConditionDefintion();
|
||||
|
||||
public ActionConditionDefinition getActionConditionDefintion();
|
||||
|
||||
/**
|
||||
* Evaluate the action condition
|
||||
*
|
||||
@@ -51,6 +51,6 @@ public interface ActionConditionEvaluator
|
||||
* @return true if the condition passes, false otherwise
|
||||
*/
|
||||
public boolean evaluate(
|
||||
ActionCondition actionCondition,
|
||||
ActionCondition actionCondition,
|
||||
NodeRef actionedUponNodeRef);
|
||||
}
|
||||
|
@@ -37,28 +37,28 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public abstract class ActionConditionEvaluatorAbstractBase extends ParameterizedItemAbstractBase implements ActionConditionEvaluator
|
||||
{
|
||||
{
|
||||
/**
|
||||
* Indicates whether the condition is public or not
|
||||
*/
|
||||
private boolean publicCondition = true;
|
||||
|
||||
/**
|
||||
/**
|
||||
* The action condition definition
|
||||
*/
|
||||
protected ActionConditionDefinition actionConditionDefinition;
|
||||
|
||||
*/
|
||||
protected ActionConditionDefinition actionConditionDefinition;
|
||||
|
||||
/**
|
||||
* Initialise method
|
||||
*/
|
||||
public void init()
|
||||
{
|
||||
public void init()
|
||||
{
|
||||
if (this.publicCondition == true)
|
||||
{
|
||||
// Call back to the action service to register the condition
|
||||
this.runtimeActionService.registerActionConditionEvaluator(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value that indicates whether a condition is public or not
|
||||
@@ -69,27 +69,27 @@ public abstract class ActionConditionEvaluatorAbstractBase extends Parameterized
|
||||
{
|
||||
this.publicCondition = publicCondition;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the action condition definition.
|
||||
*
|
||||
* @return the action condition definition
|
||||
*/
|
||||
public ActionConditionDefinition getActionConditionDefintion()
|
||||
{
|
||||
if (this.actionConditionDefinition == null)
|
||||
{
|
||||
this.actionConditionDefinition = new ActionConditionDefinitionImpl(this.name);
|
||||
((ActionConditionDefinitionImpl)this.actionConditionDefinition).setTitleKey(getTitleKey());
|
||||
((ActionConditionDefinitionImpl)this.actionConditionDefinition).setDescriptionKey(getDescriptionKey());
|
||||
((ActionConditionDefinitionImpl)this.actionConditionDefinition).setAdhocPropertiesAllowed(getAdhocPropertiesAllowed());
|
||||
((ActionConditionDefinitionImpl)this.actionConditionDefinition).setConditionEvaluator(this.name);
|
||||
((ActionConditionDefinitionImpl)this.actionConditionDefinition).setLocalizedParameterDefinitions(getLocalizedParameterDefinitions());
|
||||
}
|
||||
return this.actionConditionDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
public ActionConditionDefinition getActionConditionDefintion()
|
||||
{
|
||||
if (this.actionConditionDefinition == null)
|
||||
{
|
||||
this.actionConditionDefinition = new ActionConditionDefinitionImpl(this.name);
|
||||
((ActionConditionDefinitionImpl)this.actionConditionDefinition).setTitleKey(getTitleKey());
|
||||
((ActionConditionDefinitionImpl)this.actionConditionDefinition).setDescriptionKey(getDescriptionKey());
|
||||
((ActionConditionDefinitionImpl)this.actionConditionDefinition).setAdhocPropertiesAllowed(getAdhocPropertiesAllowed());
|
||||
((ActionConditionDefinitionImpl)this.actionConditionDefinition).setConditionEvaluator(this.name);
|
||||
((ActionConditionDefinitionImpl)this.actionConditionDefinition).setLocalizedParameterDefinitions(getLocalizedParameterDefinitions());
|
||||
}
|
||||
return this.actionConditionDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.evaluator.ActionConditionEvaluator#evaluate(org.alfresco.service.cmr.action.ActionCondition, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public boolean evaluate(ActionCondition actionCondition, NodeRef actionedUponNodeRef)
|
||||
@@ -102,7 +102,7 @@ public abstract class ActionConditionEvaluatorAbstractBase extends Parameterized
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Evaluation implementation
|
||||
*
|
||||
@@ -110,5 +110,5 @@ public abstract class ActionConditionEvaluatorAbstractBase extends Parameterized
|
||||
* @param actionedUponNodeRef the actioned upon node reference
|
||||
* @return the result of the condition evaluation
|
||||
*/
|
||||
protected abstract boolean evaluateImpl(ActionCondition actionCondition, NodeRef actionedUponNodeRef);
|
||||
protected abstract boolean evaluateImpl(ActionCondition actionCondition, NodeRef actionedUponNodeRef);
|
||||
}
|
||||
|
@@ -46,14 +46,11 @@ import org.alfresco.service.namespace.QName;
|
||||
*/
|
||||
public class CompareMimeTypeEvaluator extends ComparePropertyValueEvaluator
|
||||
{
|
||||
/**
|
||||
* Evaluator constants
|
||||
*/
|
||||
public static final String NAME = "compare-mime-type";
|
||||
|
||||
/**
|
||||
*
|
||||
* Evaluator constants
|
||||
*/
|
||||
public static final String NAME = "compare-mime-type";
|
||||
|
||||
private static final String ERRID_NOT_A_CONTENT_TYPE = "compare_mime_type_evaluator.not_a_content_type";
|
||||
private static final String ERRID_NO_PROPERTY_DEFINTION_FOUND = "compare_mime_type_evaluator.no_property_definition_found";
|
||||
|
||||
@@ -99,10 +96,10 @@ public class CompareMimeTypeEvaluator extends ComparePropertyValueEvaluator
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_PROPERTY, DataTypeDefinition.QNAME, false, getParamDisplayLabel(PARAM_PROPERTY)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_VALUE, DataTypeDefinition.ANY, true, getParamDisplayLabel(PARAM_VALUE), false, "ac-mimetypes"));
|
||||
}
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_VALUE, DataTypeDefinition.ANY, true, getParamDisplayLabel(PARAM_VALUE), false, "ac-mimetypes"));
|
||||
}
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
import org.alfresco.repo.action.evaluator.compare.ComparePropertyValueOperation;
|
||||
@@ -170,6 +170,7 @@ public class ComparePropertyValueEvaluator extends ActionConditionEvaluatorAbstr
|
||||
/**
|
||||
* @see ActionConditionEvaluatorAbstractBase#evaluateImpl(ActionCondition, NodeRef)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean evaluateImpl(
|
||||
ActionCondition ruleCondition,
|
||||
NodeRef actionedUponNodeRef)
|
||||
|
@@ -42,12 +42,12 @@ import org.alfresco.service.namespace.QName;
|
||||
*/
|
||||
public class HasAspectEvaluator extends ActionConditionEvaluatorAbstractBase
|
||||
{
|
||||
/**
|
||||
* Evaluator constants
|
||||
*/
|
||||
public static final String NAME = "has-aspect";
|
||||
/**
|
||||
* Evaluator constants
|
||||
*/
|
||||
public static final String NAME = "has-aspect";
|
||||
public static final String PARAM_ASPECT = "aspect";
|
||||
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
@@ -84,10 +84,10 @@ public class HasAspectEvaluator extends ActionConditionEvaluatorAbstractBase
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_ASPECT, DataTypeDefinition.QNAME, true, getParamDisplayLabel(PARAM_ASPECT), false, "ac-aspects"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -47,14 +47,14 @@ import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
*/
|
||||
public class HasChildEvaluator extends ActionConditionEvaluatorAbstractBase
|
||||
{
|
||||
/**
|
||||
* Evaluator constants
|
||||
*/
|
||||
public static final String NAME = "has-child";
|
||||
/**
|
||||
* Evaluator constants
|
||||
*/
|
||||
public static final String NAME = "has-child";
|
||||
|
||||
public static final String PARAM_ASSOC_TYPE = "assoc-type";
|
||||
public static final String PARAM_ASSOC_NAME = "assoc-name";
|
||||
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
@@ -101,10 +101,10 @@ public class HasChildEvaluator extends ActionConditionEvaluatorAbstractBase
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_ASSOC_TYPE, DataTypeDefinition.QNAME, false, getParamDisplayLabel(PARAM_ASSOC_TYPE), false));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_ASSOC_NAME, DataTypeDefinition.QNAME, false, getParamDisplayLabel(PARAM_ASSOC_NAME), false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -34,7 +34,6 @@ import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.tagging.TaggingService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Has tag evaluator
|
||||
@@ -43,12 +42,12 @@ import org.alfresco.service.namespace.QName;
|
||||
*/
|
||||
public class HasTagEvaluator extends ActionConditionEvaluatorAbstractBase
|
||||
{
|
||||
/**
|
||||
* Evaluator constants
|
||||
*/
|
||||
public static final String NAME = "has-tag";
|
||||
/**
|
||||
* Evaluator constants
|
||||
*/
|
||||
public static final String NAME = "has-tag";
|
||||
public static final String PARAM_TAG = "tag";
|
||||
|
||||
|
||||
/** The node service */
|
||||
private NodeService nodeService;
|
||||
|
||||
@@ -94,10 +93,10 @@ public class HasTagEvaluator extends ActionConditionEvaluatorAbstractBase
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_TAG, DataTypeDefinition.TEXT, true, getParamDisplayLabel(PARAM_TAG)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -42,11 +42,11 @@ import org.alfresco.service.cmr.version.VersionService;
|
||||
*/
|
||||
public class HasVersionHistoryEvaluator extends ActionConditionEvaluatorAbstractBase
|
||||
{
|
||||
/**
|
||||
* Evaluator constants
|
||||
*/
|
||||
public static final String NAME = "has-version-history";
|
||||
|
||||
/**
|
||||
* Evaluator constants
|
||||
*/
|
||||
public static final String NAME = "has-version-history";
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
@@ -92,9 +92,8 @@ public class HasVersionHistoryEvaluator extends ActionConditionEvaluatorAbstract
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@@ -49,22 +49,22 @@ import org.alfresco.service.namespace.QName;
|
||||
*/
|
||||
public class InCategoryEvaluator extends ActionConditionEvaluatorAbstractBase
|
||||
{
|
||||
/**
|
||||
* Rule constants
|
||||
*/
|
||||
public static final String NAME = "in-category";
|
||||
public static final String PARAM_CATEGORY_ASPECT = "category-aspect";
|
||||
public static final String PARAM_CATEGORY_VALUE = "category-value";
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
/**
|
||||
* The dictionary service
|
||||
*/
|
||||
private DictionaryService dictionaryService;
|
||||
/**
|
||||
* Rule constants
|
||||
*/
|
||||
public static final String NAME = "in-category";
|
||||
public static final String PARAM_CATEGORY_ASPECT = "category-aspect";
|
||||
public static final String PARAM_CATEGORY_VALUE = "category-value";
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
/**
|
||||
* The dictionary service
|
||||
*/
|
||||
private DictionaryService dictionaryService;
|
||||
|
||||
/**
|
||||
* Sets the node service
|
||||
@@ -89,55 +89,55 @@ public class InCategoryEvaluator extends ActionConditionEvaluatorAbstractBase
|
||||
/**
|
||||
* Add the parameter definitions
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_CATEGORY_ASPECT, DataTypeDefinition.QNAME, true, getParamDisplayLabel(PARAM_CATEGORY_ASPECT)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_CATEGORY_VALUE, DataTypeDefinition.NODE_REF, true, getParamDisplayLabel(PARAM_CATEGORY_VALUE)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.evaluator.ActionConditionEvaluatorAbstractBase#evaluateImpl(ActionCondition, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.evaluator.ActionConditionEvaluatorAbstractBase#evaluateImpl(ActionCondition, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected boolean evaluateImpl(
|
||||
ActionCondition ruleCondition,
|
||||
NodeRef actionedUponNodeRef)
|
||||
{
|
||||
boolean result = false;
|
||||
ActionCondition ruleCondition,
|
||||
NodeRef actionedUponNodeRef)
|
||||
{
|
||||
boolean result = false;
|
||||
|
||||
// Double check that the node still exists
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Get the rule parameter values
|
||||
QName categoryAspect = (QName)ruleCondition.getParameterValue(PARAM_CATEGORY_ASPECT);
|
||||
NodeRef categoryValue = (NodeRef)ruleCondition.getParameterValue(PARAM_CATEGORY_VALUE);
|
||||
|
||||
// Check that the apect is classifiable and is currently applied to the node
|
||||
if (this.dictionaryService.isSubClass(categoryAspect, ContentModel.ASPECT_CLASSIFIABLE) == true &&
|
||||
this.nodeService.hasAspect(actionedUponNodeRef, categoryAspect) == true)
|
||||
{
|
||||
// Get the category property qname
|
||||
QName categoryProperty = null;
|
||||
Map<QName, PropertyDefinition> propertyDefs = this.dictionaryService.getAspect(categoryAspect).getProperties();
|
||||
for (Map.Entry<QName, PropertyDefinition> entry : propertyDefs.entrySet())
|
||||
{
|
||||
if (DataTypeDefinition.CATEGORY.equals(entry.getValue().getDataType().getName()) == true)
|
||||
{
|
||||
// Found the category property
|
||||
categoryProperty = entry.getKey();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (categoryProperty != null)
|
||||
{
|
||||
// Check to see if the category value is in the list of currently set category values
|
||||
Serializable value = this.nodeService.getProperty(actionedUponNodeRef, categoryProperty);
|
||||
// Double check that the node still exists
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Get the rule parameter values
|
||||
QName categoryAspect = (QName)ruleCondition.getParameterValue(PARAM_CATEGORY_ASPECT);
|
||||
NodeRef categoryValue = (NodeRef)ruleCondition.getParameterValue(PARAM_CATEGORY_VALUE);
|
||||
|
||||
// Check that the apect is classifiable and is currently applied to the node
|
||||
if (this.dictionaryService.isSubClass(categoryAspect, ContentModel.ASPECT_CLASSIFIABLE) == true &&
|
||||
this.nodeService.hasAspect(actionedUponNodeRef, categoryAspect) == true)
|
||||
{
|
||||
// Get the category property qname
|
||||
QName categoryProperty = null;
|
||||
Map<QName, PropertyDefinition> propertyDefs = this.dictionaryService.getAspect(categoryAspect).getProperties();
|
||||
for (Map.Entry<QName, PropertyDefinition> entry : propertyDefs.entrySet())
|
||||
{
|
||||
if (DataTypeDefinition.CATEGORY.equals(entry.getValue().getDataType().getName()) == true)
|
||||
{
|
||||
// Found the category property
|
||||
categoryProperty = entry.getKey();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (categoryProperty != null)
|
||||
{
|
||||
// Check to see if the category value is in the list of currently set category values
|
||||
Serializable value = this.nodeService.getProperty(actionedUponNodeRef, categoryProperty);
|
||||
if (value != null)
|
||||
{
|
||||
Collection<NodeRef> actualCategories = DefaultTypeConverter.INSTANCE.getCollection(NodeRef.class, value);
|
||||
for (NodeRef nodeRef : actualCategories)
|
||||
for (NodeRef nodeRef : actualCategories)
|
||||
{
|
||||
if (nodeRef != null && nodeRef.equals(categoryValue) == true)
|
||||
{
|
||||
@@ -146,11 +146,11 @@ public class InCategoryEvaluator extends ActionConditionEvaluatorAbstractBase
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@@ -59,5 +59,4 @@ public class NoConditionEvaluator extends ActionConditionEvaluatorAbstractBase
|
||||
{
|
||||
// No parameters to add
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -104,16 +104,16 @@ public class DatePropertyValueComparator implements PropertyValueComparator
|
||||
{
|
||||
if(value instanceof Date)
|
||||
{
|
||||
return (Date) value;
|
||||
return (Date) value;
|
||||
}
|
||||
else if(value instanceof String)
|
||||
{
|
||||
return ISO8601DateFormat.parse((String) value);
|
||||
return ISO8601DateFormat.parse((String) value);
|
||||
}
|
||||
throw new AlfrescoRuntimeException("Parameter 'compareValue' must be of type java.util.Date!");
|
||||
}
|
||||
throw new AlfrescoRuntimeException("Parameter 'compareValue' must be of type java.util.Date!");
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @see org.alfresco.repo.action.evaluator.compare.PropertyValueComparator#registerComparator(org.alfresco.repo.action.evaluator.ComparePropertyValueEvaluator)
|
||||
*/
|
||||
public void registerComparator(ComparePropertyValueEvaluator evaluator)
|
||||
|
@@ -156,22 +156,22 @@ public class TextPropertyValueComparator implements PropertyValueComparator
|
||||
*/
|
||||
private static List<Character> ESCAPE_CHAR_LIST = null;
|
||||
|
||||
static
|
||||
{
|
||||
// ([{\^$|)?*+.
|
||||
ESCAPE_CHAR_LIST = new ArrayList<Character>(4);
|
||||
ESCAPE_CHAR_LIST.add('.');
|
||||
ESCAPE_CHAR_LIST.add('^');
|
||||
ESCAPE_CHAR_LIST.add('$');
|
||||
ESCAPE_CHAR_LIST.add('(');
|
||||
ESCAPE_CHAR_LIST.add('[');
|
||||
ESCAPE_CHAR_LIST.add('{');
|
||||
ESCAPE_CHAR_LIST.add('\\');
|
||||
ESCAPE_CHAR_LIST.add('|');
|
||||
ESCAPE_CHAR_LIST.add(')');
|
||||
ESCAPE_CHAR_LIST.add('?');
|
||||
ESCAPE_CHAR_LIST.add('+');
|
||||
}
|
||||
static
|
||||
{
|
||||
// ([{\^$|)?*+.
|
||||
ESCAPE_CHAR_LIST = new ArrayList<Character>(4);
|
||||
ESCAPE_CHAR_LIST.add('.');
|
||||
ESCAPE_CHAR_LIST.add('^');
|
||||
ESCAPE_CHAR_LIST.add('$');
|
||||
ESCAPE_CHAR_LIST.add('(');
|
||||
ESCAPE_CHAR_LIST.add('[');
|
||||
ESCAPE_CHAR_LIST.add('{');
|
||||
ESCAPE_CHAR_LIST.add('\\');
|
||||
ESCAPE_CHAR_LIST.add('|');
|
||||
ESCAPE_CHAR_LIST.add(')');
|
||||
ESCAPE_CHAR_LIST.add('?');
|
||||
ESCAPE_CHAR_LIST.add('+');
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.evaluator.compare.PropertyValueComparator#registerComparator(org.alfresco.repo.action.evaluator.ComparePropertyValueEvaluator)
|
||||
|
@@ -38,25 +38,25 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@AlfrescoPublicApi
|
||||
public interface ActionExecuter
|
||||
{
|
||||
/** Standard action result parameter name */
|
||||
public static String PARAM_RESULT = "result";
|
||||
|
||||
/**
|
||||
* Get the queueName that will execute this action
|
||||
*/
|
||||
String getQueueName();
|
||||
|
||||
/**
|
||||
* Indicates whether a lock on the actioned upon node reference should be ignored or
|
||||
* not. If true any lock is ignored and execution continues reguardless, otherwise the
|
||||
* lock is checked and the action is not executed (ignored) if the actioned upon node reference
|
||||
* is locked in any way. By default locks will be ignored.
|
||||
*
|
||||
* @since 3.3.4
|
||||
* @return boolean true if ignore lock, false otherwise.
|
||||
*/
|
||||
boolean getIgnoreLock();
|
||||
|
||||
/** Standard action result parameter name */
|
||||
public static String PARAM_RESULT = "result";
|
||||
|
||||
/**
|
||||
* Get the queueName that will execute this action
|
||||
*/
|
||||
String getQueueName();
|
||||
|
||||
/**
|
||||
* Indicates whether a lock on the actioned upon node reference should be ignored or
|
||||
* not. If true any lock is ignored and execution continues reguardless, otherwise the
|
||||
* lock is checked and the action is not executed (ignored) if the actioned upon node reference
|
||||
* is locked in any way. By default locks will be ignored.
|
||||
*
|
||||
* @since 3.3.4
|
||||
* @return boolean true if ignore lock, false otherwise.
|
||||
*/
|
||||
boolean getIgnoreLock();
|
||||
|
||||
/**
|
||||
* Get whether the basic action definition supports action tracking
|
||||
* or not. This can be overridden for each {@link Action#getTrackStatus() action}
|
||||
@@ -67,20 +67,20 @@ public interface ActionExecuter
|
||||
*
|
||||
* @since 3.4.1
|
||||
*/
|
||||
boolean getTrackStatus();
|
||||
|
||||
/**
|
||||
* Get the action definition for the action
|
||||
*
|
||||
* @return the action definition
|
||||
*/
|
||||
ActionDefinition getActionDefinition();
|
||||
|
||||
boolean getTrackStatus();
|
||||
|
||||
/**
|
||||
* Get the action definition for the action
|
||||
*
|
||||
* @return the action definition
|
||||
*/
|
||||
ActionDefinition getActionDefinition();
|
||||
|
||||
/**
|
||||
* Execute the action executer
|
||||
*
|
||||
* @param action the action
|
||||
* @param actionedUponNodeRef the actioned upon node reference
|
||||
* @param action the action
|
||||
* @param actionedUponNodeRef the actioned upon node reference
|
||||
*/
|
||||
void execute(Action action, NodeRef actionedUponNodeRef);
|
||||
}
|
||||
|
@@ -31,7 +31,6 @@ import java.util.Set;
|
||||
import org.alfresco.api.AlfrescoPublicApi;
|
||||
import org.alfresco.repo.action.ActionDefinitionImpl;
|
||||
import org.alfresco.repo.action.ParameterizedItemAbstractBase;
|
||||
import org.alfresco.repo.lock.LockUtils;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport.TxnReadState;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
@@ -302,7 +301,8 @@ public abstract class ActionExecuterAbstractBase extends ParameterizedItemAbstra
|
||||
this.queueName = queueName;
|
||||
}
|
||||
|
||||
public String getQueueName() {
|
||||
public String getQueueName()
|
||||
{
|
||||
return queueName;
|
||||
}
|
||||
|
||||
|
@@ -50,15 +50,15 @@ public class AddFeaturesActionExecuter extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Action constants
|
||||
*/
|
||||
public static final String NAME = "add-features";
|
||||
public static final String PARAM_ASPECT_NAME = "aspect-name";
|
||||
public static final String PARAM_CONSTRAINT = "ac-aspects";
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
public static final String NAME = "add-features";
|
||||
public static final String PARAM_ASPECT_NAME = "aspect-name";
|
||||
public static final String PARAM_CONSTRAINT = "ac-aspects";
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
/** Transaction Service, used for retrying operations */
|
||||
private TransactionService transactionService;
|
||||
|
||||
@@ -67,11 +67,11 @@ public class AddFeaturesActionExecuter extends ActionExecuterAbstractBase
|
||||
*
|
||||
* @param nodeService the node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the transaction service
|
||||
*
|
||||
@@ -82,14 +82,14 @@ public class AddFeaturesActionExecuter extends ActionExecuterAbstractBase
|
||||
this.transactionService = transactionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adhoc properties are allowed for this executor
|
||||
*/
|
||||
@Override
|
||||
protected boolean getAdhocPropertiesAllowed()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Adhoc properties are allowed for this executor
|
||||
*/
|
||||
@Override
|
||||
protected boolean getAdhocPropertiesAllowed()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuter#execute(org.alfresco.service.cmr.action.Action, NodeRef)
|
||||
@@ -99,8 +99,10 @@ public class AddFeaturesActionExecuter extends ActionExecuterAbstractBase
|
||||
if (this.nodeService.exists(actionedUponNodeRef))
|
||||
{
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(
|
||||
new RetryingTransactionCallback<Void>() {
|
||||
public Void execute() throws Throwable {
|
||||
new RetryingTransactionCallback<Void>()
|
||||
{
|
||||
public Void execute() throws Throwable
|
||||
{
|
||||
Map<QName, Serializable> properties = new HashMap<QName, Serializable>();
|
||||
QName aspectQName = null;
|
||||
|
||||
@@ -139,10 +141,10 @@ public class AddFeaturesActionExecuter extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_ASPECT_NAME, DataTypeDefinition.QNAME, true, getParamDisplayLabel(PARAM_ASPECT_NAME), false, "ac-aspects"));
|
||||
}
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_ASPECT_NAME, DataTypeDefinition.QNAME, true, getParamDisplayLabel(PARAM_ASPECT_NAME), false, "ac-aspects"));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -26,24 +26,21 @@
|
||||
|
||||
package org.alfresco.repo.action.executer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
import org.alfresco.repo.blog.BlogDetails;
|
||||
import org.alfresco.repo.blog.BlogIntegrationRuntimeException;
|
||||
import org.alfresco.repo.blog.BlogIntegrationService;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
import org.alfresco.model.BlogIntegrationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.model.BlogIntegrationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
import org.alfresco.repo.blog.BlogDetails;
|
||||
import org.alfresco.repo.blog.BlogIntegrationRuntimeException;
|
||||
import org.alfresco.repo.blog.BlogIntegrationService;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Post blog repository action
|
||||
@@ -55,8 +52,6 @@ public class BlogAction extends ActionExecuterAbstractBase implements BlogIntegr
|
||||
public static final String NAME = "blog-post";
|
||||
public static final String PARAM_BLOG_ACTION = "action";
|
||||
|
||||
private static Log logger = LogFactory.getLog(BlogAction.class);
|
||||
|
||||
private DictionaryService dictionaryService;
|
||||
private NodeService nodeService;
|
||||
private BlogIntegrationService blogIntegrationService;
|
||||
|
@@ -68,20 +68,20 @@ public class CheckInActionExecuter extends ActionExecuterAbstractBase
|
||||
*
|
||||
* @param nodeService the node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the checkIn checkOut service
|
||||
*
|
||||
* @param cociService the checkIn checkOut Service
|
||||
*/
|
||||
public void setCociService(CheckOutCheckInService cociService)
|
||||
{
|
||||
this.cociService = cociService;
|
||||
}
|
||||
public void setCociService(CheckOutCheckInService cociService)
|
||||
{
|
||||
this.cociService = cociService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuter#execute(Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
@@ -90,7 +90,7 @@ public class CheckInActionExecuter extends ActionExecuterAbstractBase
|
||||
{
|
||||
// First ensure that the actionedUponNodeRef is a workingCopy
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true &&
|
||||
this.nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY) == true)
|
||||
this.nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY) == true)
|
||||
{
|
||||
// Get the version description
|
||||
String description = (String)ruleAction.getParameterValue(PARAM_DESCRIPTION);
|
||||
@@ -115,11 +115,10 @@ public class CheckInActionExecuter extends ActionExecuterAbstractBase
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_DESCRIPTION, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_DESCRIPTION)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_MINOR_CHANGE, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_MINOR_CHANGE)));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_DESCRIPTION, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_DESCRIPTION)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_MINOR_CHANGE, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_MINOR_CHANGE)));
|
||||
}
|
||||
}
|
||||
|
@@ -53,71 +53,71 @@ public class CheckOutActionExecuter extends ActionExecuterAbstractBase
|
||||
* The version operations service
|
||||
*/
|
||||
private CheckOutCheckInService cociService;
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
/**
|
||||
* Set the node service
|
||||
*
|
||||
* @param nodeService the node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the coci service
|
||||
*
|
||||
* @param cociService the coci service
|
||||
*/
|
||||
public void setCociService(CheckOutCheckInService cociService)
|
||||
{
|
||||
this.cociService = cociService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the parameter defintions
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_DESTINATION_FOLDER, DataTypeDefinition.NODE_REF, false, getParamDisplayLabel(PARAM_DESTINATION_FOLDER)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_ASSOC_TYPE_QNAME, DataTypeDefinition.QNAME, false, getParamDisplayLabel(PARAM_ASSOC_TYPE_QNAME)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_ASSOC_QNAME, DataTypeDefinition.QNAME, false, getParamDisplayLabel(PARAM_ASSOC_QNAME)));
|
||||
}
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
/**
|
||||
* Set the node service
|
||||
*
|
||||
* @param nodeService the node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the coci service
|
||||
*
|
||||
* @param cociService the coci service
|
||||
*/
|
||||
public void setCociService(CheckOutCheckInService cociService)
|
||||
{
|
||||
this.cociService = cociService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the parameter defintions
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_DESTINATION_FOLDER, DataTypeDefinition.NODE_REF, false, getParamDisplayLabel(PARAM_DESTINATION_FOLDER)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_ASSOC_TYPE_QNAME, DataTypeDefinition.QNAME, false, getParamDisplayLabel(PARAM_ASSOC_TYPE_QNAME)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_ASSOC_QNAME, DataTypeDefinition.QNAME, false, getParamDisplayLabel(PARAM_ASSOC_QNAME)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuter#execute(Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true &&
|
||||
this.nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY) == false &&
|
||||
isApplicableType(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Get the destination details
|
||||
NodeRef destinationParent = (NodeRef)ruleAction.getParameterValue(PARAM_DESTINATION_FOLDER);
|
||||
QName destinationAssocTypeQName = (QName)ruleAction.getParameterValue(PARAM_ASSOC_TYPE_QNAME);
|
||||
QName destinationAssocQName = (QName)ruleAction.getParameterValue(PARAM_ASSOC_QNAME);
|
||||
|
||||
if (destinationParent == null || destinationAssocTypeQName == null || destinationAssocQName == null)
|
||||
{
|
||||
// Check the node out to the current location
|
||||
this.cociService.checkout(actionedUponNodeRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check the node out to the specified location
|
||||
this.cociService.checkout(
|
||||
actionedUponNodeRef,
|
||||
destinationParent,
|
||||
destinationAssocTypeQName,
|
||||
destinationAssocQName);
|
||||
}
|
||||
}
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true &&
|
||||
this.nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_WORKING_COPY) == false &&
|
||||
isApplicableType(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Get the destination details
|
||||
NodeRef destinationParent = (NodeRef)ruleAction.getParameterValue(PARAM_DESTINATION_FOLDER);
|
||||
QName destinationAssocTypeQName = (QName)ruleAction.getParameterValue(PARAM_ASSOC_TYPE_QNAME);
|
||||
QName destinationAssocQName = (QName)ruleAction.getParameterValue(PARAM_ASSOC_QNAME);
|
||||
|
||||
if (destinationParent == null || destinationAssocTypeQName == null || destinationAssocQName == null)
|
||||
{
|
||||
// Check the node out to the current location
|
||||
this.cociService.checkout(actionedUponNodeRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check the node out to the specified location
|
||||
this.cociService.checkout(
|
||||
actionedUponNodeRef,
|
||||
destinationParent,
|
||||
destinationAssocTypeQName,
|
||||
destinationAssocQName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -43,45 +43,44 @@ public class CompositeActionExecuter extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Action constants
|
||||
*/
|
||||
public static final String NAME = "composite-action";
|
||||
|
||||
/**
|
||||
* The action service
|
||||
*/
|
||||
private RuntimeActionService actionService;
|
||||
|
||||
/**
|
||||
* Set the action service
|
||||
*
|
||||
* @param actionService the action service
|
||||
*/
|
||||
public void setActionService(RuntimeActionService actionService)
|
||||
{
|
||||
this.actionService = actionService;
|
||||
}
|
||||
public static final String NAME = "composite-action";
|
||||
|
||||
/**
|
||||
* The action service
|
||||
*/
|
||||
private RuntimeActionService actionService;
|
||||
|
||||
/**
|
||||
* Set the action service
|
||||
*
|
||||
* @param actionService the action service
|
||||
*/
|
||||
public void setActionService(RuntimeActionService actionService)
|
||||
{
|
||||
this.actionService = actionService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuter#execute(Action, NodeRef)
|
||||
*/
|
||||
public void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (action instanceof CompositeAction)
|
||||
{
|
||||
for (Action subAction : ((CompositeAction)action).getActions())
|
||||
{
|
||||
// We don't check the conditions of sub-actions and they don't have an execution history
|
||||
this.actionService.directActionExecution(subAction, actionedUponNodeRef);
|
||||
}
|
||||
}
|
||||
if (action instanceof CompositeAction)
|
||||
{
|
||||
for (Action subAction : ((CompositeAction)action).getActions())
|
||||
{
|
||||
// We don't check the conditions of sub-actions and they don't have an execution history
|
||||
this.actionService.directActionExecution(subAction, actionedUponNodeRef);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add parameter definitions
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
// No parameters
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
// No parameters
|
||||
}
|
||||
}
|
||||
|
@@ -136,7 +136,7 @@ public class ContentMetadataEmbedder extends ActionExecuterAbstractBase
|
||||
|
||||
try
|
||||
{
|
||||
embedder.embed(nodeProperties, reader, writer);
|
||||
embedder.embed(nodeProperties, reader, writer);
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
|
@@ -179,7 +179,6 @@ public class ContentMetadataExtracter extends ActionExecuterAbstractBase
|
||||
* @param propertyDef the PropertyDefinition of the taggable property
|
||||
* @param rawValue the raw value from the metadata extracter
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void addTags(NodeRef actionedUponNodeRef, PropertyDefinition propertyDef, Serializable rawValue)
|
||||
{
|
||||
List<String> tags = new ArrayList<String>();
|
||||
@@ -200,12 +199,13 @@ public class ContentMetadataExtracter extends ActionExecuterAbstractBase
|
||||
Serializable convertedPropertyValue = (Serializable) DefaultTypeConverter.INSTANCE.convert(
|
||||
propertyDef.getDataType(),
|
||||
(String) singleValue);
|
||||
try {
|
||||
try
|
||||
{
|
||||
String tagName = (String) nodeService.getProperty((NodeRef) convertedPropertyValue, ContentModel.PROP_NAME);
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("found tag '" + tagName + "' from tag nodeRef '" + (String) singleValue + "', " +
|
||||
"adding to " + actionedUponNodeRef.toString());
|
||||
"adding to " + actionedUponNodeRef.toString());
|
||||
}
|
||||
if (tagName != null && !tagName.equals(""))
|
||||
{
|
||||
|
@@ -64,12 +64,12 @@ public class CopyActionExecuter extends ActionExecuterAbstractBase
|
||||
public static final String PARAM_OVERWRITE_COPY = "overwrite-copy";
|
||||
|
||||
private CopyService copyService;
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
private CheckOutCheckInService checkOutCheckInService;
|
||||
private CheckOutCheckInService checkOutCheckInService;
|
||||
|
||||
/**
|
||||
* Sets the node service
|
||||
@@ -88,10 +88,10 @@ public class CopyActionExecuter extends ActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Service to determine check-in or check-out status
|
||||
*/
|
||||
public void setCheckOutCheckInService(CheckOutCheckInService checkOutCheckInService)
|
||||
/**
|
||||
* Service to determine check-in or check-out status
|
||||
*/
|
||||
public void setCheckOutCheckInService(CheckOutCheckInService checkOutCheckInService)
|
||||
{
|
||||
this.checkOutCheckInService = checkOutCheckInService;
|
||||
}
|
||||
@@ -100,11 +100,11 @@ public class CopyActionExecuter extends ActionExecuterAbstractBase
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_DESTINATION_FOLDER, DataTypeDefinition.NODE_REF, true, getParamDisplayLabel(PARAM_DESTINATION_FOLDER)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_DEEP_COPY, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_DEEP_COPY)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_DEEP_COPY, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_DEEP_COPY)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_OVERWRITE_COPY, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_OVERWRITE_COPY)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (!nodeService.exists(actionedUponNodeRef))
|
||||
@@ -128,7 +128,7 @@ public class CopyActionExecuter extends ActionExecuterAbstractBase
|
||||
{
|
||||
deepCopy = deepCopyValue.booleanValue();
|
||||
}
|
||||
|
||||
|
||||
// Get the overwirte value
|
||||
boolean overwrite = true;
|
||||
Boolean overwriteValue = (Boolean)ruleAction.getParameterValue(PARAM_OVERWRITE_COPY);
|
||||
@@ -177,11 +177,11 @@ public class CopyActionExecuter extends ActionExecuterAbstractBase
|
||||
ChildAssociationRef originalAssoc = nodeService.getPrimaryParent(actionedUponNodeRef);
|
||||
// Create a new copy of the node
|
||||
this.copyService.copyAndRename(
|
||||
actionedUponNodeRef,
|
||||
destinationParent,
|
||||
actionedUponNodeRef,
|
||||
destinationParent,
|
||||
originalAssoc.getTypeQName(),
|
||||
originalAssoc.getQName(),
|
||||
deepCopy);
|
||||
deepCopy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -43,42 +43,42 @@ public class CountChildrenActionExecuter extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Action constants
|
||||
*/
|
||||
public static final String NAME = "count-children";
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
public static final String NAME = "count-children";
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
/**
|
||||
* Set the node service
|
||||
*
|
||||
* @param nodeService the node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuter#execute(Action, NodeRef)
|
||||
*/
|
||||
public void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Get the parent node
|
||||
int count = this.nodeService.getChildAssocs(actionedUponNodeRef).size();
|
||||
ruleAction.setParameterValue(PARAM_RESULT, Integer.valueOf(count));
|
||||
}
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Get the parent node
|
||||
int count = this.nodeService.getChildAssocs(actionedUponNodeRef).size();
|
||||
ruleAction.setParameterValue(PARAM_RESULT, Integer.valueOf(count));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
}
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ import org.alfresco.service.namespace.QName;
|
||||
public class CounterIncrementActionExecuter extends ActionExecuterAbstractBase
|
||||
{
|
||||
public static final String NAME = "counter";
|
||||
|
||||
|
||||
/** Runtime NodeService with no permissions protection */
|
||||
private NodeService nodeService;
|
||||
|
||||
|
@@ -52,21 +52,21 @@ public class CreateVersionActionExecuter extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Action constants
|
||||
*/
|
||||
public static final String NAME = "create-version";
|
||||
public static final String PARAM_DESCRIPTION = "description";
|
||||
public static final String PARAM_MINOR_CHANGE = "minor-change";
|
||||
|
||||
/** Node service */
|
||||
public static final String NAME = "create-version";
|
||||
public static final String PARAM_DESCRIPTION = "description";
|
||||
public static final String PARAM_MINOR_CHANGE = "minor-change";
|
||||
|
||||
/** Node service */
|
||||
public NodeService nodeService;
|
||||
|
||||
/** Version service */
|
||||
public VersionService versionService;
|
||||
|
||||
/**
|
||||
* Set node service
|
||||
*
|
||||
* @param nodeService node service
|
||||
*/
|
||||
public VersionService versionService;
|
||||
|
||||
/**
|
||||
* Set node service
|
||||
*
|
||||
* @param nodeService node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
@@ -87,12 +87,12 @@ public class CreateVersionActionExecuter extends ActionExecuterAbstractBase
|
||||
*/
|
||||
public void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true &&
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true &&
|
||||
this.nodeService.hasAspect(actionedUponNodeRef, ContentModel.ASPECT_VERSIONABLE) == true)
|
||||
{
|
||||
{
|
||||
Map<String, Serializable> versionProperties = new HashMap<String, Serializable>(2);
|
||||
|
||||
// Get the version description
|
||||
|
||||
// Get the version description
|
||||
String description = (String)ruleAction.getParameterValue(PARAM_DESCRIPTION);
|
||||
if (description != null && description.length() != 0)
|
||||
{
|
||||
@@ -111,18 +111,18 @@ public class CreateVersionActionExecuter extends ActionExecuterAbstractBase
|
||||
}
|
||||
|
||||
// Create the version
|
||||
this.versionService.createVersion(actionedUponNodeRef, versionProperties);
|
||||
}
|
||||
this.versionService.createVersion(actionedUponNodeRef, versionProperties);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_MINOR_CHANGE, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_MINOR_CHANGE)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_DESCRIPTION, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_DESCRIPTION)));
|
||||
}
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_MINOR_CHANGE, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_MINOR_CHANGE)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_DESCRIPTION, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_DESCRIPTION)));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -51,14 +51,14 @@ public class ExecuteAllRulesActionExecuter extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Action constants
|
||||
*/
|
||||
public static final String NAME = "execute-all-rules";
|
||||
public static final String NAME = "execute-all-rules";
|
||||
public static final String PARAM_EXECUTE_INHERITED_RULES = "execute-inherited-rules";
|
||||
public static final String PARAM_RUN_ALL_RULES_ON_CHILDREN = "run-all-rules-on-children";
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
/**
|
||||
* The rule service
|
||||
@@ -72,16 +72,16 @@ public class ExecuteAllRulesActionExecuter extends ActionExecuterAbstractBase
|
||||
|
||||
/** The dictionary Service */
|
||||
private DictionaryService dictionaryService;
|
||||
|
||||
|
||||
/**
|
||||
* Set the node service
|
||||
*
|
||||
* @param nodeService the node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the rule service
|
||||
@@ -118,8 +118,8 @@ public class ExecuteAllRulesActionExecuter extends ActionExecuterAbstractBase
|
||||
*/
|
||||
public void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Get the parameter value
|
||||
boolean includeInherited = false;
|
||||
Boolean includeInheritedValue = (Boolean)ruleAction.getParameterValue(PARAM_EXECUTE_INHERITED_RULES);
|
||||
@@ -135,7 +135,7 @@ public class ExecuteAllRulesActionExecuter extends ActionExecuterAbstractBase
|
||||
runAllChildren = runAllChildrenValue.booleanValue();
|
||||
}
|
||||
|
||||
// Get the rules
|
||||
// Get the rules
|
||||
List<Rule> rules = ruleService.getRules(actionedUponNodeRef, includeInherited);
|
||||
if (rules != null && rules.isEmpty() == false)
|
||||
{
|
||||
@@ -173,7 +173,7 @@ public class ExecuteAllRulesActionExecuter extends ActionExecuterAbstractBase
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -93,16 +93,16 @@ public class ExporterActionExecuter extends ActionExecuterAbstractBase
|
||||
* The content service
|
||||
*/
|
||||
private ContentService contentService;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the ExporterService to use
|
||||
*
|
||||
* @param exporterService The ExporterService
|
||||
*/
|
||||
public void setExporterService(ExporterService exporterService)
|
||||
{
|
||||
this.exporterService = exporterService;
|
||||
}
|
||||
public void setExporterService(ExporterService exporterService)
|
||||
{
|
||||
this.exporterService = exporterService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the MimetypeService to use
|
||||
@@ -195,16 +195,16 @@ public class ExporterActionExecuter extends ActionExecuterAbstractBase
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
*/
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_PACKAGE_NAME, DataTypeDefinition.TEXT, true,
|
||||
getParamDisplayLabel(PARAM_PACKAGE_NAME)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_ENCODING, DataTypeDefinition.TEXT, true,
|
||||
getParamDisplayLabel(PARAM_ENCODING)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_STORE, DataTypeDefinition.TEXT, true,
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_STORE, DataTypeDefinition.TEXT, true,
|
||||
getParamDisplayLabel(PARAM_STORE)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_DESTINATION_FOLDER, DataTypeDefinition.NODE_REF, true,
|
||||
getParamDisplayLabel(PARAM_DESTINATION_FOLDER)));
|
||||
@@ -212,7 +212,7 @@ public class ExporterActionExecuter extends ActionExecuterAbstractBase
|
||||
getParamDisplayLabel(PARAM_INCLUDE_CHILDREN)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_INCLUDE_SELF, DataTypeDefinition.BOOLEAN, false,
|
||||
getParamDisplayLabel(PARAM_INCLUDE_SELF)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the ZIP file node in the repository for the export
|
||||
|
@@ -25,46 +25,45 @@
|
||||
*/
|
||||
package org.alfresco.repo.action.executer;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.zip.ZipException;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ApplicationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.importer.ACPImportPackageHandler;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.model.FileExistsException;
|
||||
import org.alfresco.service.cmr.model.FileFolderService;
|
||||
import org.alfresco.service.cmr.model.FileInfo;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.view.ImporterException;
|
||||
import org.alfresco.service.cmr.view.ImporterService;
|
||||
import org.alfresco.service.cmr.view.Location;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.TempFileProvider;
|
||||
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
|
||||
import org.apache.commons.compress.archivers.zip.ZipFile;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.zip.ZipException;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ApplicationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
import org.alfresco.repo.importer.ACPImportPackageHandler;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.model.FileExistsException;
|
||||
import org.alfresco.service.cmr.model.FileFolderService;
|
||||
import org.alfresco.service.cmr.model.FileInfo;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentService;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.view.ImporterService;
|
||||
import org.alfresco.service.cmr.view.Location;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.TempFileProvider;
|
||||
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
|
||||
import org.apache.commons.compress.archivers.zip.ZipFile;
|
||||
|
||||
/**
|
||||
* Importer action executor
|
||||
@@ -81,7 +80,6 @@ public class ImporterActionExecuter extends ActionExecuterAbstractBase
|
||||
private static final int BUFFER_SIZE = 16384;
|
||||
private static final String TEMP_FILE_PREFIX = "alf";
|
||||
private static final String TEMP_FILE_SUFFIX_ACP = ".acp";
|
||||
private static final String TEMP_FILE_SUFFIX_ZIP = ".zip";
|
||||
|
||||
private boolean highByteZip = false;
|
||||
|
||||
@@ -356,9 +354,9 @@ public class ImporterActionExecuter extends ActionExecuterAbstractBase
|
||||
extractDir = extractDir + File.separator;
|
||||
try
|
||||
{
|
||||
for (Enumeration e = archive.getEntries(); e.hasMoreElements();)
|
||||
for (Enumeration<ZipArchiveEntry> e = archive.getEntries(); e.hasMoreElements();)
|
||||
{
|
||||
ZipArchiveEntry entry = (ZipArchiveEntry) e.nextElement();
|
||||
ZipArchiveEntry entry = e.nextElement();
|
||||
if (!entry.isDirectory())
|
||||
{
|
||||
fileName = entry.getName();
|
||||
|
@@ -51,22 +51,22 @@ import org.alfresco.service.namespace.QName;
|
||||
*/
|
||||
public class LinkCategoryActionExecuter extends ActionExecuterAbstractBase
|
||||
{
|
||||
/**
|
||||
* Rule constants
|
||||
*/
|
||||
public static final String NAME = "link-category";
|
||||
/**
|
||||
* Rule constants
|
||||
*/
|
||||
public static final String NAME = "link-category";
|
||||
public static final String PARAM_CATEGORY_ASPECT = "category-aspect";
|
||||
public static final String PARAM_CATEGORY_VALUE = "category-value";
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
/**
|
||||
* The dictionary service
|
||||
*/
|
||||
private DictionaryService dictionaryService;
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
/**
|
||||
* The dictionary service
|
||||
*/
|
||||
private DictionaryService dictionaryService;
|
||||
|
||||
/**
|
||||
* Sets the node service
|
||||
@@ -91,32 +91,32 @@ public class LinkCategoryActionExecuter extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Add the parameter definitions
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_CATEGORY_ASPECT, DataTypeDefinition.QNAME, false, getParamDisplayLabel(PARAM_CATEGORY_ASPECT)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_CATEGORY_VALUE, DataTypeDefinition.NODE_REF, true, getParamDisplayLabel(PARAM_CATEGORY_VALUE)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute action implementation
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
// Double check that the node still exists
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Get the rule parameter values
|
||||
QName categoryAspect = (QName)ruleAction.getParameterValue(PARAM_CATEGORY_ASPECT);
|
||||
if (categoryAspect == null)
|
||||
{
|
||||
// Use the default general classifiable aspect
|
||||
//cm:generalclassifiable
|
||||
categoryAspect = ContentModel.ASPECT_GEN_CLASSIFIABLE;
|
||||
}
|
||||
NodeRef categoryValue = (NodeRef)ruleAction.getParameterValue(PARAM_CATEGORY_VALUE);
|
||||
|
||||
// Double check that the node still exists
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Get the rule parameter values
|
||||
QName categoryAspect = (QName)ruleAction.getParameterValue(PARAM_CATEGORY_ASPECT);
|
||||
if (categoryAspect == null)
|
||||
{
|
||||
// Use the default general classifiable aspect
|
||||
//cm:generalclassifiable
|
||||
categoryAspect = ContentModel.ASPECT_GEN_CLASSIFIABLE;
|
||||
}
|
||||
NodeRef categoryValue = (NodeRef)ruleAction.getParameterValue(PARAM_CATEGORY_VALUE);
|
||||
|
||||
// Check that the aspect is classifiable and is currently applied to the node
|
||||
if (this.dictionaryService.isSubClass(categoryAspect, ContentModel.ASPECT_CLASSIFIABLE) == true)
|
||||
{
|
||||
@@ -168,7 +168,7 @@ public class LinkCategoryActionExecuter extends ActionExecuterAbstractBase
|
||||
this.nodeService.setProperty(actionedUponNodeRef, categoryProperty, (Serializable)categories);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -25,66 +25,66 @@
|
||||
*/
|
||||
package org.alfresco.repo.action.executer;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.internet.InternetAddress;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
import org.alfresco.repo.admin.SysAdminParams;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.repo.template.DateCompareMethod;
|
||||
import org.alfresco.repo.template.HasAspectMethod;
|
||||
import org.alfresco.repo.template.I18NMessageMethod;
|
||||
import org.alfresco.repo.template.TemplateNode;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.repo.tenant.TenantUtil;
|
||||
import org.alfresco.repo.tenant.TenantUtil.TenantRunAsWork;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.repo.transaction.TransactionListenerAdapter;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.preference.PreferenceService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.TemplateImageResolver;
|
||||
import org.alfresco.service.cmr.repository.TemplateService;
|
||||
import org.alfresco.service.cmr.security.AuthenticationService;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.alfresco.util.UrlUtil;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.commons.validator.routines.EmailValidator;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
import org.springframework.mail.MailException;
|
||||
import org.springframework.mail.MailPreparationException;
|
||||
import org.springframework.mail.javamail.JavaMailSender;
|
||||
import org.springframework.mail.javamail.MimeMessageHelper;
|
||||
import org.springframework.mail.javamail.MimeMessagePreparator;
|
||||
import org.springframework.util.StringUtils;
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.internet.InternetAddress;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
import org.alfresco.repo.admin.SysAdminParams;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.repo.template.DateCompareMethod;
|
||||
import org.alfresco.repo.template.HasAspectMethod;
|
||||
import org.alfresco.repo.template.I18NMessageMethod;
|
||||
import org.alfresco.repo.template.TemplateNode;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.repo.tenant.TenantUtil;
|
||||
import org.alfresco.repo.tenant.TenantUtil.TenantRunAsWork;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.preference.PreferenceService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.TemplateImageResolver;
|
||||
import org.alfresco.service.cmr.repository.TemplateService;
|
||||
import org.alfresco.service.cmr.security.AuthenticationService;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.security.AuthorityType;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.alfresco.util.UrlUtil;
|
||||
import org.alfresco.util.transaction.TransactionListenerAdapter;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.commons.validator.routines.EmailValidator;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
import org.springframework.mail.MailException;
|
||||
import org.springframework.mail.MailPreparationException;
|
||||
import org.springframework.mail.javamail.JavaMailSender;
|
||||
import org.springframework.mail.javamail.MimeMessageHelper;
|
||||
import org.springframework.mail.javamail.MimeMessagePreparator;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Mail action executor implementation.
|
||||
@@ -627,44 +627,44 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
|
||||
{
|
||||
if (ccValue instanceof String)
|
||||
{
|
||||
String cc = (String)ccValue;
|
||||
if(cc.length() > 0)
|
||||
{
|
||||
messageRef[0].setCc(cc);
|
||||
}
|
||||
String cc = (String)ccValue;
|
||||
if(cc.length() > 0)
|
||||
{
|
||||
messageRef[0].setCc(cc);
|
||||
}
|
||||
|
||||
}
|
||||
else if (ccValue instanceof List<?>)
|
||||
{
|
||||
List<String>s = (List<String>)ccValue;
|
||||
messageRef[0].setCc((String[])s.toArray());
|
||||
List<String>s = (List<String>)ccValue;
|
||||
messageRef[0].setCc((String[])s.toArray());
|
||||
}
|
||||
else if (ccValue.getClass().isArray())
|
||||
{
|
||||
messageRef[0].setCc((String[])ccValue);
|
||||
messageRef[0].setCc((String[])ccValue);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Serializable bccValue = (String)ruleAction.getParameterValue(PARAM_BCC);
|
||||
if(bccValue != null)
|
||||
{
|
||||
if (bccValue instanceof String)
|
||||
{
|
||||
String bcc = (String)bccValue;
|
||||
if(bcc.length() > 0)
|
||||
{
|
||||
messageRef[0].setBcc(bcc);
|
||||
}
|
||||
String bcc = (String)bccValue;
|
||||
if(bcc.length() > 0)
|
||||
{
|
||||
messageRef[0].setBcc(bcc);
|
||||
}
|
||||
|
||||
}
|
||||
else if (bccValue instanceof List<?>)
|
||||
{
|
||||
List<String>s = (List<String>)bccValue;
|
||||
messageRef[0].setBcc((String[])s.toArray());
|
||||
List<String>s = (List<String>)bccValue;
|
||||
messageRef[0].setBcc((String[])s.toArray());
|
||||
}
|
||||
else if (bccValue.getClass().isArray())
|
||||
{
|
||||
messageRef[0].setCc((String[])bccValue);
|
||||
messageRef[0].setCc((String[])bccValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -41,8 +41,7 @@ public class MailActionExecuterMonitor
|
||||
String message = I18NUtil.getMessage("email.outbound.test.send.success", params);
|
||||
return message;
|
||||
}
|
||||
catch
|
||||
(AlfrescoRuntimeException are)
|
||||
catch (AlfrescoRuntimeException are)
|
||||
{
|
||||
return (are.getMessage());
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ public class MoveActionExecuter extends ActionExecuterAbstractBase
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
|
||||
public void setFileFolderService(FileFolderService fileFolderService)
|
||||
{
|
||||
this.fileFolderService = fileFolderService;
|
||||
|
@@ -45,44 +45,44 @@ public class RemoveFeaturesActionExecuter extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Action constants
|
||||
*/
|
||||
public static final String NAME = "remove-features";
|
||||
public static final String PARAM_ASPECT_NAME = "aspect-name";
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
public static final String NAME = "remove-features";
|
||||
public static final String PARAM_ASPECT_NAME = "aspect-name";
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
/**
|
||||
* Set the node service
|
||||
*
|
||||
* @param nodeService the node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuter#execute(Action, NodeRef)
|
||||
*/
|
||||
public void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Remove the aspect
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Remove the aspect
|
||||
QName aspectQName = (QName)ruleAction.getParameterValue(PARAM_ASPECT_NAME);
|
||||
this.nodeService.removeAspect(actionedUponNodeRef, aspectQName);
|
||||
}
|
||||
this.nodeService.removeAspect(actionedUponNodeRef, aspectQName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_ASPECT_NAME, DataTypeDefinition.QNAME, true, getParamDisplayLabel(PARAM_ASPECT_NAME), false, "ac-aspects"));
|
||||
}
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_ASPECT_NAME, DataTypeDefinition.QNAME, true, getParamDisplayLabel(PARAM_ASPECT_NAME), false, "ac-aspects"));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -55,10 +55,10 @@ public class RepositoryExporterActionExecuter extends ActionExecuterAbstractBase
|
||||
*
|
||||
* @param exporterService The ExporterService
|
||||
*/
|
||||
public void setRepositoryExporterService(RepositoryExporterService exporterService)
|
||||
{
|
||||
this.exporterService = exporterService;
|
||||
}
|
||||
public void setRepositoryExporterService(RepositoryExporterService exporterService)
|
||||
{
|
||||
this.exporterService = exporterService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuter#execute(Action, NodeRef)
|
||||
@@ -70,15 +70,15 @@ public class RepositoryExporterActionExecuter extends ActionExecuterAbstractBase
|
||||
exporterService.export(repoDestination, packageName);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
*/
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_PACKAGE_NAME, DataTypeDefinition.TEXT, true,
|
||||
getParamDisplayLabel(PARAM_PACKAGE_NAME)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_DESTINATION_FOLDER, DataTypeDefinition.NODE_REF, true,
|
||||
getParamDisplayLabel(PARAM_DESTINATION_FOLDER)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -182,7 +182,7 @@ public class ScriptActionExecuter extends ActionExecuterAbstractBase
|
||||
// Set the result
|
||||
if (result != null)
|
||||
{
|
||||
action.setParameterValue(PARAM_RESULT, (Serializable)result);
|
||||
action.setParameterValue(PARAM_RESULT, (Serializable)result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -45,48 +45,48 @@ public class SetPropertyValueActionExecuter extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Action constants
|
||||
*/
|
||||
public static final String NAME = "set-property-value";
|
||||
public static final String PARAM_PROPERTY = "property";
|
||||
public static final String NAME = "set-property-value";
|
||||
public static final String PARAM_PROPERTY = "property";
|
||||
public static final String PARAM_VALUE = "value";
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
/**
|
||||
* Set the node service
|
||||
*
|
||||
* @param nodeService the node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuter#execute(Action, NodeRef)
|
||||
*/
|
||||
public void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Set the value of the property
|
||||
this.nodeService.setProperty(
|
||||
this.nodeService.setProperty(
|
||||
actionedUponNodeRef,
|
||||
(QName)ruleAction.getParameterValue(PARAM_PROPERTY),
|
||||
ruleAction.getParameterValue(PARAM_VALUE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add parameter definitions
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_PROPERTY, DataTypeDefinition.QNAME, true, getParamDisplayLabel(PARAM_PROPERTY), false, "ac-properties"));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_VALUE, DataTypeDefinition.ANY, true, getParamDisplayLabel(PARAM_VALUE)));
|
||||
}
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_VALUE, DataTypeDefinition.ANY, true, getParamDisplayLabel(PARAM_VALUE)));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -46,68 +46,68 @@ import org.alfresco.service.namespace.QName;
|
||||
*/
|
||||
public class SimpleWorkflowActionExecuter extends ActionExecuterAbstractBase
|
||||
{
|
||||
public static final String NAME = "simple-workflow";
|
||||
public static final String PARAM_APPROVE_STEP = "approve-step";
|
||||
public static final String PARAM_APPROVE_FOLDER = "approve-folder";
|
||||
public static final String PARAM_APPROVE_MOVE = "approve-move";
|
||||
public static final String PARAM_REJECT_STEP = "reject-step";
|
||||
public static final String PARAM_REJECT_FOLDER = "reject-folder";
|
||||
public static final String PARAM_REJECT_MOVE = "reject-move";
|
||||
|
||||
private NodeService nodeService;
|
||||
public static final String NAME = "simple-workflow";
|
||||
public static final String PARAM_APPROVE_STEP = "approve-step";
|
||||
public static final String PARAM_APPROVE_FOLDER = "approve-folder";
|
||||
public static final String PARAM_APPROVE_MOVE = "approve-move";
|
||||
public static final String PARAM_REJECT_STEP = "reject-step";
|
||||
public static final String PARAM_REJECT_FOLDER = "reject-folder";
|
||||
public static final String PARAM_REJECT_MOVE = "reject-move";
|
||||
|
||||
private NodeService nodeService;
|
||||
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_APPROVE_STEP, DataTypeDefinition.TEXT, true, getParamDisplayLabel(PARAM_APPROVE_STEP)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_APPROVE_FOLDER, DataTypeDefinition.NODE_REF, true, getParamDisplayLabel(PARAM_APPROVE_FOLDER)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_APPROVE_MOVE, DataTypeDefinition.BOOLEAN, true, getParamDisplayLabel(PARAM_APPROVE_MOVE)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_REJECT_STEP, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_REJECT_STEP)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_REJECT_FOLDER, DataTypeDefinition.NODE_REF, false, getParamDisplayLabel(PARAM_REJECT_FOLDER)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_REJECT_MOVE, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_REJECT_MOVE)));
|
||||
}
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_APPROVE_STEP, DataTypeDefinition.TEXT, true, getParamDisplayLabel(PARAM_APPROVE_STEP)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_APPROVE_FOLDER, DataTypeDefinition.NODE_REF, true, getParamDisplayLabel(PARAM_APPROVE_FOLDER)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_APPROVE_MOVE, DataTypeDefinition.BOOLEAN, true, getParamDisplayLabel(PARAM_APPROVE_MOVE)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_REJECT_STEP, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_REJECT_STEP)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_REJECT_FOLDER, DataTypeDefinition.NODE_REF, false, getParamDisplayLabel(PARAM_REJECT_FOLDER)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_REJECT_MOVE, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_REJECT_MOVE)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(
|
||||
Action ruleAction,
|
||||
NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true &&
|
||||
this.nodeService.hasAspect(actionedUponNodeRef, ApplicationModel.ASPECT_SIMPLE_WORKFLOW) == false)
|
||||
{
|
||||
// Get the parameter values
|
||||
String approveStep = (String)ruleAction.getParameterValue(PARAM_APPROVE_STEP);
|
||||
NodeRef approveFolder = (NodeRef)ruleAction.getParameterValue(PARAM_APPROVE_FOLDER);
|
||||
Boolean approveMove = (Boolean)ruleAction.getParameterValue(PARAM_APPROVE_MOVE);
|
||||
String rejectStep = (String)ruleAction.getParameterValue(PARAM_REJECT_STEP);
|
||||
NodeRef rejectFolder = (NodeRef)ruleAction.getParameterValue(PARAM_REJECT_FOLDER);
|
||||
Boolean rejectMove = (Boolean)ruleAction.getParameterValue(PARAM_REJECT_MOVE);
|
||||
|
||||
// Set the property values
|
||||
Map<QName, Serializable> propertyValues = new HashMap<QName, Serializable>();
|
||||
propertyValues.put(ApplicationModel.PROP_APPROVE_STEP, approveStep);
|
||||
propertyValues.put(ApplicationModel.PROP_APPROVE_FOLDER, approveFolder);
|
||||
if (approveMove != null)
|
||||
{
|
||||
propertyValues.put(ApplicationModel.PROP_APPROVE_MOVE, approveMove.booleanValue());
|
||||
}
|
||||
propertyValues.put(ApplicationModel.PROP_REJECT_STEP, rejectStep);
|
||||
propertyValues.put(ApplicationModel.PROP_REJECT_FOLDER, rejectFolder);
|
||||
if (rejectMove != null)
|
||||
{
|
||||
propertyValues.put(ApplicationModel.PROP_REJECT_MOVE, rejectMove.booleanValue());
|
||||
}
|
||||
|
||||
// Apply the simple workflow aspect to the node
|
||||
this.nodeService.addAspect(actionedUponNodeRef, ApplicationModel.ASPECT_SIMPLE_WORKFLOW, propertyValues);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(
|
||||
Action ruleAction,
|
||||
NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true &&
|
||||
this.nodeService.hasAspect(actionedUponNodeRef, ApplicationModel.ASPECT_SIMPLE_WORKFLOW) == false)
|
||||
{
|
||||
// Get the parameter values
|
||||
String approveStep = (String)ruleAction.getParameterValue(PARAM_APPROVE_STEP);
|
||||
NodeRef approveFolder = (NodeRef)ruleAction.getParameterValue(PARAM_APPROVE_FOLDER);
|
||||
Boolean approveMove = (Boolean)ruleAction.getParameterValue(PARAM_APPROVE_MOVE);
|
||||
String rejectStep = (String)ruleAction.getParameterValue(PARAM_REJECT_STEP);
|
||||
NodeRef rejectFolder = (NodeRef)ruleAction.getParameterValue(PARAM_REJECT_FOLDER);
|
||||
Boolean rejectMove = (Boolean)ruleAction.getParameterValue(PARAM_REJECT_MOVE);
|
||||
|
||||
// Set the property values
|
||||
Map<QName, Serializable> propertyValues = new HashMap<QName, Serializable>();
|
||||
propertyValues.put(ApplicationModel.PROP_APPROVE_STEP, approveStep);
|
||||
propertyValues.put(ApplicationModel.PROP_APPROVE_FOLDER, approveFolder);
|
||||
if (approveMove != null)
|
||||
{
|
||||
propertyValues.put(ApplicationModel.PROP_APPROVE_MOVE, approveMove.booleanValue());
|
||||
}
|
||||
propertyValues.put(ApplicationModel.PROP_REJECT_STEP, rejectStep);
|
||||
propertyValues.put(ApplicationModel.PROP_REJECT_FOLDER, rejectFolder);
|
||||
if (rejectMove != null)
|
||||
{
|
||||
propertyValues.put(ApplicationModel.PROP_REJECT_MOVE, rejectMove.booleanValue());
|
||||
}
|
||||
|
||||
// Apply the simple workflow aspect to the node
|
||||
this.nodeService.addAspect(actionedUponNodeRef, ApplicationModel.ASPECT_SIMPLE_WORKFLOW, propertyValues);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -46,28 +46,28 @@ public class SpecialiseTypeActionExecuter extends ActionExecuterAbstractBase
|
||||
/**
|
||||
* Action constants
|
||||
*/
|
||||
public static final String NAME = "specialise-type";
|
||||
public static final String PARAM_TYPE_NAME = "type-name";
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
public static final String NAME = "specialise-type";
|
||||
public static final String PARAM_TYPE_NAME = "type-name";
|
||||
|
||||
/**
|
||||
* The node service
|
||||
*/
|
||||
private NodeService nodeService;
|
||||
|
||||
/**
|
||||
* The dictionary service
|
||||
*/
|
||||
private DictionaryService dictionaryService;
|
||||
|
||||
|
||||
/**
|
||||
* Set the node service
|
||||
*
|
||||
* @param nodeService the node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the dictionary service
|
||||
@@ -84,9 +84,9 @@ public class SpecialiseTypeActionExecuter extends ActionExecuterAbstractBase
|
||||
*/
|
||||
public void executeImpl(Action ruleAction, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Get the type of the node
|
||||
if (this.nodeService.exists(actionedUponNodeRef) == true)
|
||||
{
|
||||
// Get the type of the node
|
||||
QName currentType = this.nodeService.getType(actionedUponNodeRef);
|
||||
QName destinationType = (QName)ruleAction.getParameterValue(PARAM_TYPE_NAME);
|
||||
|
||||
@@ -97,16 +97,16 @@ public class SpecialiseTypeActionExecuter extends ActionExecuterAbstractBase
|
||||
// Specialise the type of the node
|
||||
this.nodeService.setType(actionedUponNodeRef, destinationType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_TYPE_NAME, DataTypeDefinition.QNAME, true, getParamDisplayLabel(PARAM_TYPE_NAME), false, "ac-types"));
|
||||
}
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_TYPE_NAME, DataTypeDefinition.QNAME, true, getParamDisplayLabel(PARAM_TYPE_NAME), false, "ac-types"));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -426,6 +426,4 @@ public class TransformActionExecuter extends ActionExecuterAbstractBase
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -25,22 +25,21 @@
|
||||
*/
|
||||
package org.alfresco.repo.action.executer;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ApplicationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.CopyService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ApplicationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.CopyService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Simple workflow action executor
|
||||
@@ -50,116 +49,116 @@ import org.alfresco.service.namespace.QName;
|
||||
public class TransitionSimpleWorkflowActionExecuter extends ActionExecuterAbstractBase
|
||||
{
|
||||
/** Node Service */
|
||||
private NodeService nodeService;
|
||||
private NodeService nodeService;
|
||||
|
||||
/** Copy Service */
|
||||
private CopyService copyService;
|
||||
|
||||
/** Indicates whether we are transitioning an accept step, false if a reject step */
|
||||
private boolean isAcceptTransition = true;
|
||||
|
||||
/**
|
||||
* Set the node service
|
||||
*
|
||||
* @param nodeService node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the copy service
|
||||
*
|
||||
* @param copyService copy service
|
||||
*/
|
||||
public void setCopyService(CopyService copyService)
|
||||
{
|
||||
this.copyService = copyService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether this is an accept transition or not
|
||||
*/
|
||||
public void setIsAcceptTransition(boolean value)
|
||||
{
|
||||
this.isAcceptTransition = value;
|
||||
}
|
||||
/** Copy Service */
|
||||
private CopyService copyService;
|
||||
|
||||
/** Indicates whether we are transitioning an accept step, false if a reject step */
|
||||
private boolean isAcceptTransition = true;
|
||||
|
||||
/**
|
||||
* Set the node service
|
||||
*
|
||||
* @param nodeService node service
|
||||
*/
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the copy service
|
||||
*
|
||||
* @param copyService copy service
|
||||
*/
|
||||
public void setCopyService(CopyService copyService)
|
||||
{
|
||||
this.copyService = copyService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether this is an accept transition or not
|
||||
*/
|
||||
public void setIsAcceptTransition(boolean value)
|
||||
{
|
||||
this.isAcceptTransition = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
}
|
||||
/**
|
||||
* @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(
|
||||
final Action ruleAction,
|
||||
final NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (nodeService.exists(actionedUponNodeRef) == true &&
|
||||
nodeService.hasAspect(actionedUponNodeRef, ApplicationModel.ASPECT_SIMPLE_WORKFLOW) == true)
|
||||
{
|
||||
NodeRef destinationFolder = null;
|
||||
Boolean isMove = null;
|
||||
|
||||
// Get the destination folder and determine whether we do a move or copy
|
||||
Map<QName, Serializable> props = nodeService.getProperties(actionedUponNodeRef);
|
||||
if (isAcceptTransition == true)
|
||||
{
|
||||
destinationFolder = (NodeRef)props.get(ApplicationModel.PROP_APPROVE_FOLDER);
|
||||
isMove = (Boolean)props.get(ApplicationModel.PROP_APPROVE_MOVE);
|
||||
}
|
||||
else
|
||||
{
|
||||
destinationFolder = (NodeRef)props.get(ApplicationModel.PROP_REJECT_FOLDER);
|
||||
/**
|
||||
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(
|
||||
final Action ruleAction,
|
||||
final NodeRef actionedUponNodeRef)
|
||||
{
|
||||
if (nodeService.exists(actionedUponNodeRef) == true &&
|
||||
nodeService.hasAspect(actionedUponNodeRef, ApplicationModel.ASPECT_SIMPLE_WORKFLOW) == true)
|
||||
{
|
||||
NodeRef destinationFolder = null;
|
||||
Boolean isMove = null;
|
||||
|
||||
// Get the destination folder and determine whether we do a move or copy
|
||||
Map<QName, Serializable> props = nodeService.getProperties(actionedUponNodeRef);
|
||||
if (isAcceptTransition == true)
|
||||
{
|
||||
destinationFolder = (NodeRef)props.get(ApplicationModel.PROP_APPROVE_FOLDER);
|
||||
isMove = (Boolean)props.get(ApplicationModel.PROP_APPROVE_MOVE);
|
||||
}
|
||||
else
|
||||
{
|
||||
destinationFolder = (NodeRef)props.get(ApplicationModel.PROP_REJECT_FOLDER);
|
||||
isMove = (Boolean)props.get(ApplicationModel.PROP_REJECT_MOVE);
|
||||
}
|
||||
|
||||
if (destinationFolder == null)
|
||||
{
|
||||
// We need a destination folder in order to transition the workflow
|
||||
throw new AlfrescoRuntimeException("No folder was specified for the simple workflow step.");
|
||||
}
|
||||
|
||||
if (isMove == null)
|
||||
{
|
||||
// Assume default of false
|
||||
isMove = Boolean.FALSE;
|
||||
}
|
||||
|
||||
// Set the name of the node
|
||||
String name = (String)props.get(ContentModel.PROP_NAME);
|
||||
|
||||
// first we need to take off the simpleworkflow aspect
|
||||
}
|
||||
|
||||
if (destinationFolder == null)
|
||||
{
|
||||
// We need a destination folder in order to transition the workflow
|
||||
throw new AlfrescoRuntimeException("No folder was specified for the simple workflow step.");
|
||||
}
|
||||
|
||||
if (isMove == null)
|
||||
{
|
||||
// Assume default of false
|
||||
isMove = Boolean.FALSE;
|
||||
}
|
||||
|
||||
// Set the name of the node
|
||||
String name = (String)props.get(ContentModel.PROP_NAME);
|
||||
|
||||
// first we need to take off the simpleworkflow aspect
|
||||
nodeService.removeAspect(actionedUponNodeRef, ApplicationModel.ASPECT_SIMPLE_WORKFLOW);
|
||||
|
||||
if (Boolean.TRUE.equals(isMove) == true)
|
||||
{
|
||||
// move the node to the specified folder
|
||||
String qname = QName.createValidLocalName(name);
|
||||
nodeService.moveNode(
|
||||
actionedUponNodeRef,
|
||||
destinationFolder,
|
||||
ContentModel.ASSOC_CONTAINS,
|
||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, qname));
|
||||
}
|
||||
else
|
||||
{
|
||||
// copy the node to the specified folder
|
||||
ChildAssociationRef originalAssoc = nodeService.getPrimaryParent(actionedUponNodeRef);
|
||||
copyService.copyAndRename(
|
||||
actionedUponNodeRef,
|
||||
destinationFolder,
|
||||
originalAssoc.getTypeQName(),
|
||||
originalAssoc.getQName(),
|
||||
true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Boolean.TRUE.equals(isMove) == true)
|
||||
{
|
||||
// move the node to the specified folder
|
||||
String qname = QName.createValidLocalName(name);
|
||||
nodeService.moveNode(
|
||||
actionedUponNodeRef,
|
||||
destinationFolder,
|
||||
ContentModel.ASSOC_CONTAINS,
|
||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, qname));
|
||||
}
|
||||
else
|
||||
{
|
||||
// copy the node to the specified folder
|
||||
ChildAssociationRef originalAssoc = nodeService.getPrimaryParent(actionedUponNodeRef);
|
||||
copyService.copyAndRename(
|
||||
actionedUponNodeRef,
|
||||
destinationFolder,
|
||||
originalAssoc.getTypeQName(),
|
||||
originalAssoc.getQName(),
|
||||
true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,10 +41,6 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
*/
|
||||
public class CompensatingActionException extends AlfrescoRuntimeException
|
||||
{
|
||||
|
||||
/**
|
||||
* Comment for <code>serialVersionUID</code>
|
||||
*/
|
||||
private static final long serialVersionUID = 2144573075007116603L;
|
||||
|
||||
List<Pair<Action, NodeRef>> compensatingActions;
|
||||
|
@@ -201,9 +201,6 @@ public class CronScheduledQueryBasedTemplateActionDefinition extends AbstractSch
|
||||
// End of IOC
|
||||
//
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.action.scheduled.AbstractScheduledAction#getTrigger()
|
||||
*/
|
||||
@Override
|
||||
public Trigger getTrigger()
|
||||
{
|
||||
@@ -217,9 +214,6 @@ public class CronScheduledQueryBasedTemplateActionDefinition extends AbstractSch
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.action.scheduled.AbstractScheduledAction#getNodes()
|
||||
*/
|
||||
@Override
|
||||
public List<NodeRef> getNodes()
|
||||
{
|
||||
|
@@ -31,7 +31,7 @@ import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
import org.alfresco.repo.template.TemplateNode;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@@ -41,7 +41,7 @@ import org.alfresco.service.cmr.repository.datatype.Duration;
|
||||
import org.alfresco.service.cmr.search.ResultSet;
|
||||
import org.alfresco.service.cmr.search.SearchParameters;
|
||||
import org.springframework.extensions.surf.util.ISO8601DateFormat;
|
||||
|
||||
|
||||
import freemarker.template.TemplateDateModel;
|
||||
import freemarker.template.TemplateMethodModelEx;
|
||||
import freemarker.template.TemplateModelException;
|
||||
@@ -133,6 +133,7 @@ public class FreeMarkerWithLuceneExtensionsModelFactory implements TemplateActio
|
||||
*/
|
||||
private class QueryForSingleNodeFunction implements TemplateMethodModelEx
|
||||
{
|
||||
@SuppressWarnings("rawtypes")
|
||||
public Object exec(List args) throws TemplateModelException
|
||||
{
|
||||
if (args.size() == 3)
|
||||
@@ -218,7 +219,7 @@ public class FreeMarkerWithLuceneExtensionsModelFactory implements TemplateActio
|
||||
*/
|
||||
private static class LuceneDateRangeFunction implements TemplateMethodModelEx
|
||||
{
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public Object exec(List args) throws TemplateModelException
|
||||
{
|
||||
if (args.size() == 2)
|
||||
|
@@ -43,7 +43,6 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.repo.transaction.TransactionListenerAdapter;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionService;
|
||||
import org.alfresco.service.cmr.action.scheduled.SchedulableAction.IntervalPeriod;
|
||||
@@ -57,6 +56,7 @@ import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.alfresco.util.transaction.TransactionListenerAdapter;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.quartz.Job;
|
||||
|
@@ -25,17 +25,15 @@
|
||||
*/
|
||||
package org.alfresco.repo.action.script;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.jscript.BaseScopableProcessorExtension;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionTrackingService;
|
||||
import org.alfresco.service.cmr.action.ExecutionDetails;
|
||||
import org.alfresco.service.cmr.action.ExecutionSummary;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.jscript.BaseScopableProcessorExtension;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionTrackingService;
|
||||
import org.alfresco.service.cmr.action.ExecutionDetails;
|
||||
import org.alfresco.service.cmr.action.ExecutionSummary;
|
||||
|
||||
/**
|
||||
* Script object representing the action tracking service.
|
||||
@@ -44,8 +42,6 @@ import org.apache.commons.logging.LogFactory;
|
||||
*/
|
||||
public class ScriptActionTrackingService extends BaseScopableProcessorExtension
|
||||
{
|
||||
private static Log logger = LogFactory.getLog(ScriptActionTrackingService.class);
|
||||
|
||||
/** The Services registry */
|
||||
private ServiceRegistry serviceRegistry;
|
||||
private ActionTrackingService actionTrackingService;
|
||||
|
@@ -47,6 +47,7 @@ public final class ScriptExecutionDetails implements Serializable, Scopeable
|
||||
private static final long serialVersionUID = 3182925511891455490L;
|
||||
|
||||
/** Root scope for this object */
|
||||
@SuppressWarnings("unused")
|
||||
private Scriptable scope;
|
||||
|
||||
/** The details we wrap */
|
||||
@@ -57,8 +58,8 @@ public final class ScriptExecutionDetails implements Serializable, Scopeable
|
||||
|
||||
public ScriptExecutionDetails(ExecutionDetails details, ServiceRegistry services)
|
||||
{
|
||||
this.details = details;
|
||||
this.services = services;
|
||||
this.details = details;
|
||||
this.services = services;
|
||||
}
|
||||
|
||||
protected ExecutionDetails getExecutionDetails()
|
||||
|
Reference in New Issue
Block a user