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

java.lang.Object
  extended by fr.paris.lutece.plugins.workflow.service.WorkflowService
All Implemented Interfaces:
fr.paris.lutece.portal.service.workflow.IWorkflowService

public class WorkflowService
extends java.lang.Object
implements fr.paris.lutece.portal.service.workflow.IWorkflowService

WorkflowService


Method Summary
 boolean canProcessAction(int nIdResource, java.lang.String strResourceType, int nIdAction, java.lang.Integer nExternalParentId, javax.servlet.http.HttpServletRequest request, boolean bIsAutomatic)
          
 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 doRemoveWorkFlowResource(int nIdResource, java.lang.String strResourceType, int nIdWorkflow)
          Remove in the workflow the resource specified in parameter
 void doRemoveWorkFlowResourceByListId(java.util.List<java.lang.Integer> lListIdResource, java.lang.String strResourceType, java.lang.Integer nIdWorflow)
           
 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<fr.paris.lutece.portal.business.workflow.Action> getActions(int nIdResource, java.lang.String strResourceType, int nIdWorkflow, fr.paris.lutece.portal.business.user.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<fr.paris.lutece.portal.business.workflow.Action>> getActions(java.util.List<java.lang.Integer> listIdResssource, java.lang.String strResourceType, java.lang.Integer nIdExternalParentId, int nIdWorkflow, fr.paris.lutece.portal.business.user.AdminUser user)
           
 java.util.Collection<fr.paris.lutece.portal.business.workflow.State> getAllStateByWorkflow(int nIdWorkflow, fr.paris.lutece.portal.business.user.AdminUser user)
          returns all state of a given the workflow
 java.util.List<java.lang.Integer> getAuthorizedResourceList(java.lang.String strResourceType, int nIdWorkflow, int nIdWorkflowState, fr.paris.lutece.portal.business.user.AdminUser user)
          Deprecated. 
 java.util.List<java.lang.Integer> getAuthorizedResourceList(java.lang.String strResourceType, int nIdWorkflow, int nIdWorkflowState, java.lang.Integer nExternalParentId, fr.paris.lutece.portal.business.user.AdminUser user)
           
 java.util.List<java.lang.Integer> getAuthorizedResourceList(java.lang.String strResourceType, int nIdWorkflow, java.util.List<java.lang.Integer> lListIdWorkflowState, java.lang.Integer nExternalParentId, fr.paris.lutece.portal.business.user.AdminUser user)
           
 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 which contains the actions history performed on a resource
static WorkflowService getInstance()
          Returns the instance of the singleton
 java.util.Collection<java.lang.Integer> getListIdRessourceByState(int nIdState, java.lang.String strResourceType, fr.paris.lutece.portal.business.user.AdminUser user)
          Deprecated. 
 java.util.Map<java.lang.String,java.lang.Object> getManageAdvancedParameters(fr.paris.lutece.portal.business.user.AdminUser user)
          Build the advanced parameters management
 java.util.List<fr.paris.lutece.portal.business.workflow.Action> getMassActions(int nIdWorkflow)
          
 fr.paris.lutece.util.ReferenceList getRefListTaskType(java.util.Locale locale)
          Return a reference list wich contains the task types
 fr.paris.lutece.portal.business.workflow.State getState(int nIdResource, java.lang.String strResourceType, int nIdWorkflow, fr.paris.lutece.portal.business.user.AdminUser user)
          Deprecated. 
 fr.paris.lutece.portal.business.workflow.State getState(int nIdResource, java.lang.String strResourceType, int nIdWorkflow, java.lang.Integer nIdExternalParentId, fr.paris.lutece.portal.business.user.AdminUser user)
          returns the state of a given document of the document in the workflow and the user role
 ITask getTaskInstance(java.lang.String strKey, java.util.Locale locale)
          return an instance of Task Object depending on the task type
 java.util.Collection<ITaskType> getTaskTypeList()
           
 fr.paris.lutece.util.ReferenceList getWorkflowsEnabled(fr.paris.lutece.portal.business.user.AdminUser user, java.util.Locale locale)
          return a referencelist wich contains a list enabled workflow
 void init()
          Initialize the workflow service
 boolean isAuthorized(int nIdResource, java.lang.String strResourceType, int nIdWorkflow, fr.paris.lutece.portal.business.user.AdminUser user)
          Check that a given user is allowed to view a resource depending the state of the resource
 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

init

public void init()
Initialize the workflow service


getInstance

public static WorkflowService getInstance()
Returns the instance of the singleton

Returns:
The instance of the singleton

getActions

public java.util.HashMap<java.lang.Integer,java.util.List<fr.paris.lutece.portal.business.workflow.Action>> getActions(java.util.List<java.lang.Integer> listIdResssource,
                                                                                                                       java.lang.String strResourceType,
                                                                                                                       java.lang.Integer nIdExternalParentId,
                                                                                                                       int nIdWorkflow,
                                                                                                                       fr.paris.lutece.portal.business.user.AdminUser user)
Specified by:
getActions in interface fr.paris.lutece.portal.service.workflow.IWorkflowService

getActions

public java.util.Collection<fr.paris.lutece.portal.business.workflow.Action> getActions(int nIdResource,
                                                                                        java.lang.String strResourceType,
                                                                                        int nIdWorkflow,
                                                                                        fr.paris.lutece.portal.business.user.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

Specified by:
getActions in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
nIdResource - the document id
strResourceType - the document type
user - the adminUser
nIdWorkflow - the workflow id
Returns:
a list of Action

getState

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

Specified by:
getState in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
nIdResource - the document id
strResourceType - the document type
user - the adminUser
nIdWorkflow - the workflow id
nIdExternalParentId - the external parent id
Returns:
the state of a given document

getState

@Deprecated
public fr.paris.lutece.portal.business.workflow.State getState(int nIdResource,
                                                                          java.lang.String strResourceType,
                                                                          int nIdWorkflow,
                                                                          fr.paris.lutece.portal.business.user.AdminUser user)
Deprecated. 

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

Specified by:
getState in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
nIdResource - the document id
strResourceType - the document type
user - the adminUser
nIdWorkflow - the workflow id
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

Specified by:
executeActionAutomatic in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
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

Specified by:
executeActionAutomatic in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
nIdResource - the document id
strResourceType - the document type
nIdWorkflow - the workflow id

getAllStateByWorkflow

public java.util.Collection<fr.paris.lutece.portal.business.workflow.State> getAllStateByWorkflow(int nIdWorkflow,
                                                                                                  fr.paris.lutece.portal.business.user.AdminUser user)
returns all state of a given the workflow

Specified by:
getAllStateByWorkflow in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
user - the adminUser
nIdWorkflow - the workflow id
Returns:
the state of a given document

isDisplayTasksForm

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

Specified by:
isDisplayTasksForm in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
nIdAction - the action id
locale - the loacle
Returns:
true if a form is associate to the action

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

Specified by:
doProcessAction in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
nIdResource - the resource id
strResourceType - the resource type
request - the request
nIdAction - the action id
nExternalParentId - the external parent id
isAutomatic - is automatic action
locale - locale

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

Specified by:
doProcessAction in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
nIdResource - the resource id
strResourceType - the resource type
request - the request
nIdAction - the action id
isAutomatic - is automatic action
locale - locale

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

Specified by:
getDisplayDocumentHistory in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
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 which contains the actions history performed on a resource

Specified by:
getDocumentHistoryXml in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
nIdResource - the resource id
strResourceType - the resource type
request - the request
nIdWorkflow - the workflow id
locale - the locale
Returns:
a xml which 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

Specified by:
doSaveTasksForm in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
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

Specified by:
doSaveTasksForm in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
nIdResource - the resource id
strResourceType - the resource type
request - the request
nIdAction - the action id
locale - the locale
nExternalParentId - the external parent id
Returns:
null if there is no error in the task form else return the error message url

getTaskInstance

public ITask getTaskInstance(java.lang.String strKey,
                             java.util.Locale locale)
return an instance of Task Object depending on the task type

Parameters:
strKey - the type task key
locale - the locale
Returns:
an instance of Task Object

getTaskTypeList

public java.util.Collection<ITaskType> getTaskTypeList()
Returns:
a list of task type

getRefListTaskType

public fr.paris.lutece.util.ReferenceList getRefListTaskType(java.util.Locale locale)
Return a reference list wich contains the task types

Parameters:
locale - the locale
Returns:
a reference list wich contains the task types

doRemoveWorkFlowResource

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

Specified by:
doRemoveWorkFlowResource in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
nIdResource - the resource id
strResourceType - the resource type

doRemoveWorkFlowResource

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

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

doRemoveWorkFlowResourceByListId

public void doRemoveWorkFlowResourceByListId(java.util.List<java.lang.Integer> lListIdResource,
                                             java.lang.String strResourceType,
                                             java.lang.Integer nIdWorflow)
Specified by:
doRemoveWorkFlowResourceByListId in interface fr.paris.lutece.portal.service.workflow.IWorkflowService

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

Specified by:
getDisplayTasksForm in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
nIdResource - the resource id
strResourceType - the resource 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,
                            fr.paris.lutece.portal.business.user.AdminUser user)
Check that a given user is allowed to view a resource depending the state of the resource

Specified by:
isAuthorized in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
nIdResource - the document id
strResourceType - the document type
user - the AdminUser
nIdWorkflow - the workflow id
Returns:
a list of Action

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,
                                                                   fr.paris.lutece.portal.business.user.AdminUser user)
Specified by:
getAuthorizedResourceList in interface fr.paris.lutece.portal.service.workflow.IWorkflowService

getAuthorizedResourceList

public java.util.List<java.lang.Integer> getAuthorizedResourceList(java.lang.String strResourceType,
                                                                   int nIdWorkflow,
                                                                   int nIdWorkflowState,
                                                                   java.lang.Integer nExternalParentId,
                                                                   fr.paris.lutece.portal.business.user.AdminUser user)
Specified by:
getAuthorizedResourceList in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
strResourceType -
nIdWorkflow -
nIdWorkflowState -
nExternalParentId -
user -
Returns:

getAuthorizedResourceList

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

Get all authorized resource Id

Specified by:
getAuthorizedResourceList in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
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

getWorkflowsEnabled

public fr.paris.lutece.util.ReferenceList getWorkflowsEnabled(fr.paris.lutece.portal.business.user.AdminUser user,
                                                              java.util.Locale locale)
return a referencelist wich contains a list enabled workflow

Specified by:
getWorkflowsEnabled in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
user - the AdminUser
locale - the locale
Returns:
a referencelist wich contains a list enabled workflow

getListIdRessourceByState

@Deprecated
public java.util.Collection<java.lang.Integer> getListIdRessourceByState(int nIdState,
                                                                                    java.lang.String strResourceType,
                                                                                    fr.paris.lutece.portal.business.user.AdminUser user)
Deprecated. 

WRONG : need to filter on workflow id return a list witch contains idRessource for a given state

Specified by:
getListIdRessourceByState in interface fr.paris.lutece.portal.service.workflow.IWorkflowService
Parameters:
nIdState - the id State
strResourceType - the resource type
user - the AdminUser
Returns:
a list witch contains idRessource

getManageAdvancedParameters

public java.util.Map<java.lang.String,java.lang.Object> getManageAdvancedParameters(fr.paris.lutece.portal.business.user.AdminUser user)
Build the advanced parameters management

Parameters:
user - the current user
Returns:
The model for the advanced parameters

getMassActions

public java.util.List<fr.paris.lutece.portal.business.workflow.Action> getMassActions(int nIdWorkflow)

Specified by:
getMassActions in interface fr.paris.lutece.portal.service.workflow.IWorkflowService

canProcessAction

public boolean canProcessAction(int nIdResource,
                                java.lang.String strResourceType,
                                int nIdAction,
                                java.lang.Integer nExternalParentId,
                                javax.servlet.http.HttpServletRequest request,
                                boolean bIsAutomatic)

Specified by:
canProcessAction in interface fr.paris.lutece.portal.service.workflow.IWorkflowService


Copyright © 2011 Mairie de Paris. All Rights Reserved.