public class BPMWorkflowManager extends AbstractLogEnabled implements Component, Serviceable, Initializable, Contextualizable, PluginAware
Constructor and Description |
---|
BPMWorkflowManager() |
Modifier and Type | Method and Description |
---|---|
private UserIdentity |
_convertJsonToUser(Map<String,Object> user) |
protected ModifiableTraversableAmetysObject |
_getProcessesRootNode(JCRWorkflow workflow,
boolean create)
Gets the root of processes of a workflow
|
protected Map<String,Object> |
_getWorkflowDefinitionData(String workflowDefId)
Get the list of variables and their properties for a workflow definition
|
private Map<? extends String,? extends Map<String,Object>> |
_getWorkflowDefinitionRegisters(Configuration[] registers) |
protected ModifiableTraversableAmetysObject |
_getWorkflowsRootNode(boolean create)
Gets the root of contents
|
private List<Map<String,Object>> |
_groups2Json(GroupIdentity[] groups) |
private Map<String,Object> |
_processToJson(JCRWorkflowProcess process) |
private void |
_setProcessValues(JCRWorkflowProcess process,
String title,
String site,
String description,
List<PartOnDisk> uploadedAttachments) |
private void |
_setWorkflowValues(JCRWorkflow workflow,
Map<String,Object> values) |
private Map<String,Object> |
_workflowToJson(JCRWorkflow workflow,
Map<String,Object> workflowDefinitionData) |
Map<String,Object> |
addWorkflow(Map<String,Object> values)
Add a new workflow
|
boolean |
canDelete(JCRWorkflowProcess process)
Determines if the process can be deleted by the current user
|
void |
contextualize(Context context) |
JCRWorkflowProcess |
createProcess(String workflowId,
String title,
String site,
String description,
List<PartOnDisk> uploadedAttachments)
Create a new process
|
void |
deleteProcess(JCRWorkflowProcess process)
Delete a process
|
Map<String,Object> |
deleteProcesses(List<String> processes)
Delete a list of processes
|
Map<String,Object> |
deleteWorkflow(List<String> workflowIds)
Delete a list of workflow
|
void |
editProcess(String processId,
String title,
String description,
List<PartOnDisk> uploadedAttachments,
List<String> attachmentsUntouched)
Edit a process
|
Map<String,Object> |
editWorkflow(String workflowId,
Map<String,Object> values)
Edit a workflow values
|
Page |
getCreateProcessPage(String siteName,
String lang)
Get the page with CREATE_PROCESS tag
|
Page |
getDashboardPage(String siteName,
String lang)
Get the page with PROCESS_DASHBOARD tag
|
JCRWorkflowProcess |
getProcess(String workflowName,
String processName)
Retrieve a process
|
String |
getProcessPageUrl(JCRWorkflowProcess process,
String siteName,
String lang,
boolean absolute)
Get the url of a process page
|
String |
getTemplateForProcessPage(String siteName,
String lang)
Get the template to use for process rendering
|
Set<JCRWorkflowProcess> |
getUserProcesses()
Get the list of processes accessibles to the current user
|
Map<String,Object> |
getWorkflowData(String workflowId)
Retrieve the data of a workflow, in JSON format.
|
Map<String,Object> |
getWorkflowDefinitions()
Get the list of workflow definitions
|
Map<String,Object> |
getWorkflowDefinitionVariables(String workflowDefId)
Retrieve the list of variables from a workflow definition
|
Map<String,Object> |
getWorkflowProcesses(String workflowId)
Retrieve the list of process created from a workflow
|
List<Object> |
getWorkflowProcessus(JCRWorkflow workflow)
Retrieve the list of process created from a workflow
|
Map<String,Object> |
getWorkflows()
Retrieve the list of workflows
|
List<Map<String,Object>> |
getWorkflowsAvailables()
Retrieve the list of workflows availables to the current user, in JSON format
|
Object |
getWorkflowVariable(String workflowId,
String variableName)
Retrieve the value of a variable from a workflow
|
void |
initialize() |
boolean |
isComplete(JCRWorkflowProcess process)
Determines if the process is complete
|
boolean |
isUserAllowedOnWorkflow(JCRWorkflow workflow)
Check if the current user is allowed to create a process from the workflow
|
boolean |
isUserInWorkflowVariables(JCRWorkflow workflow)
Test if the current user is present in any variable of the workflow
|
void |
service(ServiceManager manager) |
void |
setPluginInfo(String pluginName,
String featureName,
String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level. |
getLogger, setLogger
public static final String RIGHT_WORKFLOW_CREATE
public static final String RIGHT_WORKFLOW_EDIT
public static final String RIGHT_WORKFLOW_DELETE
public static final String RIGHTS_PROCESS_MANAGE_PROCESSES
public static final String PAGE_TAG_CREATEPROCESS
public static final String PAGE_TAG_PROCESS_DASHBOARD
public static final int WORKFLOW_ACTION_EDIT
public static final String BPM_ROOT_NODE
public static final String BPMWORKFLOW_ROOT_NODE
public static final String BPMPROCESSES_ROOT_NODE
private static final String _BPM_PROCESS_TEMPLATE
private AmetysObjectResolver _resolver
private WorkflowProvider _workflowProvider
private CurrentUserProvider _currentUserProvider
private RightManager _rightManager
private JSONUtils _jsonUtils
private UserHelper _userHelper
private AddOrUpdateResourceHelper _addOrUpdateResourceHelper
private WorkflowHelper _workflowHelper
private SkinsManager _skinsManager
private AmetysObjectResolver _ametysObjectResolver
private SiteManager _siteManager
private GroupManager _groupManager
private URIPrefixHandler _uriPrefixHandler
private String _pluginName
private I18nUtils _i18nUtils
public BPMWorkflowManager()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void initialize() throws Exception
initialize
in interface Initializable
Exception
public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic Map<String,Object> getWorkflowDefinitions()
public Object getWorkflowVariable(String workflowId, String variableName)
workflowId
- The workflow idvariableName
- The variable namepublic Map<String,Object> getWorkflowDefinitionVariables(String workflowDefId)
workflowDefId
- The workflow definition idpublic Map<String,Object> getWorkflows()
public List<Map<String,Object>> getWorkflowsAvailables()
public Map<String,Object> getWorkflowData(String workflowId)
workflowId
- The workflow idpublic Map<String,Object> addWorkflow(Map<String,Object> values) throws IllegalAccessException
values
- The values for the new workflow. Must contains a "name", "workflowDef" and any variables mandatory for the workflowDefIllegalAccessException
- If a user with insufficient rights try to execute this methodpublic Map<String,Object> editWorkflow(String workflowId, Map<String,Object> values) throws IllegalAccessException
workflowId
- The workflowvalues
- The valuesIllegalAccessException
- If a user with insufficient rights try to execute this methodpublic Map<String,Object> deleteWorkflow(List<String> workflowIds)
workflowIds
- The workflowspublic Map<String,Object> getWorkflowProcesses(String workflowId)
workflowId
- The workflowpublic List<Object> getWorkflowProcessus(JCRWorkflow workflow)
workflow
- The workflowpublic JCRWorkflowProcess createProcess(String workflowId, String title, String site, String description, List<PartOnDisk> uploadedAttachments) throws com.opensymphony.workflow.WorkflowException, IllegalAccessException
workflowId
- The workflow used by the processtitle
- The process titlesite
- The site on which the process was createddescription
- The process descriptionuploadedAttachments
- The process attachmentscom.opensymphony.workflow.WorkflowException
- If an error occurred creating the workflowIllegalAccessException
- If the user is not allowedpublic void editProcess(String processId, String title, String description, List<PartOnDisk> uploadedAttachments, List<String> attachmentsUntouched) throws com.opensymphony.workflow.WorkflowException
processId
- The process idtitle
- The titledescription
- The descriptionuploadedAttachments
- The list of new attachments uploadedattachmentsUntouched
- The list of untouched attachments namescom.opensymphony.workflow.WorkflowException
- If an error occurred while executing the workflow actionpublic JCRWorkflowProcess getProcess(String workflowName, String processName)
workflowName
- The workflow nameprocessName
- The process namepublic boolean isComplete(JCRWorkflowProcess process)
process
- The processpublic boolean canDelete(JCRWorkflowProcess process)
process
- The processpublic void deleteProcess(JCRWorkflowProcess process) throws IllegalAccessException
process
- The process to deleteIllegalAccessException
- If a user tries to delete a process without being allowedpublic Map<String,Object> deleteProcesses(List<String> processes) throws IllegalAccessException
processes
- The processes to deleteIllegalAccessException
- If a user tries to delete a process without being allowedpublic String getProcessPageUrl(JCRWorkflowProcess process, String siteName, String lang, boolean absolute)
process
- The processsiteName
- The current site name. Can not be null.lang
- The current language. Can not be null.absolute
- true to get absolute url.public Page getDashboardPage(String siteName, String lang)
siteName
- The current site namelang
- The languagepublic Page getCreateProcessPage(String siteName, String lang)
siteName
- The current site namelang
- The languagepublic String getTemplateForProcessPage(String siteName, String lang)
siteName
- The site containing the pagelang
- The sitemap of the pagepublic boolean isUserInWorkflowVariables(JCRWorkflow workflow)
workflow
- The workflowpublic Set<JCRWorkflowProcess> getUserProcesses()
public boolean isUserAllowedOnWorkflow(JCRWorkflow workflow)
workflow
- The workflowprivate void _setWorkflowValues(JCRWorkflow workflow, Map<String,Object> values)
private void _setProcessValues(JCRWorkflowProcess process, String title, String site, String description, List<PartOnDisk> uploadedAttachments)
private UserIdentity _convertJsonToUser(Map<String,Object> user)
private Map<String,Object> _workflowToJson(JCRWorkflow workflow, Map<String,Object> workflowDefinitionData)
private List<Map<String,Object>> _groups2Json(GroupIdentity[] groups)
protected ModifiableTraversableAmetysObject _getWorkflowsRootNode(boolean create)
create
- true
to create automatically the root when missing.UnknownAmetysObjectException
- If root node does not existprotected ModifiableTraversableAmetysObject _getProcessesRootNode(JCRWorkflow workflow, boolean create)
workflow
- The workflowcreate
- true
to create automatically the root when missing.UnknownAmetysObjectException
- If root node does not existprotected Map<String,Object> _getWorkflowDefinitionData(String workflowDefId)
workflowDefId
- The workflow definition idprivate Map<? extends String,? extends Map<String,Object>> _getWorkflowDefinitionRegisters(Configuration[] registers) throws ConfigurationException
ConfigurationException
private Map<String,Object> _processToJson(JCRWorkflowProcess process)