Package org.ametys.plugins.frontedition
Class FrontEditionHelper
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.frontedition.FrontEditionHelper
- All Implemented Interfaces:
Component
,Contextualizable
,LogEnabled
,Serviceable
public class FrontEditionHelper
extends AbstractLogEnabled
implements Serviceable, Component, Contextualizable
Various helpers for front-edition plugin
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
contextualize
(Context context) firstAvailableParentInLivePath
(String pageId) Get the first available parent for the current page, in the live workspaceGet the first available parent for the requested page, in the live versiongetWorkflowActionName
(String contentId, String workflowName, List<Integer> actionIds) Get the name of a workflow action by it's idhasWorkflowRight
(int actionId, List<String> contentIds, boolean checkEditionMode) Check if the action requested is availableboolean
moveZoneItemId
(String zoneItemId, String zoneName, String pageId, int offset) Move a zone item of a page before/after another zone item of the same pagevoid
service
(ServiceManager manager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
Avalon Role
-
-
Constructor Details
-
FrontEditionHelper
public FrontEditionHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
firstAvailableParentInLivePath
Get the first available parent for the current page, in the live workspace- Parameters:
pageId
- id of the page that need to be checked- Returns:
- path of the parent (can be this page if available in live)
-
firstAvailableParentInLivePath
Get the first available parent for the requested page, in the live version- Parameters:
page
- page to check- Returns:
- path of the parent (can be this page if available in live)
-
getWorkflowActionName
public Map<Integer,String> getWorkflowActionName(String contentId, String workflowName, List<Integer> actionIds) Get the name of a workflow action by it's id- Parameters:
contentId
- id of the content to check if action is availableworkflowName
- name of the workflow checkedactionIds
- actions where the name needs to be retreived- Returns:
- workwflow action name
-
hasWorkflowRight
public Map<String,Boolean> hasWorkflowRight(int actionId, List<String> contentIds, boolean checkEditionMode) Check if the action requested is available- Parameters:
actionId
- Action IdcontentIds
- List of Content IdcheckEditionMode
- Check if we are in edition mode or not- Returns:
- true if action available
-
moveZoneItemId
public boolean moveZoneItemId(String zoneItemId, String zoneName, String pageId, int offset) throws UnknownAmetysObjectException, AmetysRepositoryException, RepositoryException Move a zone item of a page before/after another zone item of the same page- Parameters:
zoneItemId
- zone item to movezoneName
- name of the zonepageId
- page Idoffset
- how many item back/forward to move ? (negative for up, positive to down)- Returns:
- true if success
- Throws:
UnknownAmetysObjectException
- If an error occurredAmetysRepositoryException
- If an error occurredRepositoryException
- If an error occurred
-