Class ContentsArchiverHelper
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.contentio.archive.ContentsArchiverHelper
-
- All Implemented Interfaces:
LogEnabled,Component,Serviceable
public class ContentsArchiverHelper extends AbstractLogEnabled implements Component, Serviceable
Export a contents collection as individual XML files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceContentsArchiverHelper.ContentFillerA filler in order to fill additional attributes on imported contents
-
Constructor Summary
Constructors Constructor Description ContentsArchiverHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexportContents(String prefix, Node rootNode, ZipOutputStream zos)Exports contents from a root Node.voidexportContents(String prefix, TraversableAmetysObject rootContents, ZipOutputStream zos)Exports contents from a root AmetysObject.ImportReportimportContents(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
-
-
-
-
Constructor Detail
-
ContentsArchiverHelper
public ContentsArchiverHelper()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
exportContents
public void exportContents(String prefix, Node rootNode, ZipOutputStream zos) throws 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:
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
-
-