mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +00:00
Update to JDOM2. Also replaced deprecated XPath with new XPathFactory
This commit is contained in:
@@ -520,7 +520,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jdom</groupId>
|
||||
<artifactId>jdom</artifactId>
|
||||
<artifactId>jdom2</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.pdfbox</groupId>
|
||||
|
@@ -52,9 +52,9 @@ import org.dspace.content.service.CommunityService;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.eperson.factory.EPersonServiceFactory;
|
||||
import org.dspace.eperson.service.EPersonService;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.output.Format;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.output.Format;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
@@ -307,7 +307,7 @@ public class StructBuilder {
|
||||
}
|
||||
|
||||
// finally write the string into the output file.
|
||||
final org.jdom.Document xmlOutput = new org.jdom.Document(root);
|
||||
final org.jdom2.Document xmlOutput = new org.jdom2.Document(root);
|
||||
try {
|
||||
new XMLOutputter().output(xmlOutput, output);
|
||||
} catch (IOException e) {
|
||||
@@ -411,7 +411,7 @@ public class StructBuilder {
|
||||
}
|
||||
|
||||
// Now write the structure out.
|
||||
org.jdom.Document xmlOutput = new org.jdom.Document(rootElement);
|
||||
org.jdom2.Document xmlOutput = new org.jdom2.Document(rootElement);
|
||||
try {
|
||||
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
|
||||
outputter.output(xmlOutput, output);
|
||||
|
@@ -16,7 +16,7 @@ import java.io.StreamTokenizer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.jdom.Document;
|
||||
import org.jdom2.Document;
|
||||
|
||||
/**
|
||||
* @author mwood
|
||||
|
@@ -29,9 +29,9 @@ import org.dspace.scripts.service.ScriptService;
|
||||
import org.dspace.servicemanager.DSpaceKernelImpl;
|
||||
import org.dspace.servicemanager.DSpaceKernelInit;
|
||||
import org.dspace.services.RequestService;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
|
||||
/**
|
||||
* A DSpace script launcher.
|
||||
|
@@ -42,7 +42,7 @@ import org.dspace.core.Context;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
* Configuration and mapping for Google Scholar output metadata
|
||||
|
@@ -29,11 +29,11 @@ import org.dspace.discovery.IndexableObject;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.output.DOMOutputter;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.JDOMException;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.output.DOMOutputter;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
@@ -192,7 +192,7 @@ public class OpenSearchServiceImpl implements OpenSearchService {
|
||||
* @param scope - null for the entire repository, or a collection/community handle
|
||||
* @return Service Document
|
||||
*/
|
||||
protected org.jdom.Document getServiceDocument(String scope) {
|
||||
protected org.jdom2.Document getServiceDocument(String scope) {
|
||||
ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService();
|
||||
|
||||
Namespace ns = Namespace.getNamespace(osNs);
|
||||
@@ -245,7 +245,7 @@ public class OpenSearchServiceImpl implements OpenSearchService {
|
||||
url.setAttribute("template", template.toString());
|
||||
root.addContent(url);
|
||||
}
|
||||
return new org.jdom.Document(root);
|
||||
return new org.jdom2.Document(root);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -255,7 +255,7 @@ public class OpenSearchServiceImpl implements OpenSearchService {
|
||||
* @return W3C Document object
|
||||
* @throws IOException if IO error
|
||||
*/
|
||||
protected Document jDomToW3(org.jdom.Document jdomDoc) throws IOException {
|
||||
protected Document jDomToW3(org.jdom2.Document jdomDoc) throws IOException {
|
||||
DOMOutputter domOut = new DOMOutputter();
|
||||
try {
|
||||
return domOut.output(jdomDoc);
|
||||
|
@@ -14,8 +14,8 @@ import java.util.List;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Context;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
/**
|
||||
* Crosswalk descriptive metadata to and from DIM (DSpace Intermediate
|
||||
|
@@ -40,8 +40,8 @@ import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
/**
|
||||
* Crosswalk of technical metadata for DSpace AIP. This is
|
||||
|
@@ -23,8 +23,8 @@ import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.ItemService;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
/**
|
||||
* DIM dissemination crosswalk
|
||||
|
@@ -19,8 +19,8 @@ import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.ItemService;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
/**
|
||||
* DIM ingestion crosswalk
|
||||
|
@@ -14,8 +14,8 @@ import java.util.List;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Context;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
/**
|
||||
* Dissemination Crosswalk plugin -- translate DSpace native
|
||||
|
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Context;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
* Ingestion Crosswalk plugin -- translate an external metadata format
|
||||
|
@@ -24,11 +24,11 @@ import org.dspace.core.Context;
|
||||
import org.dspace.core.factory.CoreServiceFactory;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.JDOMException;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
|
||||
/**
|
||||
* METS dissemination crosswalk
|
||||
|
@@ -35,8 +35,8 @@ import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.factory.EPersonServiceFactory;
|
||||
import org.dspace.eperson.service.EPersonService;
|
||||
import org.dspace.eperson.service.GroupService;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
/**
|
||||
* METSRights Ingestion and Dissemination Crosswalk
|
||||
|
@@ -15,7 +15,6 @@ import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
@@ -42,16 +41,18 @@ import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.Text;
|
||||
import org.jdom.Verifier;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom.xpath.XPath;
|
||||
import org.jdom2.Attribute;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.JDOMException;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.Text;
|
||||
import org.jdom2.Verifier;
|
||||
import org.jdom2.filter.Filters;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
import org.jdom2.xpath.XPathExpression;
|
||||
import org.jdom2.xpath.XPathFactory;
|
||||
|
||||
/**
|
||||
* Configurable MODS Crosswalk
|
||||
@@ -156,7 +157,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
|
||||
static class modsTriple {
|
||||
public String qdc = null;
|
||||
public Element xml = null;
|
||||
public XPath xpath = null;
|
||||
public XPathExpression xpath = null;
|
||||
|
||||
/**
|
||||
* Initialize from text versions of QDC, XML and XPath.
|
||||
@@ -171,9 +172,9 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
|
||||
final String postlog = "</mods>";
|
||||
try {
|
||||
result.qdc = qdc;
|
||||
result.xpath = XPath.newInstance(xpath);
|
||||
result.xpath.addNamespace(MODS_NS.getPrefix(), MODS_NS.getURI());
|
||||
result.xpath.addNamespace(XLINK_NS);
|
||||
result.xpath =
|
||||
XPathFactory.instance()
|
||||
.compile(xpath, Filters.fpassthrough(), null, MODS_NS, XLINK_NS);
|
||||
Document d = builder.build(new StringReader(prolog + xml + postlog));
|
||||
result.xml = (Element) d.getRootElement().getContent(0);
|
||||
} catch (JDOMException | IOException je) {
|
||||
@@ -295,6 +296,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
|
||||
* @throws IOException if IO error
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @return List of Elements
|
||||
*/
|
||||
@Override
|
||||
public List<Element> disseminateList(Context context, DSpaceObject dso)
|
||||
@@ -352,37 +354,29 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
|
||||
if (trip == null) {
|
||||
log.warn("WARNING: " + getPluginInstanceName() + ": No MODS mapping for \"" + qdc + "\"");
|
||||
} else {
|
||||
try {
|
||||
Element me = (Element) trip.xml.clone();
|
||||
if (addSchema) {
|
||||
me.setAttribute("schemaLocation", schemaLocation, XSI_NS);
|
||||
}
|
||||
Iterator ni = trip.xpath.selectNodes(me).iterator();
|
||||
if (!ni.hasNext()) {
|
||||
log.warn("XPath \"" + trip.xpath.getXPath() +
|
||||
"\" found no elements in \"" +
|
||||
outputUgly.outputString(me) +
|
||||
"\", qdc=" + qdc);
|
||||
}
|
||||
while (ni.hasNext()) {
|
||||
Object what = ni.next();
|
||||
if (what instanceof Element) {
|
||||
((Element) what).setText(checkedString(value));
|
||||
} else if (what instanceof Attribute) {
|
||||
((Attribute) what).setValue(checkedString(value));
|
||||
} else if (what instanceof Text) {
|
||||
((Text) what).setText(checkedString(value));
|
||||
} else {
|
||||
log.warn("Got unknown object from XPath, class=" + what.getClass().getName());
|
||||
}
|
||||
}
|
||||
result.add(me);
|
||||
} catch (JDOMException je) {
|
||||
log.error("Error following XPath in modsTriple: context=" +
|
||||
outputUgly.outputString(trip.xml) +
|
||||
", xpath=" + trip.xpath.getXPath() + ", exception=" +
|
||||
je.toString());
|
||||
Element me = (Element) trip.xml.clone();
|
||||
if (addSchema) {
|
||||
me.setAttribute("schemaLocation", schemaLocation, XSI_NS);
|
||||
}
|
||||
List<Object> matches = trip.xpath.evaluate(me);
|
||||
if (matches.isEmpty()) {
|
||||
log.warn("XPath \"" + trip.xpath.getExpression() +
|
||||
"\" found no elements in \"" +
|
||||
outputUgly.outputString(me) +
|
||||
"\", qdc=" + qdc);
|
||||
}
|
||||
for (Object match: matches) {
|
||||
if (match instanceof Element) {
|
||||
((Element) match).setText(checkedString(value));
|
||||
} else if (match instanceof Attribute) {
|
||||
((Attribute) match).setValue(checkedString(value));
|
||||
} else if (match instanceof Text) {
|
||||
((Text) match).setText(checkedString(value));
|
||||
} else {
|
||||
log.warn("Got unknown object from XPath, class=" + match.getClass().getName());
|
||||
}
|
||||
}
|
||||
result.add(me);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
@@ -15,9 +15,9 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Context;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.output.Format;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.output.Format;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
|
||||
/**
|
||||
* "Null" ingestion crosswalk
|
||||
|
@@ -20,8 +20,8 @@ import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.ItemService;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
/**
|
||||
* DIM ingestion crosswalk
|
||||
|
@@ -31,8 +31,8 @@ import org.dspace.core.Context;
|
||||
import org.dspace.core.Utils;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
/**
|
||||
* ORE dissemination crosswalk
|
||||
|
@@ -34,12 +34,13 @@ import org.dspace.content.service.BundleService;
|
||||
import org.dspace.content.service.ItemService;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.xpath.XPath;
|
||||
import org.jdom2.Attribute;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.filter.Filters;
|
||||
import org.jdom2.xpath.XPathExpression;
|
||||
import org.jdom2.xpath.XPathFactory;
|
||||
|
||||
/**
|
||||
* ORE ingestion crosswalk
|
||||
@@ -113,23 +114,21 @@ public class OREIngestionCrosswalk
|
||||
Document doc = new Document();
|
||||
doc.addContent(root.detach());
|
||||
|
||||
XPath xpathLinks;
|
||||
List<Element> aggregatedResources;
|
||||
String entryId;
|
||||
try {
|
||||
xpathLinks = XPath.newInstance("/atom:entry/atom:link[@rel=\"" + ORE_NS.getURI() + "aggregates" + "\"]");
|
||||
xpathLinks.addNamespace(ATOM_NS);
|
||||
aggregatedResources = xpathLinks.selectNodes(doc);
|
||||
XPathExpression<Element> xpathLinks =
|
||||
XPathFactory.instance()
|
||||
.compile("/atom:entry/atom:link[@rel=\"" + ORE_NS.getURI() + "aggregates" + "\"]",
|
||||
Filters.element(), null, ATOM_NS);
|
||||
aggregatedResources = xpathLinks.evaluate(doc);
|
||||
|
||||
xpathLinks = XPath.newInstance("/atom:entry/atom:link[@rel='alternate']/@href");
|
||||
xpathLinks.addNamespace(ATOM_NS);
|
||||
entryId = ((Attribute) xpathLinks.selectSingleNode(doc)).getValue();
|
||||
} catch (JDOMException e) {
|
||||
throw new CrosswalkException("JDOM exception occurred while ingesting the ORE", e);
|
||||
}
|
||||
XPathExpression<Attribute> xpathAltHref =
|
||||
XPathFactory.instance()
|
||||
.compile("/atom:entry/atom:link[@rel='alternate']/@href",
|
||||
Filters.attribute(), null, ATOM_NS);
|
||||
entryId = xpathAltHref.evaluateFirst(doc).getValue();
|
||||
|
||||
// Next for each resource, create a bitstream
|
||||
XPath xpathDesc;
|
||||
NumberFormat nf = NumberFormat.getInstance();
|
||||
nf.setGroupingUsed(false);
|
||||
nf.setMinimumIntegerDigits(4);
|
||||
@@ -140,16 +139,12 @@ public class OREIngestionCrosswalk
|
||||
|
||||
String bundleName;
|
||||
Element desc = null;
|
||||
try {
|
||||
xpathDesc = XPath.newInstance(
|
||||
"/atom:entry/oreatom:triples/rdf:Description[@rdf:about=\"" + this.encodeForURL(href) + "\"][1]");
|
||||
xpathDesc.addNamespace(ATOM_NS);
|
||||
xpathDesc.addNamespace(ORE_ATOM);
|
||||
xpathDesc.addNamespace(RDF_NS);
|
||||
desc = (Element) xpathDesc.selectSingleNode(doc);
|
||||
} catch (JDOMException e) {
|
||||
log.warn("Could not find description for {}", href, e);
|
||||
}
|
||||
XPathExpression<Element> xpathDesc =
|
||||
XPathFactory.instance()
|
||||
.compile("/atom:entry/oreatom:triples/rdf:Description[@rdf:about=\"" +
|
||||
this.encodeForURL(href) + "\"][1]",
|
||||
Filters.element(), null, ATOM_NS, ORE_ATOM, RDF_NS);
|
||||
desc = xpathDesc.evaluateFirst(doc);
|
||||
|
||||
if (desc != null && desc.getChild("type", RDF_NS).getAttributeValue("resource", RDF_NS)
|
||||
.equals(DS_NS.getURI() + "DSpaceBitstream")) {
|
||||
|
@@ -30,8 +30,8 @@ import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
/**
|
||||
* PREMIS Crosswalk
|
||||
|
@@ -14,7 +14,7 @@ import java.util.Map;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.DSpaceObject;
|
||||
import org.dspace.core.Context;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
* Translate DSpace native metadata into an external XML format, with parameters.
|
||||
|
@@ -36,10 +36,10 @@ import org.dspace.core.Context;
|
||||
import org.dspace.core.SelfNamedPlugin;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
|
||||
/**
|
||||
* Configurable QDC Crosswalk
|
||||
@@ -290,7 +290,7 @@ public class QDCCrosswalk extends SelfNamedPlugin
|
||||
qdc2element.put(qdc, element);
|
||||
element2qdc.put(makeQualifiedTagName(element), qdc);
|
||||
log.debug("Building Maps: qdc=\"" + qdc + "\", element=\"" + element.toString() + "\"");
|
||||
} catch (org.jdom.JDOMException je) {
|
||||
} catch (org.jdom2.JDOMException je) {
|
||||
throw new CrosswalkInternalException(
|
||||
"Failed parsing XML fragment in properties file: \"" + prolog + val + postlog + "\": " + je
|
||||
.toString(), je);
|
||||
@@ -326,6 +326,7 @@ public class QDCCrosswalk extends SelfNamedPlugin
|
||||
* @throws IOException if IO error
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @return List of Elements
|
||||
*/
|
||||
@Override
|
||||
public List<Element> disseminateList(Context context, DSpaceObject dso)
|
||||
|
@@ -26,12 +26,12 @@ import org.dspace.core.factory.CoreServiceFactory;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.JDOMException;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
|
||||
/**
|
||||
* Role Crosswalk
|
||||
|
@@ -24,8 +24,8 @@ import org.dspace.content.service.ItemService;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.SelfNamedPlugin;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
/**
|
||||
* Disseminator for Simple Dublin Core metadata in XML format.
|
||||
@@ -84,6 +84,7 @@ public class SimpleDCDisseminationCrosswalk extends SelfNamedPlugin
|
||||
* @throws IOException if IO error
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @return List of Elements
|
||||
*/
|
||||
@Override
|
||||
public List<Element> disseminateList(Context context, DSpaceObject dso)
|
||||
|
@@ -34,9 +34,9 @@ import org.dspace.core.Context;
|
||||
import org.dspace.core.SelfNamedPlugin;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.Verifier;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.Verifier;
|
||||
|
||||
/**
|
||||
* Crosswalk for creating appropriate <meta> elements to appear in the
|
||||
@@ -178,6 +178,7 @@ public class XHTMLHeadDisseminationCrosswalk
|
||||
* @throws IOException if IO error
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @return List of Elements
|
||||
*/
|
||||
@Override
|
||||
public List<Element> disseminateList(Context context, DSpaceObject dso) throws CrosswalkException,
|
||||
|
@@ -21,7 +21,7 @@ import javax.xml.transform.stream.StreamSource;
|
||||
import org.dspace.core.SelfNamedPlugin;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Namespace;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@@ -18,6 +18,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
|
||||
@@ -41,14 +42,15 @@ import org.dspace.core.factory.CoreServiceFactory;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.Verifier;
|
||||
import org.jdom.output.Format;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom.transform.JDOMResult;
|
||||
import org.jdom.transform.JDOMSource;
|
||||
import org.jdom2.Content;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.Verifier;
|
||||
import org.jdom2.output.Format;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
import org.jdom2.transform.JDOMResult;
|
||||
import org.jdom2.transform.JDOMSource;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -244,6 +246,7 @@ public class XSLTDisseminationCrosswalk
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @see DisseminationCrosswalk
|
||||
* @return List of Elements
|
||||
*/
|
||||
@Override
|
||||
public List<Element> disseminateList(Context context, DSpaceObject dso)
|
||||
@@ -268,7 +271,12 @@ public class XSLTDisseminationCrosswalk
|
||||
try {
|
||||
JDOMResult result = new JDOMResult();
|
||||
xform.transform(new JDOMSource(createDIM(dso).getChildren()), result);
|
||||
return result.getResult();
|
||||
List<Content> contentList = result.getResult();
|
||||
// Transform List<Content> into List<Element>
|
||||
List<Element> elementList = contentList.stream()
|
||||
.filter(obj -> obj instanceof Element)
|
||||
.map(Element.class::cast).collect(Collectors.toList());
|
||||
return elementList;
|
||||
} catch (TransformerException e) {
|
||||
LOG.error("Got error: " + e.toString());
|
||||
throw new CrosswalkInternalException("XSL translation failed: " + e.toString(), e);
|
||||
|
@@ -12,6 +12,7 @@ import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerException;
|
||||
|
||||
@@ -34,13 +35,14 @@ import org.dspace.content.service.ItemService;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.factory.CoreServiceFactory;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom.output.Format;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom.transform.JDOMResult;
|
||||
import org.jdom.transform.JDOMSource;
|
||||
import org.jdom2.Content;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
import org.jdom2.output.Format;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
import org.jdom2.transform.JDOMResult;
|
||||
import org.jdom2.transform.JDOMSource;
|
||||
|
||||
/**
|
||||
* Configurable XSLT-driven ingestion Crosswalk
|
||||
@@ -141,7 +143,12 @@ public class XSLTIngestionCrosswalk
|
||||
try {
|
||||
JDOMResult result = new JDOMResult();
|
||||
xform.transform(new JDOMSource(metadata), result);
|
||||
ingestDIM(context, dso, result.getResult(), createMissingMetadataFields);
|
||||
List<Content> contentList = result.getResult();
|
||||
// Transform List<Content> into List<Element>
|
||||
List<Element> elementList = contentList.stream()
|
||||
.filter(obj -> obj instanceof Element)
|
||||
.map(Element.class::cast).collect(Collectors.toList());
|
||||
ingestDIM(context, dso, elementList, createMissingMetadataFields);
|
||||
} catch (TransformerException e) {
|
||||
log.error("Got error: " + e.toString());
|
||||
throw new CrosswalkInternalException("XSL Transformation failed: " + e.toString(), e);
|
||||
|
@@ -83,10 +83,10 @@ import org.dspace.license.factory.LicenseServiceFactory;
|
||||
import org.dspace.license.service.CreativeCommonsService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.output.Format;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.output.Format;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
|
||||
/**
|
||||
* Base class for disseminator of
|
||||
|
@@ -51,7 +51,7 @@ import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.workflow.WorkflowException;
|
||||
import org.dspace.workflow.factory.WorkflowServiceFactory;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
* Base class for package ingester of METS (Metadata Encoding and Transmission
|
||||
|
@@ -20,7 +20,7 @@ import org.dspace.content.crosswalk.CrosswalkException;
|
||||
import org.dspace.content.crosswalk.MetadataValidationException;
|
||||
import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
* Subclass of the METS packager framework to ingest a DSpace
|
||||
|
@@ -23,7 +23,7 @@ import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.core.factory.CoreServiceFactory;
|
||||
import org.dspace.core.service.PluginService;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
* Packager plugin to ingest a
|
||||
|
@@ -35,15 +35,17 @@ import org.dspace.core.Context;
|
||||
import org.dspace.core.factory.CoreServiceFactory;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Content;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom.output.Format;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom.xpath.XPath;
|
||||
import org.jdom2.Content;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.JDOMException;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.filter.Filters;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
import org.jdom2.output.Format;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
import org.jdom2.xpath.XPathExpression;
|
||||
import org.jdom2.xpath.XPathFactory;
|
||||
|
||||
/**
|
||||
* <P>
|
||||
@@ -382,15 +384,12 @@ public class METSManifest {
|
||||
public List getMdFiles()
|
||||
throws MetadataValidationException {
|
||||
if (mdFiles == null) {
|
||||
try {
|
||||
// Use a special namespace with known prefix
|
||||
// so we get the right prefix.
|
||||
XPath xpath = XPath.newInstance("descendant::mets:mdRef");
|
||||
xpath.addNamespace(metsNS);
|
||||
mdFiles = xpath.selectNodes(mets);
|
||||
} catch (JDOMException je) {
|
||||
throw new MetadataValidationException("Failed while searching for mdRef elements in manifest: ", je);
|
||||
}
|
||||
// Use a special namespace with known prefix
|
||||
// so we get the right prefix.
|
||||
XPathExpression<Element> xpath =
|
||||
XPathFactory.instance()
|
||||
.compile("descendant::mets:mdRef", Filters.element(), null, metsNS);
|
||||
mdFiles = xpath.evaluate(mets);
|
||||
}
|
||||
return mdFiles;
|
||||
}
|
||||
@@ -414,25 +413,22 @@ public class METSManifest {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
XPath xpath = XPath.newInstance(
|
||||
"mets:fileSec/mets:fileGrp[@USE=\"CONTENT\"]/mets:file[@GROUPID=\"" + groupID + "\"]");
|
||||
xpath.addNamespace(metsNS);
|
||||
List oFiles = xpath.selectNodes(mets);
|
||||
if (oFiles.size() > 0) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Got ORIGINAL file for derived=" + file.toString());
|
||||
}
|
||||
Element flocat = ((Element) oFiles.get(0)).getChild("FLocat", metsNS);
|
||||
if (flocat != null) {
|
||||
return flocat.getAttributeValue("href", xlinkNS);
|
||||
}
|
||||
XPathExpression<Element> xpath =
|
||||
XPathFactory.instance()
|
||||
.compile(
|
||||
"mets:fileSec/mets:fileGrp[@USE=\"CONTENT\"]/mets:file[@GROUPID=\"" + groupID + "\"]",
|
||||
Filters.element(), null, metsNS);
|
||||
List<Element> oFiles = xpath.evaluate(mets);
|
||||
if (oFiles.size() > 0) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Got ORIGINAL file for derived=" + file.toString());
|
||||
}
|
||||
Element flocat = oFiles.get(0).getChild("FLocat", metsNS);
|
||||
if (flocat != null) {
|
||||
return flocat.getAttributeValue("href", xlinkNS);
|
||||
}
|
||||
return null;
|
||||
} catch (JDOMException je) {
|
||||
log.warn("Got exception on XPATH looking for Original file, " + je.toString());
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// translate bundle name from METS to DSpace; METS may be "CONTENT"
|
||||
@@ -888,20 +884,16 @@ public class METSManifest {
|
||||
// use only when path varies each time you call it.
|
||||
protected Element getElementByXPath(String path, boolean nullOk)
|
||||
throws MetadataValidationException {
|
||||
try {
|
||||
XPath xpath = XPath.newInstance(path);
|
||||
xpath.addNamespace(metsNS);
|
||||
xpath.addNamespace(xlinkNS);
|
||||
Object result = xpath.selectSingleNode(mets);
|
||||
if (result == null && nullOk) {
|
||||
return null;
|
||||
} else if (result instanceof Element) {
|
||||
return (Element) result;
|
||||
} else {
|
||||
throw new MetadataValidationException("METSManifest: Failed to resolve XPath, path=\"" + path + "\"");
|
||||
}
|
||||
} catch (JDOMException je) {
|
||||
throw new MetadataValidationException("METSManifest: Failed to resolve XPath, path=\"" + path + "\"", je);
|
||||
XPathExpression<Element> xpath =
|
||||
XPathFactory.instance()
|
||||
.compile(path, Filters.element(), null, metsNS, xlinkNS);
|
||||
Element result = xpath.evaluateFirst(mets);
|
||||
if (result == null && nullOk) {
|
||||
return null;
|
||||
} else if (result == null && !nullOk) {
|
||||
throw new MetadataValidationException("METSManifest: Failed to resolve XPath, path=\"" + path + "\"");
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -35,7 +35,7 @@ import org.dspace.eperson.PasswordHash;
|
||||
import org.dspace.eperson.factory.EPersonServiceFactory;
|
||||
import org.dspace.eperson.service.EPersonService;
|
||||
import org.dspace.eperson.service.GroupService;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
/**
|
||||
* Plugin to export all Group and EPerson objects in XML, perhaps for reloading.
|
||||
|
@@ -29,10 +29,10 @@ import org.dspace.harvest.dao.HarvestedCollectionDAO;
|
||||
import org.dspace.harvest.service.HarvestedCollectionService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.input.DOMBuilder;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.input.DOMBuilder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.w3c.dom.DOMException;
|
||||
import org.xml.sax.SAXException;
|
||||
|
@@ -70,11 +70,11 @@ import org.dspace.harvest.service.HarvestedCollectionService;
|
||||
import org.dspace.harvest.service.HarvestedItemService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.input.DOMBuilder;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.input.DOMBuilder;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
|
||||
|
@@ -23,8 +23,8 @@ import org.dspace.core.factory.CoreServiceFactory;
|
||||
import org.dspace.handle.factory.HandleServiceFactory;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.utils.DSpace;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@@ -45,13 +45,13 @@ import org.dspace.core.factory.CoreServiceFactory;
|
||||
import org.dspace.handle.service.HandleService;
|
||||
import org.dspace.identifier.DOI;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom.filter.ElementFilter;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom.output.Format;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.JDOMException;
|
||||
import org.jdom2.filter.ElementFilter;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
import org.jdom2.output.Format;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@@ -10,7 +10,7 @@ package org.dspace.license;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jdom.Document;
|
||||
import org.jdom2.Document;
|
||||
|
||||
/**
|
||||
* Service interface class for the Creative commons license connector service.
|
||||
|
@@ -34,11 +34,11 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.jaxen.JaxenException;
|
||||
import org.jaxen.jdom.JDOMXPath;
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom2.Attribute;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.JDOMException;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.xml.sax.InputSource;
|
||||
@@ -141,7 +141,7 @@ public class CCLicenseConnectorServiceImpl implements CCLicenseConnectorService,
|
||||
|
||||
try (StringReader stringReader = new StringReader(responseString)) {
|
||||
InputSource is = new InputSource(stringReader);
|
||||
org.jdom.Document classDoc = this.parser.build(is);
|
||||
org.jdom2.Document classDoc = this.parser.build(is);
|
||||
|
||||
List<Element> elements = licenseClassXpath.selectNodes(classDoc);
|
||||
for (Element element : elements) {
|
||||
@@ -179,7 +179,7 @@ public class CCLicenseConnectorServiceImpl implements CCLicenseConnectorService,
|
||||
try (StringReader stringReader = new StringReader(responseString)) {
|
||||
InputSource is = new InputSource(stringReader);
|
||||
|
||||
org.jdom.Document classDoc = this.parser.build(is);
|
||||
org.jdom2.Document classDoc = this.parser.build(is);
|
||||
|
||||
Object element = licenseClassXpath.selectSingleNode(classDoc);
|
||||
String licenseLabel = getSingleNodeValue(element, "label");
|
||||
@@ -298,7 +298,7 @@ public class CCLicenseConnectorServiceImpl implements CCLicenseConnectorService,
|
||||
|
||||
try (StringReader stringReader = new StringReader(responseString)) {
|
||||
InputSource is = new InputSource(stringReader);
|
||||
org.jdom.Document classDoc = this.parser.build(is);
|
||||
org.jdom2.Document classDoc = this.parser.build(is);
|
||||
|
||||
Object node = licenseClassXpath.selectSingleNode(classDoc);
|
||||
String nodeValue = getNodeValue(node);
|
||||
|
@@ -40,8 +40,8 @@ import org.dspace.core.Utils;
|
||||
import org.dspace.license.service.CreativeCommonsService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.transform.JDOMSource;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.transform.JDOMSource;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
|
@@ -18,7 +18,7 @@ import org.dspace.content.Bitstream;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.license.CCLicense;
|
||||
import org.jdom.Document;
|
||||
import org.jdom2.Document;
|
||||
|
||||
/**
|
||||
* Service interface class for the Creative commons licensing.
|
||||
|
@@ -24,10 +24,10 @@ import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.output.Format;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.output.Format;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.helpers.DefaultHandler;
|
||||
|
@@ -32,7 +32,7 @@ import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.dspace.statistics.MockSolrLoggerServiceImpl;
|
||||
import org.dspace.statistics.MockSolrStatisticsCore;
|
||||
import org.dspace.storage.rdbms.DatabaseUtils;
|
||||
import org.jdom.Document;
|
||||
import org.jdom2.Document;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
|
@@ -38,7 +38,7 @@ import org.dspace.content.service.ItemService;
|
||||
import org.dspace.content.service.WorkspaceItemService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
@@ -14,7 +14,7 @@ import org.dspace.AbstractDSpaceTest;
|
||||
import org.dspace.core.service.PluginService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Namespace;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
|
@@ -15,8 +15,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.JDOMException;
|
||||
|
||||
/**
|
||||
* Mock implementation for the Creative commons license connector service.
|
||||
|
@@ -15,8 +15,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.JDOMException;
|
||||
|
||||
/**
|
||||
* Mock implementation for the Creative commons license connector service.
|
||||
|
Reference in New Issue
Block a user