Class DefaultPluginArchiver
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.contentio.archive.DefaultPluginArchiver
-
- All Implemented Interfaces:
PluginArchiver
,LogEnabled
,Serviceable
- Direct Known Subclasses:
DefaultSitePluginArchiver
,WebExplorerArchiver
public class DefaultPluginArchiver extends AbstractLogEnabled implements PluginArchiver, Serviceable
Default implementation of aPluginArchiver
. It uses the JCR system view for all data but contents. For contents, theContentsArchiverHelper
is used.
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__CONTENT_ROOT_NODE_NAME
private AmetysObjectCollectionFactory
_ametysObjectCollectionFactory
private ContentsArchiverHelper
_contentsArchiverHelper
static String
EXTENSION_ID
Id for default implementation
-
Constructor Summary
Constructors Constructor Description DefaultPluginArchiver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_importPluginXml(Node allPluginsNode, Path zipPath, String zipPluginEntryPath, Merger merger)
void
export(String pluginName, Node pluginNode, ZipOutputStream zos, String prefix)
Export plugin data into the destination archiveprotected ContentHandler
getSystemViewHandler(ContentHandler initialHandler)
Returns the actual handler receiving the JCR system view.protected ImportReport
importContentsIfAny(String pluginName, Node allPluginsNode, Path zipPath, String zipPluginEntryPath, Merger merger)
Import some contents if there is a folder named 'contents'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.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
-
EXTENSION_ID
public static final String EXTENSION_ID
Id for default implementation- See Also:
- Constant Field Values
-
__CONTENT_ROOT_NODE_NAME
private static final String __CONTENT_ROOT_NODE_NAME
- See Also:
- Constant Field Values
-
_contentsArchiverHelper
private ContentsArchiverHelper _contentsArchiverHelper
-
_ametysObjectCollectionFactory
private AmetysObjectCollectionFactory _ametysObjectCollectionFactory
-
-
Constructor Detail
-
DefaultPluginArchiver
public DefaultPluginArchiver()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
export
public void export(String pluginName, Node pluginNode, ZipOutputStream zos, String prefix) throws IOException
Description copied from interface:PluginArchiver
Export plugin data into the destination archive- Specified by:
export
in interfacePluginArchiver
- Parameters:
pluginName
- the plugin name.pluginNode
- 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)
Returns the actual handler receiving the JCR system view. May be used to filter out some parts of the JCR export.- 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
- 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.
-
_importPluginXml
private void _importPluginXml(Node allPluginsNode, Path zipPath, String zipPluginEntryPath, Merger merger) throws IOException
- Throws:
IOException
-
importContentsIfAny
protected ImportReport importContentsIfAny(String pluginName, Node allPluginsNode, Path zipPath, String zipPluginEntryPath, Merger merger) throws IOException
Import some contents if there is a folder named 'contents'- 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.
-
-