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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA filler in order to fill additional attributes on imported contents -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexportContents(String prefix, javax.jcr.Node rootNode, ZipOutputStream zos) Exports contents from a root Node.voidexportContents(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 contentsvoidservice(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:
servicein 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 rootJCRTraversableAmetysObjectholding the contents collection.zipPath- the input zip pathmerger- TheMergercontentFillers- The fillers in order to fill additional attributes on imported contents- Returns:
- The
ImportReport - Throws:
IOException- if an error occurs while importing archive
-