Class SiteLayoutService
java.lang.Object
io.meeds.layout.service.SiteLayoutService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final StringBroadcast 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 -
Method Summary
Modifier and TypeMethodDescriptionorg.exoplatform.portal.mop.SiteKeycreateDraftSite(org.exoplatform.portal.mop.SiteKey siteKey, String username) org.exoplatform.portal.config.model.PortalConfigcreateSite(SiteCreateModel createModel, String username) voiddeleteSite(org.exoplatform.portal.mop.SiteKey siteKey, String username) voiddeleteUserDraftSites(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.org.exoplatform.portal.config.model.PortalConfigorg.exoplatform.portal.config.model.PortalConfiggetSiteDescriptions(Long siteId, String username) getSiteLabels(Long siteId, String username) org.exoplatform.portal.config.model.ModelObjectgetSiteLayout(org.exoplatform.portal.mop.SiteKey siteKey, String username) voidrestoreSite(org.exoplatform.portal.mop.SiteKey siteKey, org.exoplatform.portal.mop.importer.ImportMode importMode, boolean restoreSiteConfig, boolean restorePages, boolean restoreNavigationTree, String username) voidupdateSite(SiteUpdateModel updateModel, String username) voidupdateSiteAndPermissions(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.voidupdateSiteApplicationPreferences(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.voidupdateSiteLayout(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 doesvoidupdateSitePermissions(PermissionUpdateModel permissionUpdateModel, String username)
-
Field Details
-
DISPLAYED_NOT_ACCEPTED
- See Also:
-
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
- 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.ObjectNotFoundExceptionIllegalAccessException
-
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.ObjectNotFoundExceptionIllegalAccessException
-
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.ObjectNotFoundExceptionIllegalAccessException
-
createSite
public org.exoplatform.portal.config.model.PortalConfig createSite(SiteCreateModel createModel, String username) throws IllegalAccessException, org.exoplatform.commons.ObjectAlreadyExistsException - Throws:
IllegalAccessExceptionorg.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.ObjectNotFoundExceptionIllegalAccessException
-
deleteUserDraftSites
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:
IllegalAccessExceptionorg.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 updateproperties- the properties the caller states, null fields kept from the stored sitepermissions- the permissions to write first, null to leave themusername- the acting user- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the site does not existIllegalAccessException- 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.ObjectNotFoundExceptionIllegalAccessException
-
deleteSite
public void deleteSite(org.exoplatform.portal.mop.SiteKey siteKey, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
updateSitePermissions
public void updateSitePermissions(PermissionUpdateModel permissionUpdateModel, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
IllegalAccessExceptionorg.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:
IllegalAccessExceptionorg.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:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
getSiteLabels
public NodeLabel getSiteLabels(Long siteId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-
getSiteDescriptions
public NodeLabel getSiteDescriptions(Long siteId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException
-