fr.paris.lutece.portal.service.workflow
Class WorkflowService

java.lang.Object
  extended by fr.paris.lutece.portal.service.workflow.WorkflowService

public final class WorkflowService
extends java.lang.Object

WorkflowService


Method Summary
 boolean canProcessAction(int nIdResource, java.lang.String strResourceType, int nIdAction, java.lang.Integer nExternalParentId, javax.servlet.http.HttpServletRequest request, boolean bIsAutomatic)
          Check if the action can be proceed for the given resource
 void doProcessAction(int nIdResource, java.lang.String strResourceType, int nIdAction, javax.servlet.http.HttpServletRequest request, java.util.Locale locale, boolean isAutomatic)
          Deprecated. 
 void doProcessAction(int nIdResource, java.lang.String strResourceType, int nIdAction, java.lang.Integer nExternalParentId, javax.servlet.http.HttpServletRequest request, java.util.Locale locale, boolean isAutomatic)
          Proceed action given in parameter
 void doRemoveWorkFlowResource(int nIdResource, java.lang.String strResourceType)
          Remove in all workflows the resource specified in parameter
 void doRemoveWorkFlowResourceByListId(java.util.List<java.lang.Integer> lListIdResource, java.lang.String strResourceType, java.lang.Integer nIdWorflow)
          Remove list of resource workflow by list id
 java.lang.String doSaveTasksForm(int nIdResource, java.lang.String strResourceType, int nIdAction, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
          Deprecated. 
 java.lang.String doSaveTasksForm(int nIdResource, java.lang.String strResourceType, int nIdAction, java.lang.Integer nExternalParentId, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
          Perform the information on the various tasks associated with the given action specified in parameter
 void executeActionAutomatic(int nIdResource, java.lang.String strResourceType, int nIdWorkflow)
          Deprecated. 
 void executeActionAutomatic(int nIdResource, java.lang.String strResourceType, int nIdWorkflow, java.lang.Integer nExternalParentId)
          Execute action automatic
 java.util.Collection<Action> getActions(int nIdResource, java.lang.String strResourceType, int nIdWorkflow, AdminUser user)
          returns a list of actions possible for a given document based on the status of the document in the workflow and the user role
 java.util.HashMap<java.lang.Integer,java.util.List<Action>> getActions(java.util.List<java.lang.Integer> listIdResssource, java.lang.String strResourceType, java.lang.Integer nIdExternalParentId, int nIdWorkflow, AdminUser user)
          returns a list of actions possible for a given document based on the status of the document in the workflow and the user role
 java.util.Collection<State> getAllStateByWorkflow(int nListIdWorkflow, AdminUser user)
          returns all state of a given workflow
 java.util.List<java.lang.Integer> getAuthorizedResourceList(java.lang.String strResourceType, int nIdWorkflow, int nIdWorkflowState, AdminUser user)
          Deprecated. 
 java.util.List<java.lang.Integer> getAuthorizedResourceList(java.lang.String strResourceType, int nIdWorkflow, int nIdWorkflowState, java.lang.Integer nExternalParentId, AdminUser user)
          Get all authorized resource Id
 java.util.List<java.lang.Integer> getAuthorizedResourceList(java.lang.String strResourceType, int nIdWorkflow, java.util.List<java.lang.Integer> lListIdWorkflowState, java.lang.Integer nExternalParentId, AdminUser user)
          Get all authorized resource Id by list of state
 java.lang.String getDisplayDocumentHistory(int nIdResource, java.lang.String strResourceType, int nIdWorkflow, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
          returns the actions history performed on a resource
 java.lang.String getDisplayTasksForm(int nIdResource, java.lang.String strResourceType, int nIdAction, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
          returns the tasks form
 java.lang.String getDocumentHistoryXml(int nIdResource, java.lang.String strResourceType, int nIdWorkflow, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
          returns a xml wich contains the actions history performed on a resource
static WorkflowService getInstance()
          Returns the unique instance of the service
 java.util.Collection<java.lang.Integer> getListIdRessourceByState(int nIdState, java.lang.String strResource, AdminUser user)
          Deprecated. 
 java.util.List<Action> getMassActions(int nIdWorkflow)
          Get the list of mass actions from a given id workflow
 State getState(int nIdResource, java.lang.String strResourceType, int nIdWorkflow, AdminUser user)
          Deprecated. 
 State getState(int nIdResource, java.lang.String strResourceType, int nIdWorkflow, java.lang.Integer nIdExternalParentId, AdminUser user)
          returns the state of a given document of the document in the workflow and the user role
 ReferenceList getWorkflowsEnabled(AdminUser user, java.util.Locale locale)
          return a reference list which contains a list enabled workflow
 boolean isAuthorized(int nIdResource, java.lang.String strResourceType, int nIdWorkflow, AdminUser user)
          Check that a given user is allowed to view a resource depending the state of the resource
 boolean isAvailable()
           
 boolean isDisplayTasksForm(int nIdAction, java.util.Locale locale)
          return true if a form is associate to the action
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static WorkflowService getInstance()
Returns the unique instance of the service

Returns:
The instance of the service

isAvailable

public boolean isAvailable()
Returns:
true if the workflow service is available

getActions

public java.util.Collection<Action> getActions(int nIdResource,
                                               java.lang.String strResourceType,
                                               int nIdWorkflow,
                                               AdminUser user)
returns a list of actions possible for a given document based on the status of the document in the workflow and the user role

Parameters:
nIdResource - the document id
strResourceType - the document type
user - the adminUser
nIdWorkflow - the workflow id
Returns:
a list of Action

getActions

public java.util.HashMap<java.lang.Integer,java.util.List<Action>> getActions(java.util.List<java.lang.Integer> listIdResssource,
                                                                              java.lang.String strResourceType,
                                                                              java.lang.Integer nIdExternalParentId,
                                                                              int nIdWorkflow,
                                                                              AdminUser user)
returns a list of actions possible for a given document based on the status of the document in the workflow and the user role

Parameters:
listIdResssource - the list of resource id
strResourceType - the document type
nIdExternalParentId - the external parent identifier
nIdWorkflow - the workflow id
user - the adminUser
Returns:
a list of Action

isDisplayTasksForm

public boolean isDisplayTasksForm(int nIdAction,
                                  java.util.Locale locale)
return true if a form is associate to the action

Parameters:
nIdAction - the action id
locale - the loacle
Returns:
true if a form is associate to the action

doProcessAction

@Deprecated
public void doProcessAction(int nIdResource,
                                       java.lang.String strResourceType,
                                       int nIdAction,
                                       javax.servlet.http.HttpServletRequest request,
                                       java.util.Locale locale,
                                       boolean isAutomatic)
Deprecated. 

Proceed action given in parameter

Parameters:
nIdResource - the resource id
strResourceType - the resource type
request - the request
nIdAction - the action id
locale - locale
isAutomatic - the boolean

doProcessAction

public void doProcessAction(int nIdResource,
                            java.lang.String strResourceType,
                            int nIdAction,
                            java.lang.Integer nExternalParentId,
                            javax.servlet.http.HttpServletRequest request,
                            java.util.Locale locale,
                            boolean isAutomatic)
Proceed action given in parameter

Parameters:
nIdResource - the resource id
strResourceType - the resource type
nIdAction - the action id
nExternalParentId - the external parent id
request - the request
locale - locale
isAutomatic - Is automatic

getDisplayDocumentHistory

public java.lang.String getDisplayDocumentHistory(int nIdResource,
                                                  java.lang.String strResourceType,
                                                  int nIdWorkflow,
                                                  javax.servlet.http.HttpServletRequest request,
                                                  java.util.Locale locale)
returns the actions history performed on a resource

Parameters:
nIdResource - the resource id
strResourceType - the resource type
request - the request
nIdWorkflow - the workflow id
locale - the locale
Returns:
the history of actions performed on a resource

getDocumentHistoryXml

public java.lang.String getDocumentHistoryXml(int nIdResource,
                                              java.lang.String strResourceType,
                                              int nIdWorkflow,
                                              javax.servlet.http.HttpServletRequest request,
                                              java.util.Locale locale)
returns a xml wich contains the actions history performed on a resource

Parameters:
nIdResource - the resource id
strResourceType - the resource type
request - the request
nIdWorkflow - the workflow id
locale - the locale
Returns:
a xml wich contains the history of actions performed on a resource

doSaveTasksForm

@Deprecated
public java.lang.String doSaveTasksForm(int nIdResource,
                                                   java.lang.String strResourceType,
                                                   int nIdAction,
                                                   javax.servlet.http.HttpServletRequest request,
                                                   java.util.Locale locale)
Deprecated. 

Perform the information on the various tasks associated with the given action specified in parameter

Parameters:
nIdResource - the resource id
strResourceType - the resource type
request - the request
nIdAction - the action id
locale - the locale
Returns:
null if there is no error in the task form else return the error message url

doSaveTasksForm

public java.lang.String doSaveTasksForm(int nIdResource,
                                        java.lang.String strResourceType,
                                        int nIdAction,
                                        java.lang.Integer nExternalParentId,
                                        javax.servlet.http.HttpServletRequest request,
                                        java.util.Locale locale)
Perform the information on the various tasks associated with the given action specified in parameter

Parameters:
nIdResource - the resource id
strResourceType - the resource type
nExternalParentId - the external parent id
request - the request
nIdAction - the action id
locale - the locale
Returns:
null if there is no error in the task form else return the error message url

doRemoveWorkFlowResource

public void doRemoveWorkFlowResource(int nIdResource,
                                     java.lang.String strResourceType)
Remove in all workflows the resource specified in parameter

Parameters:
nIdResource - the resource id
strResourceType - the resource type

doRemoveWorkFlowResourceByListId

public void doRemoveWorkFlowResourceByListId(java.util.List<java.lang.Integer> lListIdResource,
                                             java.lang.String strResourceType,
                                             java.lang.Integer nIdWorflow)
Remove list of resource workflow by list id

Parameters:
lListIdResource - list of id resource
strResourceType - the ressource type
nIdWorflow - the workflow id

getDisplayTasksForm

public java.lang.String getDisplayTasksForm(int nIdResource,
                                            java.lang.String strResourceType,
                                            int nIdAction,
                                            javax.servlet.http.HttpServletRequest request,
                                            java.util.Locale locale)
returns the tasks form

Parameters:
nIdResource - the document id
strResourceType - the document type
request - the request
nIdAction - the action id
locale - the locale
Returns:
the tasks form associated to the action

isAuthorized

public boolean isAuthorized(int nIdResource,
                            java.lang.String strResourceType,
                            int nIdWorkflow,
                            AdminUser user)
Check that a given user is allowed to view a resource depending the state of the resource

Parameters:
nIdResource - the document id
strResourceType - the document type
user - the AdminUser
nIdWorkflow - the workflow id
Returns:
a list of Action

getAuthorizedResourceList

@Deprecated
public java.util.List<java.lang.Integer> getAuthorizedResourceList(java.lang.String strResourceType,
                                                                              int nIdWorkflow,
                                                                              int nIdWorkflowState,
                                                                              AdminUser user)
Deprecated. 

Get all authorized resource Id

Parameters:
strResourceType - the resource type
nIdWorkflow - the workflow id
nIdWorkflowState - The workflow state id or -1 for all workflow states
user - the AdminUser
Returns:
a list resource id

getAuthorizedResourceList

public java.util.List<java.lang.Integer> getAuthorizedResourceList(java.lang.String strResourceType,
                                                                   int nIdWorkflow,
                                                                   int nIdWorkflowState,
                                                                   java.lang.Integer nExternalParentId,
                                                                   AdminUser user)
Get all authorized resource Id

Parameters:
strResourceType - the resource type
nIdWorkflow - the workflow id
nIdWorkflowState - The workflow state id or -1 for all workflow states
nExternalParentId - The external parent id
user - the AdminUser
Returns:
a list resource id

getAuthorizedResourceList

public java.util.List<java.lang.Integer> getAuthorizedResourceList(java.lang.String strResourceType,
                                                                   int nIdWorkflow,
                                                                   java.util.List<java.lang.Integer> lListIdWorkflowState,
                                                                   java.lang.Integer nExternalParentId,
                                                                   AdminUser user)
Get all authorized resource Id by list of state

Parameters:
strResourceType - the resource type
nIdWorkflow - the workflow id
lListIdWorkflowState - The workflow state id or null for all workflow states
nExternalParentId - the externbal parent identifier
user - the AdminUser
Returns:
a list resource id

getWorkflowsEnabled

public ReferenceList getWorkflowsEnabled(AdminUser user,
                                         java.util.Locale locale)
return a reference list which contains a list enabled workflow

Parameters:
user - the AdminUser
locale - the locale
Returns:
a reference list which contains a list enabled workflow

getAllStateByWorkflow

public java.util.Collection<State> getAllStateByWorkflow(int nListIdWorkflow,
                                                         AdminUser user)
returns all state of a given workflow

Parameters:
user - the adminUser
nListIdWorkflow - the workflow id
Returns:
the state of a given document

getListIdRessourceByState

@Deprecated
public java.util.Collection<java.lang.Integer> getListIdRessourceByState(int nIdState,
                                                                                    java.lang.String strResource,
                                                                                    AdminUser user)
Deprecated. 

WRONG : need to filter on workflow id Returns a list which contains idResource for a given filter

Parameters:
nIdState - the id State
strResource - the name of resource
user - the AdminUser
Returns:
a list which contains idRessource

getState

@Deprecated
public State getState(int nIdResource,
                                 java.lang.String strResourceType,
                                 int nIdWorkflow,
                                 AdminUser user)
Deprecated. 

returns the state of a given document of the document in the workflow and the user role

Parameters:
nIdResource - the document id
strResourceType - the document type
user - the adminUser
nIdWorkflow - the workflow id
Returns:
the state of a given document

getState

public State getState(int nIdResource,
                      java.lang.String strResourceType,
                      int nIdWorkflow,
                      java.lang.Integer nIdExternalParentId,
                      AdminUser user)
returns the state of a given document of the document in the workflow and the user role

Parameters:
nIdResource - the document id
strResourceType - the document type
nIdWorkflow - the workflow id
nIdExternalParentId - the external parent id
user - the adminUser
Returns:
the state of a given document

executeActionAutomatic

public void executeActionAutomatic(int nIdResource,
                                   java.lang.String strResourceType,
                                   int nIdWorkflow,
                                   java.lang.Integer nExternalParentId)
Execute action automatic

Parameters:
nIdResource - the document id
strResourceType - the document type
nIdWorkflow - the workflow id
nExternalParentId - the external parent id

executeActionAutomatic

@Deprecated
public void executeActionAutomatic(int nIdResource,
                                              java.lang.String strResourceType,
                                              int nIdWorkflow)
Deprecated. 

Execute action automatic

Parameters:
nIdResource - the document id
strResourceType - the document type
nIdWorkflow - the workflow id

getMassActions

public java.util.List<Action> getMassActions(int nIdWorkflow)
Get the list of mass actions from a given id workflow

Parameters:
nIdWorkflow - the id workflow
Returns:
the list of mass actions

canProcessAction

public boolean canProcessAction(int nIdResource,
                                java.lang.String strResourceType,
                                int nIdAction,
                                java.lang.Integer nExternalParentId,
                                javax.servlet.http.HttpServletRequest request,
                                boolean bIsAutomatic)
Check if the action can be proceed for the given resource

Parameters:
nIdResource - the id resource
strResourceType - the resource type
nIdAction - the id action
nExternalParentId - the external parent id
request - the HTTP request
bIsAutomatic - is automatic action
Returns:
true if the action can proceed, false otherwise


Copyright © 2011 Mairie de Paris. All Rights Reserved.