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
-
-
Constructor Summary
Constructors Constructor Description FrontEditionHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
contextualize(Context context)
String
firstAvailableParentInLivePath(String pageId)
Get the first available parent for the current page, in the live workspaceString
firstAvailableParentInLivePath(Page page)
Get the first available parent for the requested page, in the live versionMap<String,Object>
getModifiableContents(int actionId, List<String> contentIds, boolean checkEditionMode)
Check if contents are modifiable and check all attributes restrictionMap<Integer,String>
getWorkflowActionName(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 pagevoid
service(ServiceManager manager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Constructor Detail
-
FrontEditionHelper
public FrontEditionHelper()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
firstAvailableParentInLivePath
public String firstAvailableParentInLivePath(String pageId)
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
public String firstAvailableParentInLivePath(Page page)
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
-
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, 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
-
-