Package org.mycore.impex
Class MCRTransferPackage
java.lang.Object
org.mycore.impex.MCRTransferPackage
Basic transfer package containing a
MCRObject
, all its descendants,
links, derivates (including their files) and referenced classifications.
To build a transfer package call build()
, this initializes
all required objects and checks if they are valid. Call getContent()
to retrieve the content afterwards.
- Author:
- Silvio Hermann, Matthias Eichner
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Set of classifications.static final String
protected List<MCRTransferPackageFileContainer>
List of transfer package file containers.static final String
protected LinkedHashSet<MCRObject>
Set of objects including the source, its descendants and all resolved links.protected MCRObject
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
build()
Builds the transfer package.protected List<MCRTransferPackageFileContainer>
buildFileContainers
(MCRObject object) Builds a list ofMCRTransferPackageFileContainer
for all derivate's of the given object and all its descendants.Generates an xml file, which contains import configuration.Returns the content for this transfer package.Returns the source of this transfer package.protected void
resolveChildrenAndLinks
(MCRObject object, LinkedHashMap<MCRObjectID, MCRObject> objectMap, Set<MCRCategoryID> categories) Fills the given objectMap with all children and links of the object.toString()
-
Field Details
-
IMPORT_CONFIG_FILENAME
- See Also:
-
CONTENT_PATH
- See Also:
-
CLASS_PATH
- See Also:
-
source
-
objects
Set of objects including the source, its descendants and all resolved links. Its linked because the import order matters. -
fileContainers
List of transfer package file containers. -
classifications
Set of classifications.
-
-
Constructor Details
-
MCRTransferPackage
-
-
Method Details
-
build
Builds the transfer package.- Throws:
MCRUsageException
- is thrown if some of the referenced objects or derivates couldn't be retrieved
-
resolveChildrenAndLinks
protected void resolveChildrenAndLinks(MCRObject object, LinkedHashMap<MCRObjectID, MCRObject> objectMap, Set<MCRCategoryID> categories) Fills the given objectMap with all children and links of the object. The object itself is also added.- Parameters:
object
- the source objectobjectMap
- the map which will be created
-
buildFileContainers
Builds a list ofMCRTransferPackageFileContainer
for all derivate's of the given object and all its descendants.TODO: derivates of linked objects are not added
- Parameters:
object
- the object- Returns:
- list of transfer packages file container
-
buildImportConfiguration
Generates an xml file, which contains import configuration.- Returns:
- import configuration document
-
getContent
Returns the content for this transfer package. You have to callbuild()
before you can retrieve this data.- Returns:
- a map where key = filename; value = MCRContent
- Throws:
IOException
-
getSource
Returns the source of this transfer package.- Returns:
- the source
-
toString
-