Package org.dspace.app.itemupdate
Class ItemArchive
- java.lang.Object
-
- org.dspace.app.itemupdate.ItemArchive
-
public class ItemArchive extends Object
Encapsulates the Item in the context of the DSpace Archive Format
-
-
Field Summary
Fields Modifier and Type Field Description protected static DocumentBuilderbuilderprotected Filedirprotected Stringdirnameprotected List<org.dspace.app.itemupdate.DtoMetadata>dtomListstatic StringDUBLIN_CORE_XMLprotected HandleServicehandleServiceprotected Itemitemprotected ItemServiceitemServiceprotected Transformertransformerprotected List<UUID>undoAddContentsprotected List<org.dspace.app.itemupdate.DtoMetadata>undoDtomList
-
Constructor Summary
Constructors Modifier Constructor Description protectedItemArchive()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddUndoDeleteContents(UUID bitstreamId)Add bitstream id to delete contents filevoidaddUndoMetadataField(org.dspace.app.itemupdate.DtoMetadata dtom)Add metadata field to undo liststatic ItemArchivecreate(Context context, File dir, String itemField)factory method Minimal requirements for dublin_core.xml for this application is the presence of dc.identifier.uri which must contain the handle for the itemFilegetDirectory()Getter for directory in archive on diskStringgetDirectoryName()Getter for directory name in archiveprotected static DocumentBuildergetDocumentBuilder()ItemgetItem()Getter for the DSpace item referenced in the archiveList<org.dspace.app.itemupdate.DtoMetadata>getMetadataFields()Getter for list of metadata fieldsprotected TransformergetTransformer()Getter for TransformervoidwriteUndo(File undoDir)write undo directory and files to Disk in archive format
-
-
-
Field Detail
-
DUBLIN_CORE_XML
public static final String DUBLIN_CORE_XML
- See Also:
- Constant Field Values
-
builder
protected static DocumentBuilder builder
-
transformer
protected Transformer transformer
-
dtomList
protected List<org.dspace.app.itemupdate.DtoMetadata> dtomList
-
undoDtomList
protected List<org.dspace.app.itemupdate.DtoMetadata> undoDtomList
-
item
protected Item item
-
dir
protected File dir
-
dirname
protected String dirname
-
handleService
protected HandleService handleService
-
itemService
protected ItemService itemService
-
-
Method Detail
-
create
public static ItemArchive create(Context context, File dir, String itemField) throws Exception
factory method Minimal requirements for dublin_core.xml for this application is the presence of dc.identifier.uri which must contain the handle for the item- Parameters:
context- - The DSpace contextdir- - The directory File in the source archiveitemField- - The metadata field in which the Item identifier is located if null, the default is the handle in the dc.identifier.uri field- Returns:
- ItemArchive object
- Throws:
Exception- if error
-
getDocumentBuilder
protected static DocumentBuilder getDocumentBuilder() throws ParserConfigurationException
- Throws:
ParserConfigurationException
-
getTransformer
protected Transformer getTransformer() throws TransformerConfigurationException
Getter for Transformer- Returns:
- Transformer
- Throws:
TransformerConfigurationException- if config error
-
getItem
public Item getItem()
Getter for the DSpace item referenced in the archive- Returns:
- DSpace item
-
getDirectory
public File getDirectory()
Getter for directory in archive on disk- Returns:
- directory in archive
-
getDirectoryName
public String getDirectoryName()
Getter for directory name in archive- Returns:
- directory name in archive
-
addUndoMetadataField
public void addUndoMetadataField(org.dspace.app.itemupdate.DtoMetadata dtom)
Add metadata field to undo list- Parameters:
dtom- DtoMetadata (represents metadata field)
-
getMetadataFields
public List<org.dspace.app.itemupdate.DtoMetadata> getMetadataFields()
Getter for list of metadata fields- Returns:
- list of metadata fields
-
addUndoDeleteContents
public void addUndoDeleteContents(UUID bitstreamId)
Add bitstream id to delete contents file- Parameters:
bitstreamId- bitstream ID
-
writeUndo
public void writeUndo(File undoDir) throws IOException, ParserConfigurationException, TransformerConfigurationException, TransformerException, FileNotFoundException
write undo directory and files to Disk in archive format- Parameters:
undoDir- - the root directory of the undo archive- Throws:
IOException- if IO errorParserConfigurationException- if config errorTransformerConfigurationException- if transformer config errorTransformerException- if transformer errorFileNotFoundException- if file not found
-
-