Class SitesArchiver
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.webcontentio.archive.SitesArchiver
-
- All Implemented Interfaces:
Archiver
,LogEnabled
,Serviceable
public class SitesArchiver extends AbstractLogEnabled implements Archiver, Serviceable
Archiver
for all sites.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
SitesArchiver.SitesArchiverManifestReaderWriter
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SitesArchiver()
-
Method Summary
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
ID
public static final String ID
Archiver id.- See Also:
- Constant Field Values
-
__SITE_RESOURCES_JCR_NODE_NAME
static final String __SITE_RESOURCES_JCR_NODE_NAME
- See Also:
- Constant Field Values
-
__SITE_CONTENTS_JCR_NODE_NAME
static final String __SITE_CONTENTS_JCR_NODE_NAME
- See Also:
- Constant Field Values
-
__SITE_PLUGINS_JCR_NODE_NAME
static final String __SITE_PLUGINS_JCR_NODE_NAME
- See Also:
- Constant Field Values
-
__COMMON_PREFIX
static final String __COMMON_PREFIX
- See Also:
- Constant Field Values
-
__ACL_ZIP_ENTRY_FILENAME
static final String __ACL_ZIP_ENTRY_FILENAME
- See Also:
- Constant Field Values
-
__PARTIAL_IMPORT_PREFIX
private static final String __PARTIAL_IMPORT_PREFIX
- See Also:
- Constant Field Values
-
_siteManager
protected SiteManager _siteManager
The site manager
-
_contentsArchiverHelper
protected ContentsArchiverHelper _contentsArchiverHelper
The helper for archiving contents
-
_resourcesArchiverHelper
protected ResourcesArchiverHelper _resourcesArchiverHelper
The helper for archiving resources
-
_pluginArchiverExtensionPoint
protected SitePluginArchiverExtensionPoint _pluginArchiverExtensionPoint
The extension point forSitePluginArchiver
s
-
_tagProviderEP
protected TagProviderExtensionPoint _tagProviderEP
The extension point forTagProvider
s
-
_resolver
protected AmetysObjectResolver _resolver
The Ametys Object Resolver
-
_defaultPageFactory
protected DefaultPageFactory _defaultPageFactory
The default page factory
-
_sitemapFactory
protected SitemapFactory _sitemapFactory
The sitemap factory
-
_serviceExtensionPoint
protected ServiceExtensionPoint _serviceExtensionPoint
The extension point for Services
-
_siteTypeEP
protected SiteTypesExtensionPoint _siteTypeEP
The extension point forSiteType
s
-
_pageDataTypeExtensionPoint
protected PageDataTypeExtensionPoint _pageDataTypeExtensionPoint
The page data type extension point
-
_manifestReaderWriter
private ManifestReaderWriter _manifestReaderWriter
-
-
Constructor Detail
-
SitesArchiver
public SitesArchiver()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getManifestReaderWriter
public ManifestReaderWriter getManifestReaderWriter()
Description copied from interface:Archiver
Get theManifestReaderWriter
- Specified by:
getManifestReaderWriter
in interfaceArchiver
- Returns:
- the
ManifestReaderWriter
-
export
public void export(ZipOutputStream zos) throws IOException
Description copied from interface:Archiver
Export data into the destination archive- Specified by:
export
in interfaceArchiver
- Parameters:
zos
- the output data stream.- Throws:
IOException
- if an error occurs while writing entries to the archive.
-
_exportSite
private void _exportSite(Site site, ZipOutputStream zos) throws IOException
- Throws:
IOException
-
_getSiteAttributes
private Attributes _getSiteAttributes(Site site)
-
_getAllPluginsNode
static Node _getAllPluginsNode(Site site) throws RepositoryException
- Throws:
RepositoryException
-
_getPluginNodes
private static Iterator<Node> _getPluginNodes(Site site) throws RepositoryException
- Throws:
RepositoryException
-
_retrieveSitePluginArchiver
SitePluginArchiver _retrieveSitePluginArchiver(String pluginName)
-
_exportPlugin
private void _exportPlugin(Site site, Node pluginNode, ZipOutputStream zos, String prefix) throws Exception
- Throws:
Exception
-
_exportSitemaps
private void _exportSitemaps(Site site, ZipOutputStream zos, String prefix, String siteName) throws IOException
- Throws:
IOException
-
_exportSitemap
private void _exportSitemap(Sitemap sitemap, ZipOutputStream zos, String prefix) throws IOException, RepositoryException
- Throws:
IOException
RepositoryException
-
_exportSitemapData
private void _exportSitemapData(Sitemap sitemap, ZipOutputStream zos, String sitemapPrefix) throws RepositoryException, IOException
- Throws:
RepositoryException
IOException
-
_getSitemapAttributes
private Attributes _getSitemapAttributes(Sitemap sitemap)
-
_getSitemapChildrenNodes
private static Iterator<Node> _getSitemapChildrenNodes(Sitemap sitemap) throws RepositoryException
- Throws:
RepositoryException
-
_exportPage
private void _exportPage(Node pageNode, ZipOutputStream zos, String prefix, int order) throws RepositoryException, IOException
- Throws:
RepositoryException
IOException
-
_getPageAttributes
private Attributes _getPageAttributes(Page page, int order)
-
_saxAmetysInternalProperties
private void _saxAmetysInternalProperties(PagesContainer pagesContainer, TransformerHandler contentHandler) throws SAXException
- Throws:
SAXException
-
_saxInternalPropeties
private void _saxInternalPropeties(Node node, TransformerHandler contentHandler, String... properties) throws RepositoryException, SAXException
- Throws:
RepositoryException
SAXException
-
_saxTags
private void _saxTags(Page page, TransformerHandler contentHandler) throws SAXException
- Throws:
SAXException
-
_saxAttachments
private void _saxAttachments(Page page, String pagePrefix, ZipOutputStream zos) throws IOException
- Throws:
IOException
-
_saxZones
private void _saxZones(Page page, TransformerHandler contentHandler) throws SAXException, IOException
- Throws:
SAXException
IOException
-
_saxZone
private void _saxZone(Zone zone, TransformerHandler contentHandler) throws SAXException, IOException
- Throws:
SAXException
IOException
-
_saxZoneItems
private void _saxZoneItems(AmetysObjectIterable<? extends ZoneItem> zoneItems, TransformerHandler contentHandler) throws SAXException, IOException
- Throws:
SAXException
IOException
-
_saxZoneItem
private void _saxZoneItem(ZoneItem zoneItem, TransformerHandler contentHandler) throws SAXException, IOException
- Throws:
SAXException
IOException
-
_getServiceParameters
private ModelAwareDataHolder _getServiceParameters(ZoneItem zoneItem)
-
_getZoneItemAttributes
private Attributes _getZoneItemAttributes(ZoneItem zoneItem, ZoneItem.ZoneType zoneType)
-
_getPageChildrenNodes
private static Iterator<Node> _getPageChildrenNodes(Node pageNode) throws RepositoryException
- Throws:
RepositoryException
-
additionalSuccessImportMail
public List<I18nizableText> additionalSuccessImportMail()
Description copied from interface:Archiver
Potential additional information to append to the success mail of the import process- Specified by:
additionalSuccessImportMail
in interfaceArchiver
- Returns:
- the mail additional information
-
managedPartialImports
public Collection<String> managedPartialImports(Collection<String> partialImports)
Description copied from interface:Archiver
Returns the partial imports, among the given ones, that thisArchiver
is able to manage.- Specified by:
managedPartialImports
in interfaceArchiver
- Parameters:
partialImports
- The partial imports to filter- Returns:
- The managed partial imports
-
partialImport
public ImportReport partialImport(Path zipPath, Collection<String> partialImports, Merger merger, boolean deleteBefore) throws IOException
Description copied from interface:Archiver
Import data (limited to the given partial imports) from the source archive- Specified by:
partialImport
in interfaceArchiver
- Parameters:
zipPath
- the input zip pathpartialImports
- The partial imports to do. The passed collection must already be filtered out byArchiver.managedPartialImports(java.util.Collection<java.lang.String>)
merger
- TheMerger
deleteBefore
-true
if objects need to be deleted before applying the partial imports- Returns:
- The
ImportReport
- Throws:
IOException
- if an error occurs while reading archive entries.
-
_deleteBeforePartialImport
private void _deleteBeforePartialImport(ModifiableTraversableAmetysObject siteRoot, Collection<String> partialImports) throws IOException
- Throws:
IOException
-
_deleteSiteRootBeforePartialImport
private void _deleteSiteRootBeforePartialImport(JCRAmetysObject siteRoot) throws IOException
- Throws:
IOException
-
_deleteSiteBeforePartialImport
private void _deleteSiteBeforePartialImport(String siteName) throws IOException
- Throws:
IOException
-
_retrieveSiteNames
private Collection<String> _retrieveSiteNames(Collection<String> partialImports)
-
_partialImport
private ImportReport _partialImport(Path zipPath, Collection<String> partialImports, Merger merger, ModifiableTraversableAmetysObject siteRoot) throws IOException
- Throws:
IOException
-
_saveImported
private void _saveImported(ModifiableAmetysObject siteRoot)
-
-