Class ResourcesArchiverHelper.Importer.UnitaryCollectionImporter
- java.lang.Object
-
- org.ametys.plugins.contentio.archive.ResourcesArchiverHelper.Importer.UnitaryCollectionImporter
-
- All Implemented Interfaces:
UnitaryImporter<Node>
- Enclosing class:
- ResourcesArchiverHelper.Importer
private class ResourcesArchiverHelper.Importer.UnitaryCollectionImporter extends Object implements UnitaryImporter<Node>
-
-
Constructor Summary
Constructors Modifier Constructor Description private
UnitaryCollectionImporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Node
create(Path zipEntryPath, String id, Document propertiesXml)
Creates the object with the given id and XML properties file.Document
getPropertiesXml(Path zipEntryPath)
Gets the properties XML file from its ZIP pathImportReport
getReport()
TheImportReport
String
objectNameForLogs()
The name for the object to import in error logsString
retrieveId(Document propertiesXml)
Retrieves the id of the object to import from the XML file-
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.UnitaryImporter
unitaryImport, unitaryImportFinalize
-
-
-
-
Constructor Detail
-
UnitaryCollectionImporter
private UnitaryCollectionImporter()
-
-
Method Detail
-
objectNameForLogs
public String objectNameForLogs()
Description copied from interface:UnitaryImporter
The name for the object to import in error logs- Specified by:
objectNameForLogs
in interfaceUnitaryImporter<Node>
- Returns:
- The name for the object to import in error logs
-
getPropertiesXml
public Document getPropertiesXml(Path zipEntryPath) throws Exception
Description copied from interface:UnitaryImporter
Gets the properties XML file from its ZIP path- Specified by:
getPropertiesXml
in interfaceUnitaryImporter<Node>
- Parameters:
zipEntryPath
- The ZIP entry path of the XML file- Returns:
- The properties XML file
- Throws:
Exception
- if an error occurs
-
retrieveId
public String retrieveId(Document propertiesXml) throws Exception
Description copied from interface:UnitaryImporter
Retrieves the id of the object to import from the XML file- Specified by:
retrieveId
in interfaceUnitaryImporter<Node>
- Parameters:
propertiesXml
- The properties XML file- Returns:
- The id of the object to import
- Throws:
Exception
- if an error occurs
-
create
public Node create(Path zipEntryPath, String id, Document propertiesXml) throws Archivers.AmetysObjectNotImportedException, Exception
Description copied from interface:UnitaryImporter
Creates the object with the given id and XML properties file.
Note that the implementation must create the object with the given id, but it can also create sub-objects for this unitary object (for instance a Resource as an attachment for a Content, etc.).- Specified by:
create
in interfaceUnitaryImporter<Node>
- Parameters:
zipEntryPath
- The ZIP entry path of the XML fileid
- The id of the object to importpropertiesXml
- The properties XML file- Returns:
- The created object
- Throws:
Archivers.AmetysObjectNotImportedException
- If the object was not imported due to an exception (for instance an attribute is missing in the XML file). Then the object is ignored and the import will continue to the next object.ImportGlobalFailException
- If the global import process must stop due to any fatal exception.Exception
- if another unexpected error occurs
-
getReport
public ImportReport getReport()
Description copied from interface:UnitaryImporter
TheImportReport
- Specified by:
getReport
in interfaceUnitaryImporter<Node>
- Returns:
- The
ImportReport
-
-