public class CopySiteComponent extends AbstractLogEnabled implements Component, Serviceable
Modifier and Type | Field and Description |
---|---|
private ContentTypesHelper |
_contentTypesHelper |
private ContentTypeExtensionPoint |
_cTypeEP |
private OutgoingReferencesExtractor |
_outgoingReferencesExtractor |
private AmetysObjectResolver |
_resolver |
private SAXParser |
_saxParser |
private CopyUpdaterExtensionPoint |
_updaterEP |
private WorkflowProvider |
_workflowProvider |
static String |
ROLE
Avalon Role
|
Constructor and Description |
---|
CopySiteComponent() |
Modifier and Type | Method and Description |
---|---|
private boolean |
_isAmetysObject(CompositeMetadata metadataHolder,
String metadataName) |
private void |
_reinitWorkflow(WorkflowAwareContent content) |
private void |
_updatePageAfterCopy(Site originalSite,
Site createdSite,
Page page) |
private void |
_updateReferencesToAmetysObjects(CompositeMetadata metadataHolder,
TraversableAmetysObject originalAO,
TraversableAmetysObject createdAO) |
private void |
_updateReferenceToAmetysObject(CompositeMetadata metadataHolder,
String metadataName,
TraversableAmetysObject originalAO,
TraversableAmetysObject createdAO) |
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 copy
|
void |
updateLinksInRichText(TraversableAmetysObject initialAO,
TraversableAmetysObject createdAO,
Content initialContent,
Content createdContent)
This method analyzes content rich texts and update links if necessary
|
void |
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 copy
|
void |
updateReferencesAfterCopy(Page originalPage,
Page createdPage)
This methods must be used after calling
copyTo 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 calling
copyTo on a Site. |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private AmetysObjectResolver _resolver
private WorkflowProvider _workflowProvider
private ContentTypeExtensionPoint _cTypeEP
private ContentTypesHelper _contentTypesHelper
private SAXParser _saxParser
private CopyUpdaterExtensionPoint _updaterEP
private OutgoingReferencesExtractor _outgoingReferencesExtractor
public CopySiteComponent()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
public void updateReferencesAfterCopy(Page originalPage, Page createdPage) throws AmetysRepositoryException
copyTo
on a Page.
Its updates references to ametys objects for metadata of new created pages and contentsoriginalPage
- the original pagecreatedPage
- the created page after a copyAmetysRepositoryException
- if an error occurspublic void updateSiteAfterCopy(Site originalSite, Site createdSite) throws AmetysRepositoryException
copyTo
on a Site.
Its updates contents and pages after a site copyoriginalSite
- the original sitecreatedSite
- the created site after copyAmetysRepositoryException
- if an error occurspublic void updateContentsAfterCopy(Site initialSite, Site createdSite) throws AmetysRepositoryException
initialSite
- the original sitecreatedSite
- the created site after copyAmetysRepositoryException
- if an error occurspublic void updateSharedContent(WebContent initialContent, WebContent destContent)
initialContent
- the initial content.destContent
- the destination content.public void updateSharedContent(WebContent initialContent, WebContent destContent, boolean reinitWorkflow)
initialContent
- the initial content.destContent
- the destination content.reinitWorkflow
- set to 'true' to reinitialize the workflowpublic void updateLinksInRichText(TraversableAmetysObject initialAO, TraversableAmetysObject createdAO, Content initialContent, Content createdContent) throws AmetysRepositoryException
initialAO
- The initial object copiedcreatedAO
- The target objectinitialContent
- The initial contentcreatedContent
- The created content after copy to updateAmetysRepositoryException
- if an error occurspublic void updatePagesAfterCopy(Site originalSite, Site createdSite) throws AmetysRepositoryException
originalSite
- the original sitecreatedSite
- the created site after copyAmetysRepositoryException
- if an error occursprivate void _updatePageAfterCopy(Site originalSite, Site createdSite, Page page) throws AmetysRepositoryException
AmetysRepositoryException
private void _updateReferencesToAmetysObjects(CompositeMetadata metadataHolder, TraversableAmetysObject originalAO, TraversableAmetysObject createdAO)
private void _updateReferenceToAmetysObject(CompositeMetadata metadataHolder, String metadataName, TraversableAmetysObject originalAO, TraversableAmetysObject createdAO) throws AmetysRepositoryException
AmetysRepositoryException
private boolean _isAmetysObject(CompositeMetadata metadataHolder, String metadataName)
private void _reinitWorkflow(WorkflowAwareContent content) throws AmetysRepositoryException
AmetysRepositoryException