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
Fields Modifier and Type Field Description private AmetysObjectResolver
_ametysObjectResolver
The Ametys object resolverprivate Context
_context
Contextprivate ZoneDAO
_zoneDAO
static String
ROLE
Avalon Role
-
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<Integer,String>
getWorkflowActionName(String contentId, String workflowName, List<Integer> actionIds)
Get the name of a workflow action by it's idMap<String,Boolean>
hasWorkflowRight(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 Detail
-
_ametysObjectResolver
private AmetysObjectResolver _ametysObjectResolver
The Ametys object resolver
-
-
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
-
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
-
-