Class ContentsArchiverHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.contentio.archive.ContentsArchiverHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
Export a contents collection as individual XML files.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
A filler in order to fill additional attributes on imported contents -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
exportContents
(String prefix, javax.jcr.Node rootNode, ZipOutputStream zos) Exports contents from a root Node.void
exportContents
(String prefix, TraversableAmetysObject rootContents, ZipOutputStream zos) Exports contents from a root AmetysObject.importContents
(String commonPrefix, AmetysObjectCollection rootContents, Path zipPath, Merger merger, Collection<ContentsArchiverHelper.ContentFiller> contentFillers) Imports contents from the given ZIP archive and path, under the given root of contentsvoid
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon role.
-
-
Constructor Details
-
ContentsArchiverHelper
public ContentsArchiverHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
exportContents
public void exportContents(String prefix, javax.jcr.Node rootNode, ZipOutputStream zos) throws javax.jcr.RepositoryException, IOException Exports contents from a root Node.- Parameters:
prefix
- the prefix for the ZIP archive.rootNode
- the root JCR Node holding the contents collection.zos
- the ZIP OutputStream.- Throws:
javax.jcr.RepositoryException
- if an error occurs while resolving Node.IOException
- if an error occurs while archiving
-
exportContents
public void exportContents(String prefix, TraversableAmetysObject rootContents, ZipOutputStream zos) throws IOException Exports contents from a root AmetysObject.- Parameters:
prefix
- the prefix for the ZIP archive.rootContents
- the root JCR Node holding the contents collection.zos
- the ZIP OutputStream.- Throws:
IOException
- if an error occurs while archiving
-
importContents
public ImportReport importContents(String commonPrefix, AmetysObjectCollection rootContents, Path zipPath, Merger merger, Collection<ContentsArchiverHelper.ContentFiller> contentFillers) throws IOException Imports contents from the given ZIP archive and path, under the given root of contents- Parameters:
commonPrefix
- The common prefix in the ZIP archiverootContents
- the rootJCRTraversableAmetysObject
holding the contents collection.zipPath
- the input zip pathmerger
- TheMerger
contentFillers
- The fillers in order to fill additional attributes on imported contents- Returns:
- The
ImportReport
- Throws:
IOException
- if an error occurs while importing archive
-