Package org.ametys.web.live
Class SitePopulator
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.live.SitePopulator
-
- All Implemented Interfaces:
LogEnabled,Component,Serviceable
public class SitePopulator extends AbstractLogEnabled implements Serviceable, Component
Component for populating the live workspace site by site.
-
-
Field Summary
Fields Modifier and Type Field Description private LiveAccessManager_liveAccessManagerprivate Repository_repositoryprivate SynchronizeComponent_synchronizeComponentstatic StringROLEAvalon role.
-
Constructor Summary
Constructors Constructor Description SitePopulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void_cloneContents(Session liveSession, Site site, Node siteNode, Node clonedSiteNode)private void_cloneProperties(Node siteNode, Node clonedSiteNode)Copy all properties from a site node to another.private void_cloneSitemaps(Session liveSession, Site site, Skin skin, Node siteNode, Node clonedSiteNode)private Node_cloneSiteNode(Session liveSession, Site site, Node siteNode, String siteNodePath, Node liveRootNode)Clone a site node in the live workspace.protected void_populate(Session liveSession, Node clonedSitemapsNode, Sitemap sitemap, Skin skin)Populates a sitemap.protected void_populate(Session liveSession, Site site, Skin skin)Populates a sitevoidpopulate(Site site, Skin skin)Populates the live workspace.voidservice(ServiceManager manager)-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_repository
private Repository _repository
-
_liveAccessManager
private LiveAccessManager _liveAccessManager
-
_synchronizeComponent
private SynchronizeComponent _synchronizeComponent
-
-
Constructor Detail
-
SitePopulator
public SitePopulator()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
populate
public void populate(Site site, Skin skin) throws Exception
Populates the live workspace.- Parameters:
site- the site to populate.skin- the site skin model- Throws:
Exception- if an error occurs.
-
_populate
protected void _populate(Session liveSession, Site site, Skin skin) throws RepositoryException
Populates a site- Parameters:
liveSession- the live workspace session.site- the site to populate.skin- the site skin model- Throws:
RepositoryException- if an error occurs.
-
_cloneSiteNode
private Node _cloneSiteNode(Session liveSession, Site site, Node siteNode, String siteNodePath, Node liveRootNode) throws RepositoryException
Clone a site node in the live workspace.- Parameters:
liveSession- the live session.site- the source site.siteNode- the site node to clone.siteNodePath- the site node path.liveRootNode- the live root node.- Returns:
- the cloned site node.
- Throws:
RepositoryException- if an error occurs.
-
_cloneProperties
private void _cloneProperties(Node siteNode, Node clonedSiteNode) throws RepositoryException
Copy all properties from a site node to another.- Parameters:
siteNode- the site JCR nodeclonedSiteNode- the JCR node of site to copy- Throws:
RepositoryException- if an error occurred during copy
-
_cloneContents
private void _cloneContents(Session liveSession, Site site, Node siteNode, Node clonedSiteNode) throws RepositoryException
- Throws:
RepositoryException
-
_cloneSitemaps
private void _cloneSitemaps(Session liveSession, Site site, Skin skin, Node siteNode, Node clonedSiteNode) throws PathNotFoundException, RepositoryException
-
_populate
protected void _populate(Session liveSession, Node clonedSitemapsNode, Sitemap sitemap, Skin skin) throws RepositoryException
Populates a sitemap.- Parameters:
liveSession- The live sessionclonedSitemapsNode- the cloned sitemaps node.sitemap- the sitemap to populate.skin- the site skin model- Throws:
RepositoryException- if an error occurs.
-
-