Package org.ametys.web.repository.page
Class CopySiteComponent
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.web.repository.page.CopySiteComponent
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
public class CopySiteComponent extends AbstractLogEnabled implements Component, Serviceable
Component for copying site or pages
-
-
Field Summary
Fields Modifier and Type Field Description protected ServiceManager
_manager
The service manager.static String
ROLE
Avalon Role
-
Constructor Summary
Constructors Constructor Description CopySiteComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
service(ServiceManager serviceManager)
void
updateContentsAfterCopy(Site initialSite, Site createdSite)
This method re-initializes workflow, updates the site name for web content and updates references to ametys objects on metadata after a site copyvoid
updateLinksInRichText(TraversableAmetysObject initialAO, TraversableAmetysObject createdAO, Content initialContent, Content createdContent)
This method analyzes content rich texts and update links if necessaryvoid
updatePagesAfterCopy(Site originalSite, Site createdSite)
This method updates the site name of pages and updates references to ametys objects on page's metadata after a site copyvoid
updateReferencesAfterCopy(Page originalPage, Page createdPage)
This methods must be used after callingcopyTo
on a Page.void
updateSharedContent(WebContent initialContent, WebContent destContent)
Updates references all references in a content to another one.void
updateSharedContent(WebContent initialContent, WebContent destContent, boolean reinitWorkflow)
Updates references all references in a content to another one.void
updateSiteAfterCopy(Site originalSite, Site createdSite)
This method must be used after callingcopyTo
on a Site.-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_manager
protected ServiceManager _manager
The service manager.
-
-
Constructor Detail
-
CopySiteComponent
public CopySiteComponent()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
updateReferencesAfterCopy
public void updateReferencesAfterCopy(Page originalPage, Page createdPage) throws AmetysRepositoryException
This methods must be used after callingcopyTo
on a Page. Its updates references to ametys objects for metadata of new created pages and contents- Parameters:
originalPage
- the original pagecreatedPage
- the created page after a copy- Throws:
AmetysRepositoryException
- if an error occurs
-
updateSiteAfterCopy
public void updateSiteAfterCopy(Site originalSite, Site createdSite) throws AmetysRepositoryException
This method must be used after callingcopyTo
on a Site. Its updates contents and pages after a site copy- Parameters:
originalSite
- the original sitecreatedSite
- the created site after copy- Throws:
AmetysRepositoryException
- if an error occurs
-
updateContentsAfterCopy
public void updateContentsAfterCopy(Site initialSite, Site createdSite) throws AmetysRepositoryException
This method re-initializes workflow, updates the site name for web content and updates references to ametys objects on metadata after a site copy- Parameters:
initialSite
- the original sitecreatedSite
- the created site after copy- Throws:
AmetysRepositoryException
- if an error occurs
-
updateSharedContent
public void updateSharedContent(WebContent initialContent, WebContent destContent)
Updates references all references in a content to another one.- Parameters:
initialContent
- the initial content.destContent
- the destination content.
-
updateSharedContent
public void updateSharedContent(WebContent initialContent, WebContent destContent, boolean reinitWorkflow)
Updates references all references in a content to another one.- Parameters:
initialContent
- the initial content.destContent
- the destination content.reinitWorkflow
- set to 'true' to reinitialize the workflow
-
updateLinksInRichText
public void updateLinksInRichText(TraversableAmetysObject initialAO, TraversableAmetysObject createdAO, Content initialContent, Content createdContent) throws AmetysRepositoryException
This method analyzes content rich texts and update links if necessary- Parameters:
initialAO
- The initial object copiedcreatedAO
- The target objectinitialContent
- The initial contentcreatedContent
- The created content after copy to update- Throws:
AmetysRepositoryException
- if an error occurs
-
updatePagesAfterCopy
public void updatePagesAfterCopy(Site originalSite, Site createdSite) throws AmetysRepositoryException
This method updates the site name of pages and updates references to ametys objects on page's metadata after a site copy- Parameters:
originalSite
- the original sitecreatedSite
- the created site after copy- Throws:
AmetysRepositoryException
- if an error occurs
-
-