Class PageLayoutService

java.lang.Object
io.meeds.layout.service.PageLayoutService

@Service public class PageLayoutService extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Broadcast after a page's access/edit permissions have been persisted.
    static final String
    Broadcast with the acting username and the live page reference after a publication replaced a page's layout, from the editor's publish as from a tool's; never on a draft save, which fires PAGE_UPDATED_EVENT alone
    static final String
    Broadcast after a page's layout has been persisted (content added/removed/reordered).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.exoplatform.portal.mop.page.PageKey
    clonePage(org.exoplatform.portal.mop.page.PageKey pageKey, String username)
     
    void
    cloneSection(org.exoplatform.portal.mop.page.PageKey pageKey, long containerId, String username)
     
    org.exoplatform.portal.mop.page.PageContext
    createPage(PageCreateModel pageModel, String username)
     
    org.exoplatform.portal.mop.page.PageContext
    getPage(org.exoplatform.portal.mop.page.PageKey pageKey, String username)
     
    org.exoplatform.portal.config.model.Application
    getPageApplicationLayout(org.exoplatform.portal.mop.page.PageKey pageKey, long applicationId, String username)
     
    org.exoplatform.portal.config.model.Page
    getPageLayout(org.exoplatform.portal.mop.page.PageKey pageKey)
     
    org.exoplatform.portal.config.model.ModelObject
    getPageLayout(org.exoplatform.portal.mop.page.PageKey pageKey, long siteId, boolean impersonate, String username)
     
    org.exoplatform.portal.config.model.ModelObject
    getPageLayout(org.exoplatform.portal.mop.page.PageKey pageKey, long siteId, String username)
     
    org.exoplatform.portal.config.model.ModelObject
    getPageLayout(org.exoplatform.portal.mop.page.PageKey pageKey, String username)
     
    List<org.exoplatform.portal.mop.page.PageContext>
    getPages(String siteTypeName, String siteName, String pageDisplayName, int offset, int limit, String username)
     
    void
    impersonateModel(org.exoplatform.portal.config.model.ModelObject object)
     
    void
    impersonatePage(org.exoplatform.portal.mop.page.PageKey pageKey)
     
    void
    impersonateSite(org.exoplatform.portal.mop.SiteKey siteKey)
     
    org.exoplatform.portal.mop.page.PageContext
    restorePageLayout(org.exoplatform.portal.mop.page.PageKey pageKey, String username)
    Restores a single page's layout to its shipped default, preserving the page's current access and edit permissions (only the layout is reset, not who can see/edit the page).
    void
    updatePageApplicationPreferences(org.exoplatform.portal.mop.page.PageKey pageKey, long applicationId, List<PortletInstancePreference> preferences, String username)
     
    void
    updatePageApplicationPreferences(org.exoplatform.portal.mop.page.PageKey pageKey, long applicationId, List<PortletInstancePreference> preferences, String username, boolean keepExisting)
     
    org.exoplatform.portal.mop.page.PageContext
    updatePageLayout(String pageRef, org.exoplatform.portal.config.model.Page page, boolean publish, String username)
     
    void
    updatePageLink(org.exoplatform.portal.mop.page.PageKey pageKey, String link, String username)
     
    void
    updatePagePermissions(org.exoplatform.portal.mop.page.PageKey pageKey, PermissionUpdateModel permissionUpdateModel, String username)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PAGE_UPDATED_EVENT

      public static final String PAGE_UPDATED_EVENT
      Broadcast after a page's layout has been persisted (content added/removed/reordered).
      See Also:
    • PAGE_PERMISSIONS_UPDATED_EVENT

      public static final String PAGE_PERMISSIONS_UPDATED_EVENT
      Broadcast after a page's access/edit permissions have been persisted.
      See Also:
    • PAGE_PUBLISHED_EVENT

      public static final String PAGE_PUBLISHED_EVENT
      Broadcast with the acting username and the live page reference after a publication replaced a page's layout, from the editor's publish as from a tool's; never on a draft save, which fires PAGE_UPDATED_EVENT alone
      See Also:
  • Constructor Details

    • PageLayoutService

      public PageLayoutService()
  • Method Details

    • getPages

      public List<org.exoplatform.portal.mop.page.PageContext> getPages(String siteTypeName, String siteName, String pageDisplayName, int offset, int limit, String username)
    • getPage

      public org.exoplatform.portal.mop.page.PageContext getPage(org.exoplatform.portal.mop.page.PageKey pageKey, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • getPageApplicationLayout

      public org.exoplatform.portal.config.model.Application getPageApplicationLayout(org.exoplatform.portal.mop.page.PageKey pageKey, long applicationId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • impersonateSite

      public void impersonateSite(org.exoplatform.portal.mop.SiteKey siteKey)
    • impersonatePage

      public void impersonatePage(org.exoplatform.portal.mop.page.PageKey pageKey)
    • getPageLayout

      public org.exoplatform.portal.config.model.ModelObject getPageLayout(org.exoplatform.portal.mop.page.PageKey pageKey, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • getPageLayout

      public org.exoplatform.portal.config.model.ModelObject getPageLayout(org.exoplatform.portal.mop.page.PageKey pageKey, long siteId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • getPageLayout

      public org.exoplatform.portal.config.model.ModelObject getPageLayout(org.exoplatform.portal.mop.page.PageKey pageKey, long siteId, boolean impersonate, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • getPageLayout

      public org.exoplatform.portal.config.model.Page getPageLayout(org.exoplatform.portal.mop.page.PageKey pageKey)
    • createPage

      public org.exoplatform.portal.mop.page.PageContext createPage(PageCreateModel pageModel, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException, IllegalArgumentException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
      IllegalArgumentException
    • clonePage

      public org.exoplatform.portal.mop.page.PageKey clonePage(org.exoplatform.portal.mop.page.PageKey pageKey, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • cloneSection

      public void cloneSection(org.exoplatform.portal.mop.page.PageKey pageKey, long containerId, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • updatePageApplicationPreferences

      public void updatePageApplicationPreferences(org.exoplatform.portal.mop.page.PageKey pageKey, long applicationId, List<PortletInstancePreference> preferences, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • updatePageApplicationPreferences

      public void updatePageApplicationPreferences(org.exoplatform.portal.mop.page.PageKey pageKey, long applicationId, List<PortletInstancePreference> preferences, String username, boolean keepExisting) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • updatePageLayout

      public org.exoplatform.portal.mop.page.PageContext updatePageLayout(String pageRef, org.exoplatform.portal.config.model.Page page, boolean publish, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • restorePageLayout

      public org.exoplatform.portal.mop.page.PageContext restorePageLayout(org.exoplatform.portal.mop.page.PageKey pageKey, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Restores a single page's layout to its shipped default, preserving the page's current access and edit permissions (only the layout is reset, not who can see/edit the page).
      Parameters:
      pageKey - the key of the page to restore
      username - the user requesting the restore
      Returns:
      the restored PageContext
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the page doesn't exist
      IllegalAccessException - when the user can't edit the page's layout
      IllegalStateException - when the page isn't part of any default/product configuration
    • updatePageLink

      public void updatePageLink(org.exoplatform.portal.mop.page.PageKey pageKey, String link, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException, IllegalStateException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
      IllegalStateException
    • updatePagePermissions

      public void updatePagePermissions(org.exoplatform.portal.mop.page.PageKey pageKey, PermissionUpdateModel permissionUpdateModel, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • impersonateModel

      public void impersonateModel(org.exoplatform.portal.config.model.ModelObject object)