public class MetadataUtilities extends Object
| Constructor and Description |
|---|
MetadataUtilities() |
| Modifier and Type | Method and Description |
|---|---|
static void |
appendMetadata(Item item,
org.dspace.app.itemupdate.DtoMetadata dtom,
boolean isLanguageStrict,
String textToAppend)
Append text to value metadata field to item
|
static boolean |
deleteMetadataByValue(Item item,
org.dspace.app.itemupdate.DtoMetadata dtom,
boolean isLanguageStrict)
Working around Item API to delete a value-specific DCValue
For a given element/qualifier/lang:
get all DCValues
clear (i.e.
|
static String |
getCompoundForm(String schema,
String element,
String qualifier) |
static String |
getDCValueString(DCValue dcv)
Get display of DCValue
|
static List<org.dspace.app.itemupdate.DtoMetadata> |
loadDublinCore(DocumentBuilder docBuilder,
InputStream is)
Modification of method from ItemImporter.loadDublinCore
as a Factory method
|
static String[] |
parseCompoundForm(String compoundForm)
Parses metadata field given in the form
|
static List<ContentsEntry> |
readContentsFile(File f)
Rewrite of ItemImport's functionality
but just the parsing of the file, not the processing of its elements.
|
static List<Integer> |
readDeleteContentsFile(File f) |
static void |
writeDocument(Document doc,
Transformer transformer,
OutputStream out)
write xml document to output stream
|
static Document |
writeDublinCore(DocumentBuilder docBuilder,
List<org.dspace.app.itemupdate.DtoMetadata> dtomList)
Write dublin_core.xml
|
public static boolean deleteMetadataByValue(Item item, org.dspace.app.itemupdate.DtoMetadata dtom, boolean isLanguageStrict)
item - dtom - isLanguageStrict - -public static void appendMetadata(Item item, org.dspace.app.itemupdate.DtoMetadata dtom, boolean isLanguageStrict, String textToAppend) throws IllegalArgumentException
item - dtom - isLanguageStrict - textToAppend - IllegalArgumentException - - When target metadata field is not foundpublic static List<org.dspace.app.itemupdate.DtoMetadata> loadDublinCore(DocumentBuilder docBuilder, InputStream is) throws SQLException, IOException, ParserConfigurationException, SAXException, TransformerException, AuthorizeException
docBuilder - -is - - InputStream of dublin_core.xmlSQLExceptionIOExceptionParserConfigurationExceptionSAXExceptionTransformerExceptionAuthorizeExceptionpublic static Document writeDublinCore(DocumentBuilder docBuilder, List<org.dspace.app.itemupdate.DtoMetadata> dtomList) throws ParserConfigurationException, TransformerConfigurationException, TransformerException
docBuilder - dtomList - ParserConfigurationExceptionTransformerConfigurationExceptionTransformerExceptionpublic static void writeDocument(Document doc, Transformer transformer, OutputStream out) throws IOException, TransformerException
doc - transformer - out - IOExceptionTransformerExceptionpublic static List<ContentsEntry> readContentsFile(File f) throws FileNotFoundException, IOException, ParseException
public static List<Integer> readDeleteContentsFile(File f) throws FileNotFoundException, IOException
f - FileNotFoundExceptionIOExceptionpublic static String getDCValueString(DCValue dcv)
dcv - public static String getCompoundForm(String schema, String element, String qualifier)
public static String[] parseCompoundForm(String compoundForm) throws ParseException
ParseException - if validity checks failCopyright © 2014 DuraSpace. All Rights Reserved.