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
public class WorkflowTasksComponent extends WorkflowTasksComponent implements Contextualizable
Component for saxing tasks specific to an user.
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
Fields Modifier and Type Field Description protected Context
_context
The avalon context.protected ContentTypesAssignmentHandler
_cTypeHandler
The content types assignment handlerprotected SiteManager
_siteManager
The site manager.static String
ROLE
The avalon role.-
Fields inherited from class org.ametys.cms.workflow.WorkflowTasksComponent
_allowUserQuery, _contentHelper, _contentTypesHelper, _cTypeEP, _languagesManager, _objectResolver, _rightManager, _tasks, _userManager, _workflowProvider
-
-
Constructor Summary
Constructors Constructor Description WorkflowTasksComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<Expression>
_getContentsAndExpressions(WorkflowTasksComponent.TaskStep step, User user)
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)
Collection<Content>
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
toSAX(ContentHandler ch, User user, String siteName, String language, String taskId)
SAX the contents for given user, site and task-
Methods 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 Detail
-
_siteManager
protected SiteManager _siteManager
The site manager.
-
_cTypeHandler
protected ContentTypesAssignmentHandler _cTypeHandler
The content types assignment handler
-
-
Constructor Detail
-
WorkflowTasksComponent
public WorkflowTasksComponent()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classWorkflowTasksComponent
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
toSAX
public void toSAX(ContentHandler ch, User user) throws SAXException
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
public void toSAX(ContentHandler ch, User user, String taskId) throws SAXException
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
protected Expression _getContentTypeExpression(String siteName)
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
-
-