Class ContentsArchiverHelper.Importer
- java.lang.Object
-
- org.ametys.plugins.contentio.archive.ContentsArchiverHelper.Importer
-
- Enclosing class:
- ContentsArchiverHelper
private class ContentsArchiverHelper.Importer extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
ContentsArchiverHelper.Importer.UnitaryContentImporter
-
Field Summary
Fields Modifier and Type Field Description private DocumentBuilder
_builder
private String
_commonPrefix
private Collection<ContentsArchiverHelper.ContentFiller>
_contentFillers
private org.slf4j.Logger
_logger
private Merger
_merger
(package private) ImportReport
_report
private AmetysObjectCollection
_root
private ContentsArchiverHelper.Importer.UnitaryContentImporter
_unitaryImporter
private Path
_zipArchivePath
-
Constructor Summary
Constructors Constructor Description Importer(String commonPrefix, AmetysObjectCollection root, Path zipArchivePath, Merger merger, Collection<ContentsArchiverHelper.ContentFiller> contentFillers, org.slf4j.Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
_createAcl(Node node, String zipAclEntryPath)
private DefaultContent
_createChild(String uuid, String contentDesiredName, String type)
private DefaultContent
_createContent(Path contentZipEntry, Document propertiesXml)
private void
_createContentAcl(Node contentNode, Path contentZipEntryPath)
private void
_createRootContentAcl()
private void
_fillAdditionalContentAttributes(DefaultContent content)
private void
_fillContent(ModifiableContent content, Document propertiesXml, Path contentZipEntry)
private ImportReport
_fillContentAttachments(DefaultContent createdContent, Path contentZipEntry)
private void
_fillContentNode(DefaultContent content, Document propertiesXml, Path contentZipEntry)
private void
_fillRoot()
private Document
_getContentPropertiesXml(Path zipEntryPath)
private String
_getUnusedContentName(String desiredName)
private void
_handleWorkflow(String workflowName, WorkflowAwareContent createdContent)
private Optional<DefaultContent>
_importContent(Path zipEntryPath)
private Stream<Path>
_matchingZippedFiles()
private String[]
_retrieveContentTypes(Path contentZipEntry, Document propertiesXml, String xPath)
private void
_setContentMandatoryProperties(DefaultContent content, String[] contentTypes, String[] mixins, Document propertiesXml)
private void
_setOutgoingReferences(DefaultContent content)
(package private) List<DefaultContent>
importRoot()
-
-
-
Field Detail
-
_report
final ImportReport _report
-
_commonPrefix
private final String _commonPrefix
-
_root
private final AmetysObjectCollection _root
-
_zipArchivePath
private final Path _zipArchivePath
-
_contentFillers
private final Collection<ContentsArchiverHelper.ContentFiller> _contentFillers
-
_logger
private final org.slf4j.Logger _logger
-
_builder
private final DocumentBuilder _builder
-
_unitaryImporter
private final ContentsArchiverHelper.Importer.UnitaryContentImporter _unitaryImporter
-
-
Constructor Detail
-
Importer
Importer(String commonPrefix, AmetysObjectCollection root, Path zipArchivePath, Merger merger, Collection<ContentsArchiverHelper.ContentFiller> contentFillers, org.slf4j.Logger logger) throws ParserConfigurationException
- Throws:
ParserConfigurationException
-
-
Method Detail
-
importRoot
List<DefaultContent> importRoot() throws IOException
- Throws:
IOException
-
_fillRoot
private void _fillRoot() throws IOException
- Throws:
IOException
-
_createRootContentAcl
private void _createRootContentAcl() throws IOException
- Throws:
IOException
-
_createContentAcl
private void _createContentAcl(Node contentNode, Path contentZipEntryPath) throws IOException
- Throws:
IOException
-
_createAcl
private void _createAcl(Node node, String zipAclEntryPath) throws IOException
- Throws:
IOException
-
_matchingZippedFiles
private Stream<Path> _matchingZippedFiles() throws IOException
- Throws:
IOException
-
_importContent
private Optional<DefaultContent> _importContent(Path zipEntryPath) throws ImportGlobalFailException
- Throws:
ImportGlobalFailException
-
_getContentPropertiesXml
private Document _getContentPropertiesXml(Path zipEntryPath) throws SAXException, IOException
- Throws:
SAXException
IOException
-
_createContent
private DefaultContent _createContent(Path contentZipEntry, Document propertiesXml) throws Archivers.AmetysObjectNotImportedException, Exception
-
_retrieveContentTypes
private String[] _retrieveContentTypes(Path contentZipEntry, Document propertiesXml, String xPath) throws TransformerException, Archivers.AmetysObjectNotImportedException
-
_createChild
private DefaultContent _createChild(String uuid, String contentDesiredName, String type) throws AccessDeniedException, ItemNotFoundException, RepositoryException
-
_getUnusedContentName
private String _getUnusedContentName(String desiredName)
-
_setContentMandatoryProperties
private void _setContentMandatoryProperties(DefaultContent content, String[] contentTypes, String[] mixins, Document propertiesXml) throws TransformerException, Archivers.AmetysObjectNotImportedException
-
_fillContentNode
private void _fillContentNode(DefaultContent content, Document propertiesXml, Path contentZipEntry) throws TransformerException, Exception
- Throws:
TransformerException
Exception
-
_fillContent
private void _fillContent(ModifiableContent content, Document propertiesXml, Path contentZipEntry) throws Exception
- Throws:
Exception
-
_fillContentAttachments
private ImportReport _fillContentAttachments(DefaultContent createdContent, Path contentZipEntry) throws IOException, RepositoryException
- Throws:
IOException
RepositoryException
-
_fillAdditionalContentAttributes
private void _fillAdditionalContentAttributes(DefaultContent content)
-
_setOutgoingReferences
private void _setOutgoingReferences(DefaultContent content)
-
_handleWorkflow
private void _handleWorkflow(String workflowName, WorkflowAwareContent createdContent) throws com.opensymphony.workflow.WorkflowException
- Throws:
com.opensymphony.workflow.WorkflowException
-
-