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
Component for copying site or pages
-
Field Summary
Modifier and TypeFieldDescriptionprotected ServiceManager
The service manager.static final String
Avalon Role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 Details
-
ROLE
Avalon Role -
_manager
The service manager.
-
-
Constructor Details
-
CopySiteComponent
public CopySiteComponent()
-
-
Method Details
-
service
- 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
-
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
-