Class FrontEditionHelper

java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.frontedition.FrontEditionHelper
All Implemented Interfaces:
Component, Contextualizable, LogEnabled, Serviceable

Various helpers for front-edition plugin
  • Field Details

    • ROLE

      public static final String ROLE
      Avalon Role
  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager manager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • contextualize

      public void contextualize(Context context) throws ContextException
      Specified by:
      contextualize in interface Contextualizable
      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

      public boolean pageExists(String pageId)
      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 available
      workflowName - name of the workflow checked
      actionIds - 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 id
      contentIds - the id of contents
      checkEditionMode - 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 move
      zoneName - name of the zone
      pageId - page Id
      offset - how many item back/forward to move ? (negative for up, positive to down)
      Returns:
      true if success
      Throws:
      UnknownAmetysObjectException - If an error occurred
      AmetysRepositoryException - If an error occurred
      javax.jcr.RepositoryException - If an error occurred