Package org.ametys.web.workflow
Class WorkflowTasksComponent
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.cms.workflow.WorkflowTasksComponent
org.ametys.web.workflow.WorkflowTasksComponent
- All Implemented Interfaces:
Component
,Configurable
,Contextualizable
,LogEnabled
,Serviceable
,ThreadSafe
Component for saxing tasks specific to an user.
The algorithm is the following :
The algorithm is the following :
- First, we get all granted sites for the user with the right manager.
- If there is at least one site allowed, we get all workflows associated with the granted sites.
- Then for each step of each task from the configuration, we get all workflows where this step is in current steps and where the workflow is contains in the previous list.
- For each workflow matching the previous conditions we test if the user has all the rights associated with the step (from the configuration) and then we get the content from this workflow.
- Finally, for each content, we sax its first page in order to access it directly from an URL.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.cms.workflow.WorkflowTasksComponent
WorkflowTasksComponent.LastModifiedDateComparator, WorkflowTasksComponent.Task, WorkflowTasksComponent.TaskStep
-
Field Summary
Modifier and TypeFieldDescriptionprotected Context
The avalon context.protected ContentTypesAssignmentHandler
The content types assignment handlerprotected SiteManager
The site manager.static final String
The avalon role.Fields inherited from class org.ametys.cms.workflow.WorkflowTasksComponent
_allowUserQuery, _contentHelper, _contentTypesHelper, _cTypeEP, _languagesManager, _objectResolver, _rightManager, _tasks, _userManager, _workflowProvider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected List<Expression>
Get the AND expressions to request on contentsprotected Expression
_getContentTypeExpression
(String siteName) The content type expressionprotected void
_saxAdditionalAttributes
(Content content, WorkflowTasksComponent.Task task, AttributesImpl attrs) SAX additional attributesvoid
contextualize
(Context context) getContents
(User user, String taskId, String siteName, String language, int limit) Get the list of contents for a given user, task and site.void
service
(ServiceManager serviceManager) void
toSAX
(ContentHandler ch, User user) SAX the contents for given uservoid
toSAX
(ContentHandler ch, User user, String taskId) SAX the contents for given user and taskvoid
SAX the contents for given user, site and taskMethods inherited from class org.ametys.cms.workflow.WorkflowTasksComponent
_configureAdditional, _configureStep, _configureStepIds, _configureTasks, _getContents, _getCorrespondingWorkflows, _getTaskContents, _getTaskContents, _saxAdditionalAttributes, _saxAdditionalData, _saxContent, _saxContentCurrentState, _saxTask, _testContent, allowUserQuery, configure, getContents, getTasks
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
The avalon role. -
_siteManager
The site manager. -
_context
The avalon context. -
_cTypeHandler
The content types assignment handler
-
-
Constructor Details
-
WorkflowTasksComponent
public WorkflowTasksComponent()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classWorkflowTasksComponent
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
toSAX
Description copied from class:WorkflowTasksComponent
SAX the contents for given user- Overrides:
toSAX
in classWorkflowTasksComponent
- Parameters:
ch
- the content handler to SAX intouser
- the user- Throws:
SAXException
- If an error occurred
-
toSAX
Description copied from class:WorkflowTasksComponent
SAX the contents for given user and task- Overrides:
toSAX
in classWorkflowTasksComponent
- Parameters:
ch
- the content handler to SAX intouser
- the usertaskId
- the task id- Throws:
SAXException
- If an error occurred
-
toSAX
public void toSAX(ContentHandler ch, User user, String siteName, String language, String taskId) throws SAXException SAX the contents for given user, site and task- Parameters:
ch
- the content handler to SAX intouser
- the usersiteName
- the site namelanguage
- the language.taskId
- the task id- Throws:
SAXException
- if an error occurred while saxing
-
getContents
public Collection<Content> getContents(User user, String taskId, String siteName, String language, int limit) throws AmetysRepositoryException Get the list of contents for a given user, task and site.- Parameters:
user
- the user.taskId
- the task ID.siteName
- the site name.language
- the language.limit
- the maximum number of results, 0 for all.- Returns:
- the contents as an iterable collection of contents.
- Throws:
AmetysRepositoryException
- if an error occurred
-
_getContentsAndExpressions
protected List<Expression> _getContentsAndExpressions(WorkflowTasksComponent.TaskStep step, User user) Description copied from class:WorkflowTasksComponent
Get the AND expressions to request on contents- Overrides:
_getContentsAndExpressions
in classWorkflowTasksComponent
- Parameters:
step
- the step.user
- the user.- Returns:
- The content's expressions
-
_getContentTypeExpression
The content type expression- Parameters:
siteName
- the site name- Returns:
- The content type expression
-
_saxAdditionalAttributes
protected void _saxAdditionalAttributes(Content content, WorkflowTasksComponent.Task task, AttributesImpl attrs) throws SAXException Description copied from class:WorkflowTasksComponent
SAX additional attributes- Overrides:
_saxAdditionalAttributes
in classWorkflowTasksComponent
- Parameters:
content
- the contenttask
- the taskattrs
- the attributes- Throws:
SAXException
- If an error occurred
-