mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 18:14:26 +00:00
Cleaned code and refactoring
This commit is contained in:
@@ -21,6 +21,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
|
|||||||
import javax.xml.parsers.ParserConfigurationException;
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.app.util.XMLUtils;
|
import org.dspace.app.util.XMLUtils;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
@@ -34,11 +35,16 @@ import gr.ekt.bte.dataloader.FileDataLoader;
|
|||||||
import gr.ekt.bte.exceptions.MalformedSourceException;
|
import gr.ekt.bte.exceptions.MalformedSourceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kstamatis
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ArXivFileDataLoader extends FileDataLoader {
|
public class ArXivFileDataLoader extends FileDataLoader {
|
||||||
|
|
||||||
|
private static Logger log = Logger.getLogger(ArXivFileDataLoader.class);
|
||||||
|
|
||||||
Map<String, String> fieldMap; //mapping between service fields and local intermediate fields
|
Map<String, String> fieldMap; //mapping between service fields and local intermediate fields
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -87,13 +93,13 @@ public class ArXivFileDataLoader extends FileDataLoader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
e.printStackTrace();
|
log.error(e.getMessage(), e);
|
||||||
} catch (ParserConfigurationException e) {
|
} catch (ParserConfigurationException e) {
|
||||||
e.printStackTrace();
|
log.error(e.getMessage(), e);
|
||||||
} catch (SAXException e) {
|
} catch (SAXException e) {
|
||||||
e.printStackTrace();
|
log.error(e.getMessage(), e);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return recordSet;
|
return recordSet;
|
||||||
|
@@ -19,10 +19,16 @@ import java.util.Set;
|
|||||||
import org.apache.commons.httpclient.HttpException;
|
import org.apache.commons.httpclient.HttpException;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class ArXivOnlineDataLoader extends NetworkSubmissionLookupDataLoader {
|
public class ArXivOnlineDataLoader extends NetworkSubmissionLookupDataLoader {
|
||||||
private ArXivService arXivService = new ArXivService();
|
private ArXivService arXivService = new ArXivService();
|
||||||
private boolean searchProvider = true;
|
private boolean searchProvider = true;
|
||||||
|
|
||||||
public void setArXivService(ArXivService arXivService) {
|
public void setArXivService(ArXivService arXivService) {
|
||||||
this.arXivService = arXivService;
|
this.arXivService = arXivService;
|
||||||
}
|
}
|
||||||
@@ -32,29 +38,28 @@ public class ArXivOnlineDataLoader extends NetworkSubmissionLookupDataLoader {
|
|||||||
return Arrays.asList(new String[] { ARXIV, DOI });
|
return Arrays.asList(new String[] { ARXIV, DOI });
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSearchProvider(boolean searchProvider)
|
public void setSearchProvider(boolean searchProvider) {
|
||||||
{
|
this.searchProvider = searchProvider;
|
||||||
this.searchProvider = searchProvider;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSearchProvider() {
|
public boolean isSearchProvider() {
|
||||||
return searchProvider;
|
return searchProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Record> getByIdentifier(
|
public List<Record> getByIdentifier(Context context,
|
||||||
Context context, Map<String, Set<String>> keys) throws HttpException, IOException {
|
Map<String, Set<String>> keys) throws HttpException, IOException {
|
||||||
List<Record> results = new ArrayList<Record>();
|
List<Record> results = new ArrayList<Record>();
|
||||||
if (keys != null) {
|
if (keys != null) {
|
||||||
Set<String> dois = keys.get(DOI);
|
Set<String> dois = keys.get(DOI);
|
||||||
Set<String> arxivids = keys.get(ARXIV);
|
Set<String> arxivids = keys.get(ARXIV);
|
||||||
List<Record> items = new ArrayList<Record>();
|
List<Record> items = new ArrayList<Record>();
|
||||||
if (dois!=null && dois.size()>0) {
|
if (dois != null && dois.size() > 0) {
|
||||||
items.addAll(arXivService.getByDOIs(dois));
|
items.addAll(arXivService.getByDOIs(dois));
|
||||||
}
|
}
|
||||||
if (arxivids!=null && arxivids.size()>0) {
|
if (arxivids != null && arxivids.size() > 0) {
|
||||||
for (String arxivid : arxivids){
|
for (String arxivid : arxivids) {
|
||||||
items.add(arXivService.getByArXivIDs(arxivid));
|
items.add(arXivService.getByArXivIDs(arxivid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,13 +72,13 @@ public class ArXivOnlineDataLoader extends NetworkSubmissionLookupDataLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Record> search(Context context, String title,
|
public List<Record> search(Context context, String title, String author,
|
||||||
String author, int year) throws HttpException, IOException {
|
int year) throws HttpException, IOException {
|
||||||
List<Record> results = new ArrayList<Record>();
|
List<Record> results = new ArrayList<Record>();
|
||||||
List<Record> items = arXivService.searchByTerm(title, author, year);
|
List<Record> items = arXivService.searchByTerm(title, author, year);
|
||||||
for (Record item : items) {
|
for (Record item : items) {
|
||||||
results.add(convertFields(item));
|
results.add(convertFields(item));
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -31,6 +31,12 @@ import org.dspace.core.ConfigurationManager;
|
|||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class ArXivService
|
public class ArXivService
|
||||||
{
|
{
|
||||||
private int timeout = 1000;
|
private int timeout = 1000;
|
||||||
@@ -127,7 +133,7 @@ public class ArXivService
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"Identificativo arXiv non valido o inesistente");
|
"ArXiv identifier is not valid or not exist");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
@@ -173,7 +179,7 @@ public class ArXivService
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"Identificativo arXiv non valido o inesistente");
|
"ArXiv identifier is not valid or not exist");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@@ -23,18 +23,15 @@ import org.dspace.submit.util.SubmissionLookupPublication;
|
|||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kstamatis
|
*
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ArxivUtils {
|
public class ArxivUtils {
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public ArxivUtils() {
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Record convertArxixDomToRecord(Element dataRoot){
|
public static Record convertArxixDomToRecord(Element dataRoot){
|
||||||
MutableRecord record = new SubmissionLookupPublication("");
|
MutableRecord record = new SubmissionLookupPublication("");
|
||||||
|
|
||||||
|
@@ -34,8 +34,10 @@ import gr.ekt.bte.dataloader.FileDataLoader;
|
|||||||
import gr.ekt.bte.exceptions.MalformedSourceException;
|
import gr.ekt.bte.exceptions.MalformedSourceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kstamatis
|
* @author Andrea Bollini
|
||||||
*
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
*/
|
*/
|
||||||
public class CrossRefFileDataLoader extends FileDataLoader {
|
public class CrossRefFileDataLoader extends FileDataLoader {
|
||||||
|
|
||||||
|
@@ -23,6 +23,12 @@ import org.dspace.core.Context;
|
|||||||
import org.jdom.JDOMException;
|
import org.jdom.JDOMException;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class CrossRefOnlineDataLoader extends NetworkSubmissionLookupDataLoader {
|
public class CrossRefOnlineDataLoader extends NetworkSubmissionLookupDataLoader {
|
||||||
private CrossRefService crossrefService = new CrossRefService();
|
private CrossRefService crossrefService = new CrossRefService();
|
||||||
|
|
||||||
|
@@ -40,6 +40,12 @@ import org.xml.sax.SAXException;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class CrossRefService {
|
public class CrossRefService {
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger(CrossRefService.class);
|
private static final Logger log = Logger.getLogger(CrossRefService.class);
|
||||||
@@ -81,7 +87,7 @@ public class CrossRefService {
|
|||||||
|
|
||||||
if (statusCode != HttpStatus.SC_OK) {
|
if (statusCode != HttpStatus.SC_OK) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"Chiamata http fallita: "
|
"Http call failed: "
|
||||||
+ method.getStatusLine());
|
+ method.getStatusLine());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,7 +112,7 @@ public class CrossRefService {
|
|||||||
context,
|
context,
|
||||||
"retrieveRecordDOI",
|
"retrieveRecordDOI",
|
||||||
record
|
record
|
||||||
+ " DOI non valido o inesistente: "
|
+ " DOI is not valid or not exist: "
|
||||||
+ e.getMessage()));
|
+ e.getMessage()));
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
@@ -24,8 +24,10 @@ import org.dspace.submit.util.SubmissionLookupPublication;
|
|||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kstamatis
|
* @author Andrea Bollini
|
||||||
*
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
*/
|
*/
|
||||||
public class CrossRefUtils {
|
public class CrossRefUtils {
|
||||||
|
|
||||||
@@ -36,157 +38,152 @@ public class CrossRefUtils {
|
|||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Record convertCrossRefDomToRecord(Element dataRoot){
|
public static Record convertCrossRefDomToRecord(Element dataRoot) {
|
||||||
MutableRecord record = new SubmissionLookupPublication("");
|
MutableRecord record = new SubmissionLookupPublication("");
|
||||||
|
|
||||||
String status = dataRoot.getAttribute("status");
|
String status = dataRoot.getAttribute("status");
|
||||||
if (!"resolved".equals(status)) {
|
if (!"resolved".equals(status)) {
|
||||||
String msg = XMLUtils.getElementValue(dataRoot, "msg");
|
String msg = XMLUtils.getElementValue(dataRoot, "msg");
|
||||||
String exMsg = status + " - " + msg;
|
String exMsg = status + " - " + msg;
|
||||||
throw new RuntimeException(exMsg);
|
throw new RuntimeException(exMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
String doi = XMLUtils.getElementValue(dataRoot, "doi");
|
|
||||||
if (doi!=null)
|
|
||||||
record.addValue("doi", new StringValue(doi));
|
|
||||||
|
|
||||||
String itemType = doi != null ? XMLUtils.getElementAttribute(dataRoot, "doi",
|
|
||||||
"type") : "unspecified";
|
|
||||||
if (itemType!=null)
|
|
||||||
record.addValue("itemType", new StringValue(itemType));
|
|
||||||
|
|
||||||
List<Element> identifier = XMLUtils.getElementList(dataRoot, "issn");
|
|
||||||
for (Element ident : identifier)
|
|
||||||
{
|
|
||||||
if ("print".equalsIgnoreCase(ident.getAttribute("type"))
|
|
||||||
|| StringUtils.isNotBlank(ident.getAttribute("type")))
|
|
||||||
{
|
|
||||||
String issn = ident.getTextContent().trim();
|
|
||||||
if (issn!=null)
|
|
||||||
record.addValue("issn", new StringValue(issn));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
String eissn = ident.getTextContent().trim();
|
|
||||||
if (eissn!=null)
|
|
||||||
record.addValue("eissn", new StringValue(eissn));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String isbn = XMLUtils.getElementValue(dataRoot, "isbn");
|
String doi = XMLUtils.getElementValue(dataRoot, "doi");
|
||||||
if (isbn!=null)
|
if (doi != null)
|
||||||
|
record.addValue("doi", new StringValue(doi));
|
||||||
|
|
||||||
|
String itemType = doi != null ? XMLUtils.getElementAttribute(dataRoot,
|
||||||
|
"doi", "type") : "unspecified";
|
||||||
|
if (itemType != null)
|
||||||
|
record.addValue("itemType", new StringValue(itemType));
|
||||||
|
|
||||||
|
List<Element> identifier = XMLUtils.getElementList(dataRoot, "issn");
|
||||||
|
for (Element ident : identifier) {
|
||||||
|
if ("print".equalsIgnoreCase(ident.getAttribute("type"))
|
||||||
|
|| StringUtils.isNotBlank(ident.getAttribute("type"))) {
|
||||||
|
String issn = ident.getTextContent().trim();
|
||||||
|
if (issn != null)
|
||||||
|
record.addValue("issn", new StringValue(issn));
|
||||||
|
} else {
|
||||||
|
String eissn = ident.getTextContent().trim();
|
||||||
|
if (eissn != null)
|
||||||
|
record.addValue("eissn", new StringValue(eissn));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String isbn = XMLUtils.getElementValue(dataRoot, "isbn");
|
||||||
|
if (isbn != null)
|
||||||
record.addValue("isbn", new StringValue(isbn));
|
record.addValue("isbn", new StringValue(isbn));
|
||||||
|
|
||||||
String editionNumber = XMLUtils.getElementValue(dataRoot, "editionNumber");
|
String editionNumber = XMLUtils.getElementValue(dataRoot,
|
||||||
if (editionNumber!=null)
|
"editionNumber");
|
||||||
|
if (editionNumber != null)
|
||||||
record.addValue("volume", new StringValue(editionNumber));
|
record.addValue("volume", new StringValue(editionNumber));
|
||||||
|
|
||||||
String volume = XMLUtils.getElementValue(dataRoot, "volume");
|
String volume = XMLUtils.getElementValue(dataRoot, "volume");
|
||||||
if (volume!=null)
|
if (volume != null)
|
||||||
record.addValue("volume", new StringValue(volume));
|
record.addValue("volume", new StringValue(volume));
|
||||||
|
|
||||||
String issue = XMLUtils.getElementValue(dataRoot, "issue");
|
String issue = XMLUtils.getElementValue(dataRoot, "issue");
|
||||||
if (issue!=null)
|
if (issue != null)
|
||||||
record.addValue("issue", new StringValue(issue));
|
record.addValue("issue", new StringValue(issue));
|
||||||
|
|
||||||
String year = XMLUtils.getElementValue(dataRoot, "year");
|
String year = XMLUtils.getElementValue(dataRoot, "year");
|
||||||
if (year!=null)
|
if (year != null)
|
||||||
record.addValue("year", new StringValue(year));
|
record.addValue("year", new StringValue(year));
|
||||||
|
|
||||||
String firstPage = XMLUtils.getElementValue(dataRoot, "first_page");
|
String firstPage = XMLUtils.getElementValue(dataRoot, "first_page");
|
||||||
if (firstPage!=null)
|
if (firstPage != null)
|
||||||
record.addValue("firstPage", new StringValue(firstPage));
|
record.addValue("firstPage", new StringValue(firstPage));
|
||||||
|
|
||||||
String lastPage = XMLUtils.getElementValue(dataRoot, "last_page");
|
String lastPage = XMLUtils.getElementValue(dataRoot, "last_page");
|
||||||
if (lastPage!=null)
|
if (lastPage != null)
|
||||||
record.addValue("lastPage", new StringValue(lastPage));
|
record.addValue("lastPage", new StringValue(lastPage));
|
||||||
|
|
||||||
String seriesTitle = XMLUtils.getElementValue(dataRoot, "series_title");
|
String seriesTitle = XMLUtils.getElementValue(dataRoot, "series_title");
|
||||||
if (seriesTitle!=null)
|
if (seriesTitle != null)
|
||||||
record.addValue("seriesTitle", new StringValue(seriesTitle));
|
record.addValue("seriesTitle", new StringValue(seriesTitle));
|
||||||
|
|
||||||
String journalTitle = XMLUtils.getElementValue(dataRoot, "journal_title");
|
String journalTitle = XMLUtils.getElementValue(dataRoot,
|
||||||
if (journalTitle!=null)
|
"journal_title");
|
||||||
|
if (journalTitle != null)
|
||||||
record.addValue("journalTitle", new StringValue(journalTitle));
|
record.addValue("journalTitle", new StringValue(journalTitle));
|
||||||
|
|
||||||
String volumeTitle = XMLUtils.getElementValue(dataRoot, "volume_title");
|
String volumeTitle = XMLUtils.getElementValue(dataRoot, "volume_title");
|
||||||
if (volumeTitle!=null)
|
if (volumeTitle != null)
|
||||||
record.addValue("volumeTitle", new StringValue(volumeTitle));
|
record.addValue("volumeTitle", new StringValue(volumeTitle));
|
||||||
|
|
||||||
String articleTitle = XMLUtils.getElementValue(dataRoot, "article_title");
|
String articleTitle = XMLUtils.getElementValue(dataRoot,
|
||||||
if (articleTitle!=null)
|
"article_title");
|
||||||
|
if (articleTitle != null)
|
||||||
record.addValue("articleTitle", new StringValue(articleTitle));
|
record.addValue("articleTitle", new StringValue(articleTitle));
|
||||||
|
|
||||||
String publicationType = XMLUtils.getElementValue(dataRoot, "pubblication_type");
|
String publicationType = XMLUtils.getElementValue(dataRoot,
|
||||||
if (publicationType!=null)
|
"pubblication_type");
|
||||||
|
if (publicationType != null)
|
||||||
record.addValue("publicationType", new StringValue(publicationType));
|
record.addValue("publicationType", new StringValue(publicationType));
|
||||||
|
|
||||||
List<String[]> authors = new LinkedList<String[]>();
|
List<String[]> authors = new LinkedList<String[]>();
|
||||||
List<String[]> editors = new LinkedList<String[]>();
|
List<String[]> editors = new LinkedList<String[]>();
|
||||||
List<String[]> translators = new LinkedList<String[]>();
|
List<String[]> translators = new LinkedList<String[]>();
|
||||||
List<String[]> chairs = new LinkedList<String[]>();
|
List<String[]> chairs = new LinkedList<String[]>();
|
||||||
|
|
||||||
List<Element> contributors = XMLUtils.getElementList(dataRoot, "contributors");
|
List<Element> contributors = XMLUtils.getElementList(dataRoot,
|
||||||
List<Element> contributor = null;
|
"contributors");
|
||||||
if (contributors != null && contributors.size() > 0)
|
List<Element> contributor = null;
|
||||||
{
|
if (contributors != null && contributors.size() > 0) {
|
||||||
contributor = XMLUtils.getElementList(contributors.get(0), "contributor");
|
contributor = XMLUtils.getElementList(contributors.get(0),
|
||||||
|
"contributor");
|
||||||
for (Element contrib : contributor) {
|
|
||||||
|
for (Element contrib : contributor) {
|
||||||
String givenName = XMLUtils.getElementValue(contrib, "given_name");
|
|
||||||
String surname = XMLUtils.getElementValue(contrib, "surname");
|
String givenName = XMLUtils.getElementValue(contrib,
|
||||||
|
"given_name");
|
||||||
if ("editor".equalsIgnoreCase(contrib
|
String surname = XMLUtils.getElementValue(contrib, "surname");
|
||||||
.getAttribute("contributor_role")))
|
|
||||||
{
|
if ("editor".equalsIgnoreCase(contrib
|
||||||
editors.add(new String[] { givenName, surname });
|
.getAttribute("contributor_role"))) {
|
||||||
}
|
editors.add(new String[] { givenName, surname });
|
||||||
else if ("chair".equalsIgnoreCase(contrib
|
} else if ("chair".equalsIgnoreCase(contrib
|
||||||
.getAttribute("contributor_role")))
|
.getAttribute("contributor_role"))) {
|
||||||
{
|
chairs.add(new String[] { givenName, surname });
|
||||||
chairs.add(new String[] { givenName, surname });
|
} else if ("translator".equalsIgnoreCase(contrib
|
||||||
}
|
.getAttribute("contributor_role"))) {
|
||||||
else if ("translator".equalsIgnoreCase(contrib
|
translators.add(new String[] { givenName, surname });
|
||||||
.getAttribute("contributor_role")))
|
} else {
|
||||||
{
|
authors.add(new String[] { givenName, surname });
|
||||||
translators.add(new String[] { givenName, surname });
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
|
||||||
authors.add(new String[] { givenName, surname });
|
if (authors.size() > 0) {
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (authors.size()>0){
|
|
||||||
List<Value> values = new LinkedList<Value>();
|
List<Value> values = new LinkedList<Value>();
|
||||||
for (String[] sArray : authors){
|
for (String[] sArray : authors) {
|
||||||
values.add(new StringValue(sArray[1]+", "+sArray[0]));
|
values.add(new StringValue(sArray[1] + ", " + sArray[0]));
|
||||||
}
|
}
|
||||||
record.addField("authors", values);
|
record.addField("authors", values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editors.size()>0){
|
if (editors.size() > 0) {
|
||||||
List<Value> values = new LinkedList<Value>();
|
List<Value> values = new LinkedList<Value>();
|
||||||
for (String[] sArray : editors){
|
for (String[] sArray : editors) {
|
||||||
values.add(new StringValue(sArray[1]+", "+sArray[0]));
|
values.add(new StringValue(sArray[1] + ", " + sArray[0]));
|
||||||
}
|
}
|
||||||
record.addField("editors", values);
|
record.addField("editors", values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (translators.size()>0){
|
if (translators.size() > 0) {
|
||||||
List<Value> values = new LinkedList<Value>();
|
List<Value> values = new LinkedList<Value>();
|
||||||
for (String[] sArray : translators){
|
for (String[] sArray : translators) {
|
||||||
values.add(new StringValue(sArray[1]+", "+sArray[0]));
|
values.add(new StringValue(sArray[1] + ", " + sArray[0]));
|
||||||
}
|
}
|
||||||
record.addField("translators", values);
|
record.addField("translators", values);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chairs.size()>0){
|
if (chairs.size() > 0) {
|
||||||
List<Value> values = new LinkedList<Value>();
|
List<Value> values = new LinkedList<Value>();
|
||||||
for (String[] sArray : chairs){
|
for (String[] sArray : chairs) {
|
||||||
values.add(new StringValue(sArray[1]+", "+sArray[0]));
|
values.add(new StringValue(sArray[1] + ", " + sArray[0]));
|
||||||
}
|
}
|
||||||
record.addField("chairs", values);
|
record.addField("chairs", values);
|
||||||
}
|
}
|
||||||
|
@@ -40,7 +40,10 @@ import org.dspace.submit.util.ItemSubmissionLookupDTO;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
* @author Kostas Stamatis
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
*/
|
*/
|
||||||
public class DSpaceWorkspaceItemOutputGenerator implements OutputGenerator {
|
public class DSpaceWorkspaceItemOutputGenerator implements OutputGenerator {
|
||||||
|
|
||||||
@@ -55,10 +58,6 @@ public class DSpaceWorkspaceItemOutputGenerator implements OutputGenerator {
|
|||||||
|
|
||||||
private List<String> extraMetadataToKeep;
|
private List<String> extraMetadataToKeep;
|
||||||
|
|
||||||
public DSpaceWorkspaceItemOutputGenerator() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> generateOutput(RecordSet recordSet) {
|
public List<String> generateOutput(RecordSet recordSet) {
|
||||||
|
|
||||||
@@ -82,14 +81,11 @@ public class DSpaceWorkspaceItemOutputGenerator implements OutputGenerator {
|
|||||||
witems.add(wi);
|
witems.add(wi);
|
||||||
|
|
||||||
} catch (AuthorizeException e) {
|
} catch (AuthorizeException e) {
|
||||||
// TODO Auto-generated catch block
|
log.error(e.getMessage(), e);
|
||||||
e.printStackTrace();
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
// TODO Auto-generated catch block
|
log.error(e.getMessage(), e);
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
log.error(e.getMessage(), e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -183,55 +179,11 @@ public class DSpaceWorkspaceItemOutputGenerator implements OutputGenerator {
|
|||||||
try {
|
try {
|
||||||
item.update();
|
item.update();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
// TODO Auto-generated catch block
|
log.error(e.getMessage(), e);
|
||||||
e.printStackTrace();
|
|
||||||
} catch (AuthorizeException e) {
|
} catch (AuthorizeException e) {
|
||||||
// TODO Auto-generated catch block
|
log.error(e.getMessage(), e);
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// creo un nuovo context per il check di esistenza dei metadata di cache
|
|
||||||
/*Context context = null;
|
|
||||||
try {
|
|
||||||
context = new Context();
|
|
||||||
for (Record pub : dto.getPublications()) {
|
|
||||||
String providerName = SubmissionLookupService.getProviderName(pub);
|
|
||||||
if (providerName != SubmissionLookupService.MANUAL_USER_INPUT) {
|
|
||||||
for (String field : pub.getFields()) {
|
|
||||||
String metadata = getMetadata(formName, pub, field);
|
|
||||||
if (StringUtils.isBlank(metadata)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] md = splitMetadata(metadata);
|
|
||||||
if (isValidMetadata(formName, md)) {
|
|
||||||
makeSureMetadataExist(context, providerName, md[1],
|
|
||||||
md[2]);
|
|
||||||
if (isRepeatableMetadata(formName, md)) {
|
|
||||||
for (Value value : pub.getValues(field)) {
|
|
||||||
String[] splitValue = splitValue(value.getAsString());
|
|
||||||
item.addMetadata(providerName, md[1],
|
|
||||||
md[2], md[3], splitValue[0],
|
|
||||||
splitValue[1],
|
|
||||||
Integer.parseInt(splitValue[2]));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
String[] splitValue = splitValue(SubmissionLookupUtils.getFirstValue(pub, field));
|
|
||||||
item.addMetadata(providerName, md[1], md[2],
|
|
||||||
md[3], splitValue[0], splitValue[1],
|
|
||||||
Integer.parseInt(splitValue[2]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RuntimeException(e.getMessage(), e);
|
|
||||||
} finally {
|
|
||||||
if (context != null && context.isValid()) {
|
|
||||||
context.abort();
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getMetadata(String formName,
|
private String getMetadata(String formName,
|
||||||
@@ -296,7 +248,7 @@ public class DSpaceWorkspaceItemOutputGenerator implements OutputGenerator {
|
|||||||
}
|
}
|
||||||
return getDCInput(formName, md[0], md[1], md[2])!=null;
|
return getDCInput(formName, md[0], md[1], md[2])!=null;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -16,17 +16,23 @@ import gr.ekt.bte.core.Value;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class FieldMergeModifier extends AbstractModifier {
|
public class FieldMergeModifier extends AbstractModifier {
|
||||||
private Map<String, List<String>> merge_field_map;
|
private Map<String, List<String>> mergeFieldMap;
|
||||||
public FieldMergeModifier() {
|
public FieldMergeModifier() {
|
||||||
super("FieldMergeModifier");
|
super("FieldMergeModifier");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Record modify(MutableRecord rec) {
|
public Record modify(MutableRecord rec) {
|
||||||
if (merge_field_map!=null){
|
if (mergeFieldMap!=null){
|
||||||
for (String target_field : merge_field_map.keySet()) {
|
for (String target_field : mergeFieldMap.keySet()) {
|
||||||
List<String> source_fields = merge_field_map.get(target_field);
|
List<String> source_fields = mergeFieldMap.get(target_field);
|
||||||
for (String source_field : source_fields) {
|
for (String source_field : source_fields) {
|
||||||
List<Value> values = rec.getValues(source_field);
|
List<Value> values = rec.getValues(source_field);
|
||||||
if (values != null && values.size() > 0) {
|
if (values != null && values.size() > 0) {
|
||||||
@@ -45,14 +51,14 @@ public class FieldMergeModifier extends AbstractModifier {
|
|||||||
* @return the merge_field_map
|
* @return the merge_field_map
|
||||||
*/
|
*/
|
||||||
public Map<String, List<String>> getMergeFieldMap() {
|
public Map<String, List<String>> getMergeFieldMap() {
|
||||||
return merge_field_map;
|
return mergeFieldMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param merge_field_map the merge_field_map to set
|
* @param merge_field_map the merge_field_map to set
|
||||||
*/
|
*/
|
||||||
public void setMergeFieldMap(Map<String, List<String>> merge_field_map) {
|
public void setMergeFieldMap(Map<String, List<String>> merge_field_map) {
|
||||||
this.merge_field_map = merge_field_map;
|
this.mergeFieldMap = merge_field_map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -10,6 +10,12 @@ package org.dspace.submit.lookup;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class LookupProvidersCheck {
|
public class LookupProvidersCheck {
|
||||||
private List<String> providersOk = new ArrayList<String>();
|
private List<String> providersOk = new ArrayList<String>();
|
||||||
private List<String> providersErr = new ArrayList<String>();
|
private List<String> providersErr = new ArrayList<String>();
|
||||||
|
@@ -21,8 +21,10 @@ import gr.ekt.bte.core.StringValue;
|
|||||||
import gr.ekt.bte.core.Value;
|
import gr.ekt.bte.core.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @author Andrea Bollini
|
||||||
*
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
*/
|
*/
|
||||||
public class MapConverterModifier extends AbstractModifier {
|
public class MapConverterModifier extends AbstractModifier {
|
||||||
|
|
||||||
|
@@ -26,8 +26,10 @@ import gr.ekt.bte.dataloader.FileDataLoader;
|
|||||||
import gr.ekt.bte.exceptions.MalformedSourceException;
|
import gr.ekt.bte.exceptions.MalformedSourceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
* @author Kostas Stamatis
|
* @author Kostas Stamatis
|
||||||
*
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
*/
|
*/
|
||||||
public class MultipleSubmissionLookupDataLoader implements DataLoader {
|
public class MultipleSubmissionLookupDataLoader implements DataLoader {
|
||||||
|
|
||||||
|
@@ -31,6 +31,12 @@ import org.dspace.core.Context;
|
|||||||
import org.dspace.submit.util.SubmissionLookupPublication;
|
import org.dspace.submit.util.SubmissionLookupPublication;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public abstract class NetworkSubmissionLookupDataLoader implements SubmissionLookupDataLoader {
|
public abstract class NetworkSubmissionLookupDataLoader implements SubmissionLookupDataLoader {
|
||||||
|
|
||||||
Map<String, Set<String>> identifiers; //Searching by identifiers (DOI ...)
|
Map<String, Set<String>> identifiers; //Searching by identifiers (DOI ...)
|
||||||
|
@@ -34,8 +34,10 @@ import org.w3c.dom.Element;
|
|||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kstamatis
|
* @author Andrea Bollini
|
||||||
*
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
*/
|
*/
|
||||||
public class PubmedFileDataLoader extends FileDataLoader {
|
public class PubmedFileDataLoader extends FileDataLoader {
|
||||||
|
|
||||||
|
@@ -21,6 +21,12 @@ import org.apache.log4j.Logger;
|
|||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
import org.dspace.core.LogManager;
|
import org.dspace.core.LogManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class PubmedOnlineDataLoader extends NetworkSubmissionLookupDataLoader {
|
public class PubmedOnlineDataLoader extends NetworkSubmissionLookupDataLoader {
|
||||||
private boolean searchProvider = true;
|
private boolean searchProvider = true;
|
||||||
private static Logger log = Logger.getLogger(PubmedOnlineDataLoader.class);
|
private static Logger log = Logger.getLogger(PubmedOnlineDataLoader.class);
|
||||||
|
@@ -26,13 +26,23 @@ import org.apache.commons.httpclient.HttpStatus;
|
|||||||
import org.apache.commons.httpclient.NameValuePair;
|
import org.apache.commons.httpclient.NameValuePair;
|
||||||
import org.apache.commons.httpclient.methods.GetMethod;
|
import org.apache.commons.httpclient.methods.GetMethod;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.app.util.XMLUtils;
|
import org.dspace.app.util.XMLUtils;
|
||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class PubmedService {
|
public class PubmedService {
|
||||||
|
|
||||||
|
private static Logger log = Logger.getLogger(PubmedService.class);
|
||||||
|
|
||||||
private int timeout = 1000;
|
private int timeout = 1000;
|
||||||
|
|
||||||
public void setTimeout(int timeout) {
|
public void setTimeout(int timeout) {
|
||||||
@@ -98,7 +108,7 @@ public class PubmedService {
|
|||||||
|
|
||||||
if (statusCode != HttpStatus.SC_OK) {
|
if (statusCode != HttpStatus.SC_OK) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"Chiamata al webservice fallita: "
|
"WS call failed: "
|
||||||
+ method.getStatusLine());
|
+ method.getStatusLine());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +135,7 @@ public class PubmedService {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
catch (SAXException e1) {
|
catch (SAXException e1) {
|
||||||
e1.printStackTrace();
|
log.error(e1.getMessage(), e1);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (method != null) {
|
if (method != null) {
|
||||||
@@ -190,7 +200,7 @@ public class PubmedService {
|
|||||||
|
|
||||||
if (statusCode != HttpStatus.SC_OK) {
|
if (statusCode != HttpStatus.SC_OK) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"Chiamata al webservice fallita: "
|
"WS call failed: "
|
||||||
+ method.getStatusLine());
|
+ method.getStatusLine());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,7 +224,7 @@ public class PubmedService {
|
|||||||
results.add(pubmedItem);
|
results.add(pubmedItem);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"PubmedID non valido o inesistente: "+e.getMessage(), e);
|
"PubmedID is not valid or not exist: "+e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -252,7 +262,7 @@ public class PubmedService {
|
|||||||
results.add(pubmedItem);
|
results.add(pubmedItem);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"PubmedID non valido o inesistente: "+e.getMessage(), e);
|
"PubmedID is not valid or not exist: "+e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -26,18 +26,13 @@ import org.dspace.submit.util.SubmissionLookupPublication;
|
|||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kstamatis
|
* @author Andrea Bollini
|
||||||
*
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
*/
|
*/
|
||||||
public class PubmedUtils {
|
public class PubmedUtils {
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public PubmedUtils() {
|
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Record convertCrossRefDomToRecord(Element pubArticle){
|
public static Record convertCrossRefDomToRecord(Element pubArticle){
|
||||||
MutableRecord record = new SubmissionLookupPublication("");
|
MutableRecord record = new SubmissionLookupPublication("");
|
||||||
|
|
||||||
|
@@ -20,11 +20,10 @@ import gr.ekt.bte.core.StringValue;
|
|||||||
import gr.ekt.bte.core.Value;
|
import gr.ekt.bte.core.Value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The contents of this file are subject to the license and copyright
|
* @author Andrea Bollini
|
||||||
* detailed in the LICENSE and NOTICE files at the root of the source
|
* @author Kostas Stamatis
|
||||||
* tree and available online at
|
* @author Luigi Andrea Pascarelli
|
||||||
*
|
* @author Panagiotis Koutsourakis
|
||||||
* http://www.dspace.org/license/
|
|
||||||
*/
|
*/
|
||||||
public class RemoveLastDotModifier extends AbstractModifier {
|
public class RemoveLastDotModifier extends AbstractModifier {
|
||||||
|
|
||||||
@@ -35,7 +34,6 @@ public class RemoveLastDotModifier extends AbstractModifier {
|
|||||||
*/
|
*/
|
||||||
public RemoveLastDotModifier(String name) {
|
public RemoveLastDotModifier(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
// TODO Auto-generated constructor stub
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@@ -21,6 +21,9 @@ import org.dspace.submit.util.ItemSubmissionLookupDTO;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
* @author Panagiotis Koutsourakis
|
* @author Panagiotis Koutsourakis
|
||||||
*/
|
*/
|
||||||
public class SubmissionItemDataLoader implements DataLoader {
|
public class SubmissionItemDataLoader implements DataLoader {
|
||||||
|
@@ -19,6 +19,12 @@ import gr.ekt.bte.core.DataLoader;
|
|||||||
import gr.ekt.bte.core.Record;
|
import gr.ekt.bte.core.Record;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public interface SubmissionLookupDataLoader extends DataLoader {
|
public interface SubmissionLookupDataLoader extends DataLoader {
|
||||||
|
|
||||||
public final static String DOI = "doi";
|
public final static String DOI = "doi";
|
||||||
|
@@ -22,6 +22,9 @@ import org.dspace.submit.util.ItemSubmissionLookupDTO;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
* @author Panagiotis Koutsourakis
|
* @author Panagiotis Koutsourakis
|
||||||
*/
|
*/
|
||||||
public class SubmissionLookupOutputGenerator implements OutputGenerator {
|
public class SubmissionLookupOutputGenerator implements OutputGenerator {
|
||||||
@@ -65,9 +68,6 @@ public class SubmissionLookupOutputGenerator implements OutputGenerator {
|
|||||||
dtoList.add(dto);
|
dtoList.add(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Print debug messages
|
|
||||||
|
|
||||||
|
|
||||||
return new ArrayList<String>();
|
return new ArrayList<String>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -22,6 +22,12 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.dspace.submit.util.SubmissionLookupDTO;
|
import org.dspace.submit.util.SubmissionLookupDTO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class SubmissionLookupService {
|
public class SubmissionLookupService {
|
||||||
|
|
||||||
public static final String SL_NAMESPACE_PREFIX = "http://www.dspace.org/sl/";
|
public static final String SL_NAMESPACE_PREFIX = "http://www.dspace.org/sl/";
|
||||||
|
@@ -22,6 +22,12 @@ import org.dspace.content.MetadataSchema;
|
|||||||
import org.dspace.core.ConfigurationManager;
|
import org.dspace.core.ConfigurationManager;
|
||||||
import org.dspace.core.Context;
|
import org.dspace.core.Context;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class SubmissionLookupUtils {
|
public class SubmissionLookupUtils {
|
||||||
private static Logger log = Logger.getLogger(SubmissionLookupUtils.class);
|
private static Logger log = Logger.getLogger(SubmissionLookupUtils.class);
|
||||||
|
|
||||||
|
@@ -20,6 +20,12 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class ValueConcatenationModifier extends AbstractModifier {
|
public class ValueConcatenationModifier extends AbstractModifier {
|
||||||
private String field;
|
private String field;
|
||||||
private String separator = ",";
|
private String separator = ",";
|
||||||
|
@@ -22,6 +22,12 @@ import java.util.UUID;
|
|||||||
import org.dspace.submit.lookup.SubmissionLookupDataLoader;
|
import org.dspace.submit.lookup.SubmissionLookupDataLoader;
|
||||||
import org.dspace.submit.lookup.SubmissionLookupService;
|
import org.dspace.submit.lookup.SubmissionLookupService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class ItemSubmissionLookupDTO implements Serializable {
|
public class ItemSubmissionLookupDTO implements Serializable {
|
||||||
private static final long serialVersionUID = 1;
|
private static final long serialVersionUID = 1;
|
||||||
|
|
||||||
|
@@ -11,6 +11,12 @@ import java.io.Serializable;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class SubmissionLookupDTO implements Serializable {
|
public class SubmissionLookupDTO implements Serializable {
|
||||||
private static final long serialVersionUID = 1;
|
private static final long serialVersionUID = 1;
|
||||||
|
|
||||||
|
@@ -21,6 +21,12 @@ import java.util.Set;
|
|||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.dspace.submit.lookup.SubmissionLookupDataLoader;
|
import org.dspace.submit.lookup.SubmissionLookupDataLoader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class SubmissionLookupPublication implements MutableRecord, Serializable {
|
public class SubmissionLookupPublication implements MutableRecord, Serializable {
|
||||||
private String providerName;
|
private String providerName;
|
||||||
|
|
||||||
@@ -30,7 +36,7 @@ public class SubmissionLookupPublication implements MutableRecord, Serializable
|
|||||||
this.providerName = providerName;
|
this.providerName = providerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// necessario per poter effettuare la serializzazione in JSON dei dati
|
// needed to serialize it with JSON
|
||||||
public Map<String, List<String>> getStorage() {
|
public Map<String, List<String>> getStorage() {
|
||||||
return storage;
|
return storage;
|
||||||
}
|
}
|
||||||
|
@@ -56,6 +56,12 @@ import com.google.gson.Gson;
|
|||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andrea Bollini
|
||||||
|
* @author Kostas Stamatis
|
||||||
|
* @author Luigi Andrea Pascarelli
|
||||||
|
* @author Panagiotis Koutsourakis
|
||||||
|
*/
|
||||||
public class SubmissionLookupJSONRequest extends JSONRequest {
|
public class SubmissionLookupJSONRequest extends JSONRequest {
|
||||||
|
|
||||||
private SubmissionLookupService service = new DSpace().getServiceManager()
|
private SubmissionLookupService service = new DSpace().getServiceManager()
|
||||||
@@ -109,9 +115,9 @@ public class SubmissionLookupJSONRequest extends JSONRequest {
|
|||||||
.getOutputGenerator();
|
.getOutputGenerator();
|
||||||
result = outputGenerator.getDtoList();
|
result = outputGenerator.getDtoList();
|
||||||
} catch (BadTransformationSpec e1) {
|
} catch (BadTransformationSpec e1) {
|
||||||
e1.printStackTrace();
|
log.error(e1.getMessage(), e1);
|
||||||
} catch (MalformedSourceException e1) {
|
} catch (MalformedSourceException e1) {
|
||||||
e1.printStackTrace();
|
log.error(e1.getMessage(), e1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,9 +161,9 @@ public class SubmissionLookupJSONRequest extends JSONRequest {
|
|||||||
.getOutputGenerator();
|
.getOutputGenerator();
|
||||||
result = outputGenerator.getDtoList();
|
result = outputGenerator.getDtoList();
|
||||||
} catch (BadTransformationSpec e1) {
|
} catch (BadTransformationSpec e1) {
|
||||||
e1.printStackTrace();
|
log.error(e1.getMessage(), e1);
|
||||||
} catch (MalformedSourceException e1) {
|
} catch (MalformedSourceException e1) {
|
||||||
e1.printStackTrace();
|
log.error(e1.getMessage(), e1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,9 +238,9 @@ public class SubmissionLookupJSONRequest extends JSONRequest {
|
|||||||
.getOutputGenerator();
|
.getOutputGenerator();
|
||||||
result = outputGenerator.getDtoList();
|
result = outputGenerator.getDtoList();
|
||||||
} catch (BadTransformationSpec e1) {
|
} catch (BadTransformationSpec e1) {
|
||||||
e1.printStackTrace();
|
log.error(e1.getMessage(), e1);
|
||||||
} catch (MalformedSourceException e1) {
|
} catch (MalformedSourceException e1) {
|
||||||
e1.printStackTrace();
|
log.error(e1.getMessage(), e1);
|
||||||
}
|
}
|
||||||
|
|
||||||
file.delete();
|
file.delete();
|
||||||
|
Reference in New Issue
Block a user