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 versiongetModifiableContents
(int actionId, List<String> contentIds, boolean checkEditionMode) Check if contents are modifiable and check all attributes restrictiongetWorkflowActionName
(String contentId, String workflowName, List<Integer> actionIds) Get the name of a workflow action by it's idboolean
moveZoneItemId
(String zoneItemId, String zoneName, String pageId, int offset) Move a zone item of a page before/after another zone item of the same pageboolean
pageExists
(String pageId) Determines if the page existsvoid
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)
-
pageExists
Determines if the page exists- Parameters:
pageId
- the page id- Returns:
- true if the page exists
-
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
-
getModifiableContents
public Map<String,Object> getModifiableContents(int actionId, List<String> contentIds, boolean checkEditionMode) Check if contents are modifiable and check all attributes restriction- Parameters:
actionId
- the edit action idcontentIds
- the id of contentscheckEditionMode
- Check if we are in edition mode or not- Returns:
- A Map with content id as key. The value is null if content is unmodifiable or a map of content informations as an array with path of unmodifiable attributes otherwise
-
moveZoneItemId
public boolean moveZoneItemId(String zoneItemId, String zoneName, String pageId, int offset) throws UnknownAmetysObjectException, AmetysRepositoryException, javax.jcr.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 occurredjavax.jcr.RepositoryException
- If an error occurred
-