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
 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<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.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.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 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)
          return a list wich contains idRessource for a given state
 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)
          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.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,
                                                               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
Returns:
the state of a given document

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,
                            javax.servlet.http.HttpServletRequest request,
                            java.util.Locale locale)
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
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 wich 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 wich contains 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

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

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 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

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

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

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

public java.util.Collection<java.lang.Integer> getListIdRessourceByState(int nIdState,
                                                                         java.lang.String strResourceType,
                                                                         fr.paris.lutece.portal.business.user.AdminUser user)
return a list wich 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 wich contains idRessource


Copyright © 2009 Mairie de Paris. All Rights Reserved.