Interface LayoutService


public interface LayoutService
  • Field Details

    • PAGE_CREATED

      static final String PAGE_CREATED
    • PAGE_REMOVED

      static final String PAGE_REMOVED
    • PAGE_UPDATED

      static final String PAGE_UPDATED
    • PORTAL_CONFIG_CREATED

      static final String PORTAL_CONFIG_CREATED
    • PORTAL_CONFIG_REMOVED

      static final String PORTAL_CONFIG_REMOVED
    • PORTAL_CONFIG_UPDATED

      static final String PORTAL_CONFIG_UPDATED
  • Method Details

    • create

      void create(PortalConfig config)
      Create a PortalConfig in database
      Then broadcast PORTAL_CONFIG_CREATED event
      Parameters:
      config - PortalConfig
    • save

      void save(PortalConfig config)
      This method should update the PortalConfig object
      Then broadcast PORTAL_CONFIG_UPDATED event
      Parameters:
      config - PortalConfig
    • getPortalConfig

      PortalConfig getPortalConfig(String portalName)
      This method should load the PortalConfig object from db according to the portalName
      Parameters:
      portalName -
      Returns:
      PortalConfig
    • getPortalConfig

      PortalConfig getPortalConfig(String ownerType, String portalName)
      This method should load the PortalConfig object from db according to the portalName and ownerType
      Parameters:
      ownerType -
      portalName -
      Returns:
      PortalConfig
    • getPortalConfig

      PortalConfig getPortalConfig(SiteKey siteKey)
      Retrieves PortalConfig of designated SiteKey
      Parameters:
      siteKey - SiteKey
      Returns:
      null if not found, else PortalConfig
    • getPortalConfig

      PortalConfig getPortalConfig(long siteId)
      This method should load the PortalConfig object from db according to the siteId
      Parameters:
      siteId -
      Returns:
      PortalConfig
    • remove

      void remove(PortalConfig config)
      Remove the PortalConfig from the database
      Then broadcast PORTAL_CONFIG_REMOVED event
      Parameters:
      config - PortalConfig
    • removePages

      void removePages(SiteKey siteKey)
      Removes all pages of a given site
      Parameters:
      siteKey - SiteKey
    • getPage

      Page getPage(String pageId)
      This method should load the Page object from the database according to the pageId
      Parameters:
      pageId - - String represent id of page, it must be valid pageId (3 parts saparate by :: )
      Returns:
      Page
    • getPage

      Page getPage(long id)
      This method should load the Page object from the database according to the technical identifier of the page
      Parameters:
      id - - UUID of page
      Returns:
      Page
    • getPage

      Page getPage(PageKey pageKey)
      Retrieves Page designated by its key
      Parameters:
      pageKey - PageKey
      Returns:
      Page
    • getPageContext

      PageContext getPageContext(PageKey pageKey)
      retrieves PageContext switch its key
      Parameters:
      pageKey - PageKey
      Returns:
      PageContext
    • findPages

      List<PageContext> findPages(SiteKey siteKey)
      Retrieves the list of pages in a give site
      Parameters:
      siteKey - SiteKey
      Returns:
      List of type PageContext
    • findPages

      QueryResult<PageContext> findPages(int offset, int limit, SiteType siteType, String siteName, String pageName, String pageTitle)
      Search for pages using some criteria and pagination options
      Parameters:
      offset - pagination offset
      limit - pagination limit
      siteType - SiteType
      siteName - site name
      pageName - page name search term
      pageTitle - page title search term
      Returns:
      QueryResult containing list of pages
    • remove

      void remove(Page page)
      Removes a given page from store
      Parameters:
      page - Page
    • remove

      void remove(PageKey pageKey)
      Removes a page from store designated by its PageKey
      Parameters:
      pageKey - PageKey
    • create

      void create(Page page)
      This method should create or update the given page object
      Then broasdcast PAGE_CREATED event
      Parameters:
      page -
    • save

      List<ModelChange> save(Page page)
      Saves a page. If a page with the same id already exists then a merge operation will occur, otherwise it throws IllegalStateException
      The operation returns a list of the change object that describes the changes that occured during the save operation.
      Then broadcast PAGE_UPDATED event
      Parameters:
      page - the page to save
      Returns:
      the list of model changes that occurred during the save
    • save

      void save(PageContext pageContext, Page page)
      Saves a PageContext with its PageState in addition to the layout defined in Page object
      Parameters:
      pageContext - PageContext with title, description and permissions
      page - Page to save page layout and structure
    • save

      void save(PageContext pageContext)
      Saves a PageContext with its PageState
      Parameters:
      pageContext - PageContext with title, description and permissions
    • getApplicationModel

      Application getApplicationModel(String applicationStorageId)
      Retrieved Application model switch its storage identifier
      Parameters:
      applicationStorageId -
      Returns:
      Application
    • getId

      String getId(ApplicationState state)
      Return contentId according to each state (transient, persistent, clone)
      Parameters:
      state -
      Returns:
      ApplicationState of type Portlet
    • load

      Return content state. If can't find, return null
      Parameters:
      state - - ApplicationState object
      Returns:
      Portlet
    • save

      ApplicationState save(ApplicationState state, Portlet preferences)
      Save content state
      Parameters:
      state - - ApplicationState object. It must be CloneApplicationState or PersistentApplicationState object
      preferences - - object to be saved
      Returns:
      ApplicationState typed with Portlet
    • find

      <T> org.exoplatform.commons.utils.LazyPageList<T> find(Query<T> q, Comparator<T> sortComparator)
      Return LazyPageList of object (sorted) which type and other info determined in Query object
      Type Parameters:
      T - could be of type Page or PortalConfig
      Parameters:
      q - - Query object
      sortComparator - Comparator used for sorting results
      Returns:
      LazyPageList
    • find2

      <T> org.exoplatform.commons.utils.ListAccess<T> find2(Query<T> q, Comparator<T> sortComparator)
      Return ListAccess, we can retrieved array of object (sorted) in database through this.
      Type Parameters:
      T - could be of type Page or PortalConfig
      Parameters:
      q - - Query object
      sortComparator - - Comparator object, used to sort the result list
      Returns:
      LazyPageList
    • getSharedLayout

      Container getSharedLayout(String siteName)
      Return shared layout containing common layout of all sites (user, group and sites). This will retrieve the layout from /conf/portal/portal/sharedlayout-{siteName}.xml else if not found, retrieve it from /conf/portal/portal/sharedlayout.xml
      Parameters:
      siteName -
      Returns:
      Container
    • getSiteNames

      List<String> getSiteNames(SiteType siteType, int offset, int limit)
      Retrieves all site type names with pagination.
      Parameters:
      siteType - SiteType
      offset - offset of the query
      limit - limit of the list to fetch
      Returns:
      List of corresponding site names, else empty list if not found
    • getImportStatus

      default Status getImportStatus()
    • saveImportStatus

      default void saveImportStatus(Status status)
    • getSites

      default List<PortalConfig> getSites(SiteFilter siteFilter)
      Retrieves sites according to the given site filter
      Parameters:
      siteFilter - SiteFilter site filter for results filtering
      Returns:
      List of sites portal config
    • getSiteBannerStream

      default InputStream getSiteBannerStream(String siteName) throws org.exoplatform.commons.exception.ObjectNotFoundException, IOException
      Retrieve site banner as stream
      Parameters:
      siteName - name of the portal site
      Returns:
      found InputStream
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - When site not found or file attachment
      IOException
    • getDefaultSiteBannerStream

      default InputStream getDefaultSiteBannerStream(String siteName)
      Retrieve default site banner as stream
      Parameters:
      siteName - name of the portal site
      Returns:
      found InputStream
    • removeSiteBanner

      default void removeSiteBanner(String siteName) throws org.exoplatform.commons.exception.ObjectNotFoundException
      remove site banner
      Parameters:
      siteName - name of the portal site
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - When site not found or file attachment
    • savePortalFromTemplate

      default void savePortalFromTemplate(SiteKey sourceSiteTemplate, SiteKey targetSiteKey) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Parameters:
      sourceSiteTemplate - SiteKey of template
      targetSiteKey - SiteKey to create
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • savePortalFromTemplate

      default void savePortalFromTemplate(SiteKey sourceSiteTemplate, SiteKey targetSiteKey, String permission) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Parameters:
      sourceSiteTemplate - SiteKey of template
      targetSiteKey - SiteKey to create
      permission - Permission to use to change pattern "@owenr@" if existing in pages and portal layouts
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • savePagesFromTemplate

      default void savePagesFromTemplate(SiteKey sourceSiteTemplate, SiteKey targetSiteKey, String permission) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Parameters:
      sourceSiteTemplate - SiteKey of template
      targetSiteKey - SiteKey to create
      permission - Permission to use to change pattern "@owenr@" if existing in pages and portal layouts
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • savePageFromTemplate

      default void savePageFromTemplate(PageKey sourcePageTemplateKey, SiteKey targetSiteKey, String permission) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Parameters:
      sourcePageTemplateKey - Site template's Page Key
      targetSiteKey - destination Site Key
      permission - Permission to use to change pattern "@owenr@" if existing in pages and portal layouts
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException