mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Reverse Merge HEAD (5.0/Cloud)
<< Appears to be cause of 7 failures in https://bamboo.alfresco.com/bamboo/browse/ALF-ENT-150 >> 86040: ACE-2173 : EOL RMI Services git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@86050 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -0,0 +1,265 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.alfresco.repo.action;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ActionCondition;
|
||||
import org.alfresco.service.cmr.action.ActionConditionDefinition;
|
||||
import org.alfresco.service.cmr.action.ActionDefinition;
|
||||
import org.alfresco.service.cmr.action.ActionService;
|
||||
import org.alfresco.service.cmr.action.ActionServiceTransport;
|
||||
import org.alfresco.service.cmr.action.CompositeAction;
|
||||
import org.alfresco.service.cmr.action.ParameterConstraint;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.security.AuthenticationService;
|
||||
|
||||
/**
|
||||
* Server side implementation for transport of ActionService.
|
||||
* @author britt
|
||||
*/
|
||||
public class ActionServiceTransportImpl implements ActionServiceTransport
|
||||
{
|
||||
private ActionService fActionService;
|
||||
|
||||
private AuthenticationService fAuthenticationService;
|
||||
|
||||
public void setActionService(ActionService service)
|
||||
{
|
||||
fActionService = service;
|
||||
}
|
||||
|
||||
public void setAuthenticationService(AuthenticationService service)
|
||||
{
|
||||
fAuthenticationService = service;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#createAction(java.lang.String, java.lang.String)
|
||||
*/
|
||||
public Action createAction(String ticket, String name)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.createAction(name);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#createAction(java.lang.String, java.lang.String, java.util.Map)
|
||||
*/
|
||||
public Action createAction(String ticket, String name,
|
||||
Map<String, Serializable> params)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.createAction(name, params);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#createActionCondition(java.lang.String, java.lang.String)
|
||||
*/
|
||||
public ActionCondition createActionCondition(String ticket, String name)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.createActionCondition(name);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#createActionCondition(java.lang.String, java.lang.String, java.util.Map)
|
||||
*/
|
||||
public ActionCondition createActionCondition(String ticket, String name,
|
||||
Map<String, Serializable> params)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.createActionCondition(name, params);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#createCompositeAction(java.lang.String)
|
||||
*/
|
||||
public CompositeAction createCompositeAction(String ticket)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.createCompositeAction();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#evaluateAction(java.lang.String, org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public boolean evaluateAction(String ticket, Action action,
|
||||
NodeRef actionedUponNodeRef)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.evaluateAction(action, actionedUponNodeRef);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#evaluateActionCondition(java.lang.String, org.alfresco.service.cmr.action.ActionCondition, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public boolean evaluateActionCondition(String ticket,
|
||||
ActionCondition condition, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.evaluateActionCondition(condition, actionedUponNodeRef);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#executeAction(java.lang.String, org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public void executeAction(String ticket, Action action,
|
||||
NodeRef actionedUponNodeRef)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
fActionService.executeAction(action, actionedUponNodeRef);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#executeAction(java.lang.String, org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef, boolean)
|
||||
*/
|
||||
public void executeAction(String ticket, Action action,
|
||||
NodeRef actionedUponNodeRef, boolean checkConditions)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
fActionService.executeAction(action, actionedUponNodeRef, checkConditions);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#executeAction(java.lang.String, org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef, boolean, boolean)
|
||||
*/
|
||||
public void executeAction(String ticket, Action action,
|
||||
NodeRef actionedUponNodeRef, boolean checkConditions,
|
||||
boolean executeAsynchronously)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
fActionService.executeAction(action, actionedUponNodeRef, checkConditions, executeAsynchronously);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getAction(java.lang.String, org.alfresco.service.cmr.repository.NodeRef, java.lang.String)
|
||||
*/
|
||||
public Action getAction(String ticket, NodeRef nodeRef, String actionId)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getAction(nodeRef, actionId);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getActionConditionDefinition(java.lang.String, java.lang.String)
|
||||
*/
|
||||
public ActionConditionDefinition getActionConditionDefinition(
|
||||
String ticket, String name)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getActionConditionDefinition(name);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getActionConditionDefinitions(java.lang.String)
|
||||
*/
|
||||
public List<ActionConditionDefinition> getActionConditionDefinitions(
|
||||
String ticket)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getActionConditionDefinitions();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getActionDefinition(java.lang.String, java.lang.String)
|
||||
*/
|
||||
public ActionDefinition getActionDefinition(String ticket, String name)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getActionDefinition(name);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getActionDefinitions(java.lang.String)
|
||||
*/
|
||||
public List<ActionDefinition> getActionDefinitions(String ticket)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getActionDefinitions();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getActionDefinitions(java.lang.String, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public List<ActionDefinition> getActionDefinitions(String ticket,
|
||||
NodeRef nodeRef)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getActionDefinitions(nodeRef);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getParameterConstraint(java.lang.String, java.lang.String)
|
||||
*/
|
||||
public ParameterConstraint getParameterConstraint(String ticket, String name)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getParameterConstraint(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getParameterConstraints(java.lang.String)
|
||||
*/
|
||||
public List<ParameterConstraint> getParameterConstraints(String ticket)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getParameterConstraints();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#getActions(java.lang.String, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public List<Action> getActions(String ticket, NodeRef nodeRef)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
return fActionService.getActions(nodeRef);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#removeAction(java.lang.String, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.action.Action)
|
||||
*/
|
||||
public void removeAction(String ticket, NodeRef nodeRef, Action action)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
fActionService.removeAction(nodeRef, action);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#removeAllActions(java.lang.String, org.alfresco.service.cmr.repository.NodeRef)
|
||||
*/
|
||||
public void removeAllActions(String ticket, NodeRef nodeRef)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
fActionService.removeAllActions(nodeRef);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.action.ActionServiceTransport#saveAction(java.lang.String, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.action.Action)
|
||||
*/
|
||||
public void saveAction(String ticket, NodeRef nodeRef, Action action)
|
||||
{
|
||||
fAuthenticationService.validate(ticket);
|
||||
fActionService.saveAction(nodeRef, action);
|
||||
}
|
||||
}
|
@@ -0,0 +1,240 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.alfresco.service.cmr.action;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
|
||||
/**
|
||||
* This is the interface for over the transport of ActionService.
|
||||
* It's job is to tunnel an authentication token for each call.
|
||||
* @author britt
|
||||
*/
|
||||
public interface ActionServiceTransport
|
||||
{
|
||||
/**
|
||||
* Get a named action definition
|
||||
*
|
||||
* @param name the name of the action definition
|
||||
* @return the action definition
|
||||
*/
|
||||
ActionDefinition getActionDefinition(String ticket, String name);
|
||||
|
||||
/**
|
||||
* Get all the action definitions
|
||||
*
|
||||
* @return the list action definitions
|
||||
*/
|
||||
List<ActionDefinition> getActionDefinitions(String ticket);
|
||||
|
||||
/**
|
||||
* Get all the action definitions that are applicable for the given node, based on
|
||||
* its type and aspects.
|
||||
*
|
||||
* @param nodeRef the node reference
|
||||
* @return a list of applicable action definitions
|
||||
*/
|
||||
List<ActionDefinition> getActionDefinitions(String ticket, NodeRef nodeRef);
|
||||
|
||||
/**
|
||||
* Get a named action condition definition
|
||||
*
|
||||
* @param name the name of the action condition definition
|
||||
* @return the action condition definition
|
||||
*/
|
||||
ActionConditionDefinition getActionConditionDefinition(String ticket, String name);
|
||||
|
||||
/**
|
||||
* Get all the action condition definitions
|
||||
*
|
||||
* @return the list of action condition definitions
|
||||
*/
|
||||
List<ActionConditionDefinition> getActionConditionDefinitions(String ticket);
|
||||
|
||||
/**
|
||||
* Get a named parameter constraint
|
||||
*
|
||||
* @param name the name of the parameter constraint
|
||||
* @return this parameter condition
|
||||
*/
|
||||
ParameterConstraint getParameterConstraint(String ticket, String name);
|
||||
|
||||
/**
|
||||
* Get all the parameter constraints
|
||||
*
|
||||
* @return the list of all parameter constraints
|
||||
*/
|
||||
List<ParameterConstraint> getParameterConstraints(String ticket);
|
||||
|
||||
/**
|
||||
* Create a new action
|
||||
*
|
||||
* @param name the action definition name
|
||||
* @return the action
|
||||
*/
|
||||
Action createAction(String ticket, String name);
|
||||
|
||||
/**
|
||||
* Create a new action specifying the initial set of parameter values
|
||||
*
|
||||
* @param name the action definition name
|
||||
* @param params the parameter values
|
||||
* @return the action
|
||||
*/
|
||||
Action createAction(String ticket, String name, Map<String, Serializable> params);
|
||||
|
||||
/**
|
||||
* Create a composite action
|
||||
*
|
||||
* @return the composite action
|
||||
*/
|
||||
CompositeAction createCompositeAction(String ticket);
|
||||
|
||||
/**
|
||||
* Create an action condition
|
||||
*
|
||||
* @param name the action condition definition name
|
||||
* @return the action condition
|
||||
*/
|
||||
ActionCondition createActionCondition(String ticket, String name);
|
||||
|
||||
/**
|
||||
* Create an action condition specifying the initial set of parameter values
|
||||
*
|
||||
* @param name the action condition definition name
|
||||
* @param params the parameter values
|
||||
* @return the action condition
|
||||
*/
|
||||
ActionCondition createActionCondition(String ticket, String name, Map<String, Serializable> params);
|
||||
|
||||
/**
|
||||
* The actions conditions are always checked.
|
||||
*
|
||||
* @see ActionService#executeAction(Action, NodeRef, boolean)
|
||||
*
|
||||
* @param action the action
|
||||
* @param actionedUponNodeRef the actioned upon node reference
|
||||
*/
|
||||
void executeAction(String ticket, Action action, NodeRef actionedUponNodeRef);
|
||||
|
||||
/**
|
||||
* The action is executed based on the asynchronous attribute of the action.
|
||||
*
|
||||
* @see ActionService#executeAction(Action, NodeRef, boolean, boolean)
|
||||
*
|
||||
* @param action the action
|
||||
* @param actionedUponNodeRef the actioned upon node reference
|
||||
* @param checkConditions indicates whether the conditions should be checked
|
||||
*/
|
||||
void executeAction(String ticket, Action action, NodeRef actionedUponNodeRef, boolean checkConditions);
|
||||
|
||||
/**
|
||||
* Executes the specified action upon the node reference provided.
|
||||
* <p>
|
||||
* If specified that the conditions should be checked then any conditions
|
||||
* set on the action are evaluated.
|
||||
* <p>
|
||||
* If the conditions fail then the action is not executed.
|
||||
* <p>
|
||||
* If an action has no conditions then the action will always be executed.
|
||||
* <p>
|
||||
* If the conditions are not checked then the action will always be executed.
|
||||
*
|
||||
* @param action the action
|
||||
* @param actionedUponNodeRef the actioned upon node reference
|
||||
* @param checkConditions indicates whether the conditions should be checked before
|
||||
* executing the action
|
||||
* @param executeAsynchronously indicates whether the action should be executed asychronously or not, this value overrides
|
||||
* the value set on the action its self
|
||||
*/
|
||||
void executeAction(String ticket, Action action, NodeRef actionedUponNodeRef, boolean checkConditions, boolean executeAsynchronously);
|
||||
|
||||
/**
|
||||
* Evaluted the conditions set on an action.
|
||||
* <p>
|
||||
* Returns true if the action has no conditions.
|
||||
* <p>
|
||||
* If the action has more than one condition their results are combined using the 'AND'
|
||||
* logical operator.
|
||||
*
|
||||
* @param action the action
|
||||
* @param actionedUponNodeRef the actioned upon node reference
|
||||
* @return true if the condition succeeds, false otherwise
|
||||
*/
|
||||
boolean evaluateAction(String ticket, Action action, NodeRef actionedUponNodeRef);
|
||||
|
||||
/**
|
||||
* Evaluate an action condition.
|
||||
*
|
||||
* @param condition the action condition
|
||||
* @param actionedUponNodeRef the actioned upon node reference
|
||||
* @return true if the condition succeeds, false otherwise
|
||||
*/
|
||||
boolean evaluateActionCondition(String ticket, ActionCondition condition, NodeRef actionedUponNodeRef);
|
||||
|
||||
/**
|
||||
* Save an action against a node reference.
|
||||
* <p>
|
||||
* The node will be made configurable if it is not already.
|
||||
* <p>
|
||||
* If the action already exists then its details will be updated.
|
||||
*
|
||||
* @param nodeRef the node reference
|
||||
* @param action the action
|
||||
*/
|
||||
void saveAction(String ticket, NodeRef nodeRef, Action action);
|
||||
|
||||
/**
|
||||
* Gets all the actions currently saved on the given node reference.
|
||||
*
|
||||
* @param nodeRef the node reference
|
||||
* @return the list of actions
|
||||
*/
|
||||
List<Action> getActions(String ticket, NodeRef nodeRef);
|
||||
|
||||
/**
|
||||
* Gets an action stored against a given node reference.
|
||||
* <p>
|
||||
* Returns null if the action can not be found.
|
||||
*
|
||||
* @param nodeRef the node reference
|
||||
* @param actionId the action id
|
||||
* @return the action
|
||||
*/
|
||||
Action getAction(String ticket, NodeRef nodeRef, String actionId);
|
||||
|
||||
/**
|
||||
* Removes an action associated with a node reference.
|
||||
*
|
||||
* @param nodeRef the node reference
|
||||
* @param action the action
|
||||
*/
|
||||
void removeAction(String ticket, NodeRef nodeRef, Action action);
|
||||
|
||||
/**
|
||||
* Removes all actions associated with a node reference
|
||||
*
|
||||
* @param nodeRef the node reference
|
||||
*/
|
||||
void removeAllActions(String ticket, NodeRef nodeRef);
|
||||
}
|
Reference in New Issue
Block a user