Class SmartContentClientSideElementHelper
- java.lang.Object
-
- org.ametys.cms.clientsideelement.content.SmartContentClientSideElementHelper
-
- All Implemented Interfaces:
Component
,Serviceable
public class SmartContentClientSideElementHelper extends Object implements Serviceable, Component
Component helper forSmartContentClientSideElement
-
-
Field Summary
Fields Modifier and Type Field Description private ContentHelper
_contentHelper
private RightManager
_rightManager
private UserManager
_userManager
private CurrentUserProvider
_userProvider
private WorkflowProvider
_workflowProvider
static String
ROLE
The Avalon Role
-
Constructor Summary
Constructors Constructor Description SmartContentClientSideElementHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description I18nizableText
getAllRightDescription(Map<String,Object> parameters, Content content)
Get i18n description when user can do actionMap<String,Object>
getContentDefaultParameters(Content content)
Get the default content's parametersI18nizableText
getIncorrectWorkflowStepDescription(Map<String,Object> parameters, Content content)
Get i18n description when user can not do action because the workflow step is incorrectI18nizableText
getLockedDescription(Map<String,Object> parameters, Content content)
Get i18n description when user can not do action because the content is lockedI18nizableText
getNoModifiableDescription(Map<String,Object> parameters, Content content)
Get i18n description when user can not do action because the content is not modifiableI18nizableText
getNoRightDescription(Map<String,Object> parameters, Content content)
Get i18n description when user can not do action because he has no right on contentI18nizableText
getWorkflowActionUnvailableDescription(Map<String,Object> parameters, Content content)
Get i18n description when user can not do action because there is no workflow action unvailableboolean
hasRight(Map<String,String> rights, Content content)
Determines if the user has sufficient right for the given contentboolean
isLocked(Content content)
Determines if the content is lockedboolean
isModifiable(Content content)
Determines if the content is modifiableboolean
isWorkflowStepCorrect(Map<String,Object> parameters, Content content)
Determines if the workflow step is correctvoid
service(ServiceManager manager)
int
workflowAction(Map<String,Object> parameters, Content content)
Determines if the workflow action is correct
-
-
-
Field Detail
-
_userManager
private UserManager _userManager
-
_workflowProvider
private WorkflowProvider _workflowProvider
-
_userProvider
private CurrentUserProvider _userProvider
-
_rightManager
private RightManager _rightManager
-
_contentHelper
private ContentHelper _contentHelper
-
-
Constructor Detail
-
SmartContentClientSideElementHelper
public SmartContentClientSideElementHelper()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
isWorkflowStepCorrect
public boolean isWorkflowStepCorrect(Map<String,Object> parameters, Content content)
Determines if the workflow step is correct- Parameters:
parameters
- The client side element 's parameterscontent
- the content- Returns:
- true if the workflow step is incorrect
-
getNoRightDescription
public I18nizableText getNoRightDescription(Map<String,Object> parameters, Content content)
Get i18n description when user can not do action because he has no right on content- Parameters:
parameters
- The client side element 's parameterscontent
- The content- Returns:
- The
I18nizableText
description
-
getLockedDescription
public I18nizableText getLockedDescription(Map<String,Object> parameters, Content content)
Get i18n description when user can not do action because the content is locked- Parameters:
parameters
- The client side element 's parameterscontent
- The content- Returns:
- The
I18nizableText
description
-
getWorkflowActionUnvailableDescription
public I18nizableText getWorkflowActionUnvailableDescription(Map<String,Object> parameters, Content content)
Get i18n description when user can not do action because there is no workflow action unvailable- Parameters:
parameters
- The client side element 's parameterscontent
- The content- Returns:
- The
I18nizableText
description
-
getIncorrectWorkflowStepDescription
public I18nizableText getIncorrectWorkflowStepDescription(Map<String,Object> parameters, Content content)
Get i18n description when user can not do action because the workflow step is incorrect- Parameters:
parameters
- The client side element 's parameterscontent
- The content- Returns:
- The
I18nizableText
description
-
getNoModifiableDescription
public I18nizableText getNoModifiableDescription(Map<String,Object> parameters, Content content)
Get i18n description when user can not do action because the content is not modifiable- Parameters:
parameters
- The client side element 's parameterscontent
- The content- Returns:
- The
I18nizableText
description
-
getAllRightDescription
public I18nizableText getAllRightDescription(Map<String,Object> parameters, Content content)
Get i18n description when user can do action- Parameters:
parameters
- The client side element 's parameterscontent
- The content- Returns:
- The
I18nizableText
description
-
isLocked
public boolean isLocked(Content content)
Determines if the content is locked- Parameters:
content
- the content- Returns:
- true if the content is locked
-
isModifiable
public boolean isModifiable(Content content)
Determines if the content is modifiable- Parameters:
content
- the content- Returns:
- true if the content is modifiable
-
hasRight
public boolean hasRight(Map<String,String> rights, Content content)
Determines if the user has sufficient right for the given content- Parameters:
rights
- The client side element 's rightscontent
- the content- Returns:
- true if user has sufficient right
-
workflowAction
public int workflowAction(Map<String,Object> parameters, Content content)
Determines if the workflow action is correct- Parameters:
parameters
- The client side element 's parameterscontent
- the content- Returns:
- true if the workflow action is incorrect
-
getContentDefaultParameters
public Map<String,Object> getContentDefaultParameters(Content content)
Get the default content's parameters- Parameters:
content
- The content- Returns:
- The default parameters
-
-