Class SiteLayoutService

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

@Service public class SiteLayoutService extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
    Broadcast with the acting username and the SiteKey after a publication replaced a site's layout, whatever the site's kind (portal, group, user, template): a listener keyed on pages or spaces checks the kind itself
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.exoplatform.portal.mop.SiteKey
    createDraftSite(org.exoplatform.portal.mop.SiteKey siteKey, String username)
     
    org.exoplatform.portal.config.model.PortalConfig
    createSite(SiteCreateModel createModel, String username)
     
    void
    deleteSite(org.exoplatform.portal.mop.SiteKey siteKey, String username)
     
    void
    Removes the draft sites of a deleted user: every draft site whose name ends with _draft_<username>, a name another user could also have produced included.
    org.exoplatform.portal.config.model.PortalConfig
    getSite(long siteId, String username)
     
    org.exoplatform.portal.config.model.PortalConfig
    getSite(org.exoplatform.portal.mop.SiteKey siteKey, String username)
     
    getSiteDescriptions(Long siteId, String username)
     
    getSiteLabels(Long siteId, String username)
     
    org.exoplatform.portal.config.model.ModelObject
    getSiteLayout(org.exoplatform.portal.mop.SiteKey siteKey, String username)
     
    void
    restoreSite(org.exoplatform.portal.mop.SiteKey siteKey, org.exoplatform.portal.mop.importer.ImportMode importMode, boolean restoreSiteConfig, boolean restorePages, boolean restoreNavigationTree, String username)
     
    void
    updateSite(SiteUpdateModel updateModel, String username)
     
    void
    updateSiteAndPermissions(org.exoplatform.portal.mop.SiteKey siteKey, SitePropertiesUpdate properties, PermissionUpdateModel permissions, String username)
    Updates a site's permissions, then its properties, the way the sites administration does it in two requests: the permissions first, so a refusal on them leaves the properties untouched; then the properties, every one the caller did not state kept from the stored site.
    void
    updateSiteApplicationPreferences(org.exoplatform.portal.mop.SiteKey siteKey, long applicationId, List<PortletInstancePreference> preferences, String username, boolean keepExisting)
    Sets preferences of a window of a site's layout, as the page method does for a page window: the given values replace the window's preferences, or are set over them when keepExisting is true.
    void
    updateSiteLayout(org.exoplatform.portal.mop.SiteKey siteKey, org.exoplatform.portal.config.model.PortalConfig site, boolean publish, String username)
    Replaces a site's layout with the given one: a draft save checks that every window the tree names still exists, a publication recreates every window with the preferences it carries and broadcasts the site publication event, as the site layout editor's publish does
    void
    updateSitePermissions(PermissionUpdateModel permissionUpdateModel, String username)
     

    Methods inherited from class Object

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

    • DISPLAYED_NOT_ACCEPTED

      public static final String DISPLAYED_NOT_ACCEPTED
      See Also:
    • SITE_PUBLISHED_EVENT

      public static final String SITE_PUBLISHED_EVENT
      Broadcast with the acting username and the SiteKey after a publication replaced a site's layout, whatever the site's kind (portal, group, user, template): a listener keyed on pages or spaces checks the kind itself
      See Also:
    • SITE_OUTDATED_MESSAGE

      public static final String SITE_OUTDATED_MESSAGE
      See Also:
  • Constructor Details

    • SiteLayoutService

      public SiteLayoutService()
  • Method Details

    • getSite

      public org.exoplatform.portal.config.model.PortalConfig getSite(long siteId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • getSiteLayout

      public org.exoplatform.portal.config.model.ModelObject getSiteLayout(org.exoplatform.portal.mop.SiteKey siteKey, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • getSite

      public org.exoplatform.portal.config.model.PortalConfig getSite(org.exoplatform.portal.mop.SiteKey siteKey, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • createSite

      public org.exoplatform.portal.config.model.PortalConfig createSite(SiteCreateModel createModel, String username) throws IllegalAccessException, org.exoplatform.commons.ObjectAlreadyExistsException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.ObjectAlreadyExistsException
    • createDraftSite

      public org.exoplatform.portal.mop.SiteKey createDraftSite(org.exoplatform.portal.mop.SiteKey siteKey, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • deleteUserDraftSites

      public void deleteUserDraftSites(String username)
      Removes the draft sites of a deleted user: every draft site whose name ends with _draft_<username>, a name another user could also have produced included. A non-administrator couldn't open such a draft while the deleted user existed and might afterwards; an administrator's draft of that name is removed too.
      Parameters:
      username - deleted user
    • updateSite

      public void updateSite(SiteUpdateModel updateModel, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • updateSiteAndPermissions

      public void updateSiteAndPermissions(org.exoplatform.portal.mop.SiteKey siteKey, SitePropertiesUpdate properties, PermissionUpdateModel permissions, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Updates a site's permissions, then its properties, the way the sites administration does it in two requests: the permissions first, so a refusal on them leaves the properties untouched; then the properties, every one the caller did not state kept from the stored site. A stated label or description is also written as the site's translation in the platform's default language, the one the sites list shows ahead of the stored property, as the form's main field does; the other languages keep their translation. The edit right is checked once, before the first write, so handing the edit right to a group the caller is not in applies, with or without properties, as the permissions drawer's own request does. The properties save, which consumes the banner upload, comes last: when it fails, or when a translation write fails, what was written before it is put back, the permissions first, then each default-language translation attempted, to the value it held or to none; a put-back that fails itself is logged and the first failure is the one raised.
      Parameters:
      siteKey - the site to update
      properties - the properties the caller states, null fields kept from the stored site
      permissions - the permissions to write first, null to leave them
      username - the acting user
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the site does not exist
      IllegalAccessException - when the user may not edit the site
    • restoreSite

      public void restoreSite(org.exoplatform.portal.mop.SiteKey siteKey, org.exoplatform.portal.mop.importer.ImportMode importMode, boolean restoreSiteConfig, boolean restorePages, boolean restoreNavigationTree, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • deleteSite

      public void deleteSite(org.exoplatform.portal.mop.SiteKey siteKey, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • updateSitePermissions

      public void updateSitePermissions(PermissionUpdateModel permissionUpdateModel, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • updateSiteLayout

      public void updateSiteLayout(org.exoplatform.portal.mop.SiteKey siteKey, org.exoplatform.portal.config.model.PortalConfig site, boolean publish, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Replaces a site's layout with the given one: a draft save checks that every window the tree names still exists, a publication recreates every window with the preferences it carries and broadcasts the site publication event, as the site layout editor's publish does
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • updateSiteApplicationPreferences

      public void updateSiteApplicationPreferences(org.exoplatform.portal.mop.SiteKey siteKey, long applicationId, List<PortletInstancePreference> preferences, String username, boolean keepExisting) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Sets preferences of a window of a site's layout, as the page method does for a page window: the given values replace the window's preferences, or are set over them when keepExisting is true. Like a site layout save that is not a publication, it broadcasts nothing.
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • getSiteLabels

      public NodeLabel getSiteLabels(Long siteId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • getSiteDescriptions

      public NodeLabel getSiteDescriptions(Long siteId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException