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

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

public class WorkflowService
extends java.lang.Object

WorkflowService


Method Summary
 void doProcessAction(int nIdResource, java.lang.String strResourceType, int nIdAction, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
          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 workflows the resource specified in parameter
 java.lang.String doSaveTasksForm(int nIdResource, java.lang.String strResourceType, int nIdAction, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
          Perform the information on the various tasks associated with the given action specified in parameter
 java.util.Collection<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.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
static WorkflowService getInstance()
          Returns the instance of the singleton
 fr.paris.lutece.util.ReferenceList getRefListTaskType(java.util.Locale locale)
          Return a reference list wich contains the task types
 State getState(int nIdResource, java.lang.String strResourceType, int nIdWorkflow, 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()
           
 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.Collection<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

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

getState

public State getState(int nIdResource,
                      java.lang.String strResourceType,
                      int nIdWorkflow,
                      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

Parameters:
nIdResource - the document id
strResourceType - the document type
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

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,
                            javax.servlet.http.HttpServletRequest request,
                            java.util.Locale locale)
Proceed action given in parameter

Parameters:
nIdResource - the resource id
strResourceType - the resource type
request - the request
nIdAction - the action id
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

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

doSaveTasksForm

public java.lang.String doSaveTasksForm(int nIdResource,
                                        java.lang.String strResourceType,
                                        int nIdAction,
                                        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
request - the request
nIdAction - the action 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

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

doRemoveWorkFlowResource

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

Parameters:
nIdResource - the resource id
strResourceType - the resource type
nIdWorkflow - 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,
                            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

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


Copyright © 2009 Mairie de Paris. All Rights Reserved.