Class WebExplorerArchiver
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.contentio.archive.DefaultPluginArchiver
-
- org.ametys.plugins.webcontentio.archive.WebExplorerArchiver
-
- All Implemented Interfaces:
PluginArchiver
,LogEnabled
,Serviceable
public class WebExplorerArchiver extends DefaultPluginArchiver
SitePluginArchiver
handling the "web-explorer" part, holding all shared resources.
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__SHARED_RESOURCES_NODE_NAME
private static String
__WEB_EXPLORER_NODE_NAME
private AmetysObjectResolver
_resolver
private ResourcesArchiverHelper
_resourcesArchiverHelper
-
Fields inherited from class org.ametys.plugins.contentio.archive.DefaultPluginArchiver
EXTENSION_ID
-
-
Constructor Summary
Constructors Constructor Description WebExplorerArchiver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Node
_getWebExplorerNode(Node allPluginsNode)
private ImportReport
_importSharedResources(Node webExplorerNode, Path zipPath, String zipSharedResourcesEntryPath, Merger merger)
private void
_removeWebExplorerNode(Node allPluginsNode)
void
export(String pluginName, Node node, ZipOutputStream zos, String prefix)
Export plugin data into the destination archiveprotected ContentHandler
getSystemViewHandler(ContentHandler initialHandler)
Returns the actual handler receiving the JCR system view.ImportReport
partialImport(String pluginName, Node allPluginsNode, Path zipPath, String zipPluginEntryPath, Merger merger)
Import plugin data from the source archivevoid
service(ServiceManager manager)
-
Methods inherited from class org.ametys.plugins.contentio.archive.DefaultPluginArchiver
importContentsIfAny
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.contentio.archive.PluginArchiver
deleteBeforePartialImport
-
-
-
-
Field Detail
-
__WEB_EXPLORER_NODE_NAME
private static final String __WEB_EXPLORER_NODE_NAME
- See Also:
- Constant Field Values
-
__SHARED_RESOURCES_NODE_NAME
private static final String __SHARED_RESOURCES_NODE_NAME
- See Also:
- Constant Field Values
-
_resolver
private AmetysObjectResolver _resolver
-
_resourcesArchiverHelper
private ResourcesArchiverHelper _resourcesArchiverHelper
-
-
Constructor Detail
-
WebExplorerArchiver
public WebExplorerArchiver()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classDefaultPluginArchiver
- Throws:
ServiceException
-
export
public void export(String pluginName, Node node, ZipOutputStream zos, String prefix) throws IOException
Description copied from interface:PluginArchiver
Export plugin data into the destination archive- Specified by:
export
in interfacePluginArchiver
- Overrides:
export
in classDefaultPluginArchiver
- Parameters:
pluginName
- the plugin name.node
- the pluginNode
.zos
- the output data stream.prefix
- the prefix for ZIP entries.- Throws:
IOException
- if an error occurs while writing entries to the archive.
-
getSystemViewHandler
protected ContentHandler getSystemViewHandler(ContentHandler initialHandler)
Description copied from class:DefaultPluginArchiver
Returns the actual handler receiving the JCR system view. May be used to filter out some parts of the JCR export.- Overrides:
getSystemViewHandler
in classDefaultPluginArchiver
- Parameters:
initialHandler
- the targetContentHandler
.- Returns:
- a ContentHandler.
-
partialImport
public ImportReport partialImport(String pluginName, Node allPluginsNode, Path zipPath, String zipPluginEntryPath, Merger merger) throws IOException
Description copied from interface:PluginArchiver
Import plugin data from the source archive- Specified by:
partialImport
in interfacePluginArchiver
- Overrides:
partialImport
in classDefaultPluginArchiver
- Parameters:
pluginName
- the plugin name.allPluginsNode
- theNode
for all plugins.zipPath
- The input ZIP filezipPluginEntryPath
- The input ZIP entrymerger
- TheMerger
- Returns:
- The
ImportReport
- Throws:
IOException
- if an error occurs while reading the archive.
-
_removeWebExplorerNode
private void _removeWebExplorerNode(Node allPluginsNode) throws IOException
- Throws:
IOException
-
_getWebExplorerNode
private Node _getWebExplorerNode(Node allPluginsNode) throws IOException
- Throws:
IOException
-
_importSharedResources
private ImportReport _importSharedResources(Node webExplorerNode, Path zipPath, String zipSharedResourcesEntryPath, Merger merger) throws IOException
- Throws:
IOException
-
-