diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 4fd555c583..2ea9722bad 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -12,7 +12,7 @@ org.dspace dspace-parent - 4.0-rc2-SNAPSHOT + 4.0-rc3-SNAPSHOT .. diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java index 2b1920aeef..fef548e0be 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java @@ -385,6 +385,11 @@ public class DSpaceCSV implements Serializable */ public final void addItem(Item i) throws Exception { + // If the item is not in the archive, the call to get its handle below will fail + if (i.isWithdrawn() || !i.isArchived() || i.getOwningCollection() == null) { + return; + } + // Create the CSV line DSpaceCSVLine line = new DSpaceCSVLine(i.getID()); diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java index 71d7234b5b..d4c88d6038 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java +++ b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java @@ -1340,11 +1340,33 @@ public class ItemImport + sRegistrationLine); continue; } - registerBitstream(c, i, iAssetstore, sFilePath, sBundle); + + // look for descriptions + boolean descriptionExists = false; + String descriptionMarker = "\tdescription:"; + int dMarkerIndex = line.indexOf(descriptionMarker); + int dEndIndex = 0; + if (dMarkerIndex > 0) + { + dEndIndex = line.indexOf("\t", dMarkerIndex + 1); + if (dEndIndex == -1) + { + dEndIndex = line.length(); + } + descriptionExists = true; + } + String sDescription = ""; + if (descriptionExists) + { + sDescription = line.substring(dMarkerIndex, dEndIndex); + sDescription = sDescription.replaceFirst("description:", ""); + } + + registerBitstream(c, i, iAssetstore, sFilePath, sBundle, sDescription); System.out.println("\tRegistering Bitstream: " + sFilePath + "\tAssetstore: " + iAssetstore + "\tBundle: " + sBundle - + "\tDescription: " + sBundle); + + "\tDescription: " + sDescription); continue; // process next line in contents file } @@ -1571,7 +1593,7 @@ public class ItemImport * @throws AuthorizeException */ private void registerBitstream(Context c, Item i, int assetstore, - String bitstreamPath, String bundleName ) + String bitstreamPath, String bundleName, String description ) throws SQLException, IOException, AuthorizeException { // TODO validate assetstore number @@ -1622,6 +1644,7 @@ public class ItemImport // FIXME - guessing format guesses license.txt incorrectly as a text file format! BitstreamFormat bf = FormatIdentifier.guessFormat(c, bs); bs.setFormat(bf); + bs.setDescription(description); bs.update(); } diff --git a/dspace-api/src/main/java/org/dspace/app/statistics/LogAnalyser.java b/dspace-api/src/main/java/org/dspace/app/statistics/LogAnalyser.java index e8a3bd0df2..ce057c5a29 100644 --- a/dspace-api/src/main/java/org/dspace/app/statistics/LogAnalyser.java +++ b/dspace-api/src/main/java/org/dspace/app/statistics/LogAnalyser.java @@ -18,17 +18,9 @@ import java.sql.SQLException; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; -import java.util.StringTokenizer; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -1031,7 +1023,8 @@ public class LogAnalyser public static String unParseDate(Date date) { // Use SimpleDateFormat - SimpleDateFormat sdf = new SimpleDateFormat("yyyy'-'MM'-'dd"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy'-'MM'-'dd'T'hh:mm:ss'Z'"); + sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(date); } @@ -1205,28 +1198,33 @@ public class LogAnalyser if (oracle) { dateQuery.append(" AND TO_TIMESTAMP( TO_CHAR(text_value), "+ - "'yyyy-mm-dd\"T\"hh24:mi:ss\"Z\"' ) > TO_DATE('" + - unParseDate(startDate) + "', 'yyyy-MM-dd') "); + "'yyyy-mm-dd\"T\"hh24:mi:ss\"Z\"' ) >= TO_DATE('" + + unParseDate(startDate) + "', 'yyyy-MM-dd\"T\"hh24:mi:ss\"Z\"') "); } else { - dateQuery.append(" AND text_value::timestamp > '" + + dateQuery.append(" AND text_value::timestamp >= '" + unParseDate(startDate) + "'::timestamp "); } } if (endDate != null) { + // adjust end date to account for timestamp comparison + GregorianCalendar realEndDate = new GregorianCalendar(); + realEndDate.setTime(endDate); + realEndDate.add(Calendar.DAY_OF_MONTH, 1); + Date queryEndDate = realEndDate.getTime(); if (oracle) { dateQuery.append(" AND TO_TIMESTAMP( TO_CHAR(text_value), "+ "'yyyy-mm-dd\"T\"hh24:mi:ss\"Z\"' ) < TO_DATE('" + - unParseDate(endDate) + "', 'yyyy-MM-dd') "); + unParseDate(queryEndDate) + "', 'yyyy-MM-dd\"T\"hh24:mi:ss\"Z\"') "); } else { dateQuery.append(" AND text_value::timestamp < '" + - unParseDate(endDate) + "'::timestamp "); + unParseDate(queryEndDate) + "'::timestamp "); } } diff --git a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java index 75e0ca7c4e..492dad166a 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java @@ -252,13 +252,18 @@ public class LDAPAuthentication // If there is no email and the email domain is set, add it to the netid String email = ldap.ldapEmail; - if (((email == null) || ("".equals(email))) && - (!"".equals(ConfigurationManager.getProperty("authentication-ldap", "netid_email_domain")))) + + if ((StringUtils.isEmpty(email)) && + (StringUtils.isNotEmpty(ConfigurationManager.getProperty("authentication-ldap", "netid_email_domain")))) { email = netid + ConfigurationManager.getProperty("authentication-ldap", "netid_email_domain"); } + else + { + email = netid; + } - if ((email != null) && (!"".equals(email))) + if (StringUtils.isNotEmpty(email)) { try { @@ -288,19 +293,19 @@ public class LDAPAuthentication { context.setIgnoreAuthorization(true); eperson = EPerson.create(context); - if ((email != null) && (!"".equals(email))) + if (StringUtils.isNotEmpty(email)) { eperson.setEmail(email); } - if ((ldap.ldapGivenName!=null) && (!ldap.ldapGivenName.equals(""))) + if (StringUtils.isNotEmpty(ldap.ldapGivenName)) { eperson.setFirstName(ldap.ldapGivenName); } - if ((ldap.ldapSurname!=null) && (!ldap.ldapSurname.equals(""))) + if (StringUtils.isNotEmpty(ldap.ldapSurname)) { eperson.setLastName(ldap.ldapSurname); } - if ((ldap.ldapPhone!=null)&&(!ldap.ldapPhone.equals(""))) + if (StringUtils.isNotEmpty(ldap.ldapPhone)) { eperson.setMetadata("phone", ldap.ldapPhone); } diff --git a/dspace-api/src/main/java/org/dspace/content/Collection.java b/dspace-api/src/main/java/org/dspace/content/Collection.java index 4b026fa91c..06ed1386dd 100644 --- a/dspace-api/src/main/java/org/dspace/content/Collection.java +++ b/dspace-api/src/main/java/org/dspace/content/Collection.java @@ -90,6 +90,13 @@ public class Collection extends DSpaceObject /** The default group of administrators */ private Group admins; + // Keys for accessing Collection metadata + public static final String COPYRIGHT_TEXT = "copyright_text"; + public static final String INTRODUCTORY_TEXT = "introductory_text"; + public static final String SHORT_DESCRIPTION = "short_description"; + public static final String SIDEBAR_TEXT = "side_bar_text"; + public static final String PROVENANCE_TEXT = "provenance_description"; + /** * Construct a collection with the given table row * diff --git a/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java b/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java index f692ec7bb3..b0669c89dd 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java +++ b/dspace-api/src/main/java/org/dspace/identifier/DOIIdentifierProvider.java @@ -276,22 +276,7 @@ public class DOIIdentifierProvider + "is marked as DELETED.", DOIIdentifierException.DOI_IS_DELETED); } - // check if DOI is reserved at the registration agency - if (connector.isDOIReserved(context, doi)) - { - // if doi is registered for this object we still should check its - // status in our database (see below). - // if it is registered for another object we should notify an admin - if (!connector.isDOIReserved(context, dso, doi)) - { - log.warn("DOI {} is reserved for another object already.", doi); - throw new DOIIdentifierException(DOIIdentifierException.DOI_ALREADY_EXISTS); - } - } - else - { - connector.reserveDOI(context, dso, doi); - } + connector.reserveDOI(context, dso, doi); doiRow.setColumn("status", IS_RESERVED); DatabaseManager.update(context, doiRow); @@ -311,52 +296,21 @@ public class DOIIdentifierProvider + "is marked as DELETED.", DOIIdentifierException.DOI_IS_DELETED); } - // check if the DOI is already registered online - if (connector.isDOIRegistered(context, doi)) - { - // if doi is registered for this object we still should check its - // status in our database (see below). - // if it is registered for another object we should notify an admin - if (!connector.isDOIRegistered(context, dso, doi)) - { - // DOI is reserved for another object - log.warn("DOI {} is registered for another object already.", doi); - throw new DOIIdentifierException(DOIIdentifierException.DOI_ALREADY_EXISTS); - } + // register DOI Online + try { + connector.registerDOI(context, dso, doi); } - else + catch (DOIIdentifierException die) { - // check if doi is reserved for this specific dso - if (!connector.isDOIReserved(context, dso, doi)) + // do we have to reserve DOI before we can register it? + if (die.getCode() == DOIIdentifierException.RESERVE_FIRST) { - // check if doi is already reserved for another dso - if (connector.isDOIReserved(context, doi)) - { - log.warn("Trying to register DOI {}, that is reserved for " - + "another dso.", doi); - throw new DOIIdentifierException("Trying to register a DOI " - + "that is reserved for another object.", - DOIIdentifierException.DOI_ALREADY_EXISTS); - } - - connector.reserveDOI(context, dso, doi); - } - // register DOI Online - try { + this.reserveOnline(context, dso, identifier); connector.registerDOI(context, dso, doi); } - catch (DOIIdentifierException die) + else { - // do we have to reserve DOI before we can register it? - if (die.getCode() == DOIIdentifierException.REGISTER_FIRST) - { - this.reserveOnline(context, dso, identifier); - connector.registerDOI(context, dso, doi); - } - else - { - throw die; - } + throw die; } } @@ -375,7 +329,6 @@ public class DOIIdentifierProvider doiRow.setColumn("status", IS_REGISTERED); DatabaseManager.update(context, doiRow); - } public void updateMetadata(Context context, DSpaceObject dso, String identifier) @@ -451,23 +404,9 @@ public class DOIIdentifierProvider if (DELETED == doiRow.getIntColumn("status") || TO_BE_DELETED == doiRow.getIntColumn("status")) { - throw new DOIIdentifierException("You tried to register a DOI that " - + "is marked as DELETED.", DOIIdentifierException.DOI_IS_DELETED); - } - - - // check if doi is reserved for this specific dso - if (connector.isDOIReserved(context, identifier)) - { - // check if doi is reserved for this specific dso - if (!connector.isDOIReserved(context, dso, doi)) - { - log.warn("Trying to update metadata for DOI {}, that is reserved" - + " for another dso.", doi); - throw new DOIIdentifierException("Trying to update metadta for " - + "a DOI that is reserved for another object.", - DOIIdentifierException.DOI_ALREADY_EXISTS); - } + throw new DOIIdentifierException("You tried to update the metadata" + + "of a DOI that is marked as DELETED.", + DOIIdentifierException.DOI_IS_DELETED); } connector.updateMetadata(context, dso, doi); diff --git a/dspace-api/src/main/java/org/dspace/identifier/doi/DOIConnector.java b/dspace-api/src/main/java/org/dspace/identifier/doi/DOIConnector.java index 51b864091b..666d69d825 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/doi/DOIConnector.java +++ b/dspace-api/src/main/java/org/dspace/identifier/doi/DOIConnector.java @@ -14,7 +14,12 @@ import org.dspace.core.Context; /** * A DOIConnector handles all calls to the API of your DOI registry. * - * Please pay attention to the method {@link #purgeCachedInformation()}! + * A DOIConnector should care about rules of the registration agency. For + * example, if the registration agency wants us to reserve a DOI before we can + * register it, the DOIConnector should check if a DOI is reserved. Use a + * {@link DOIIdenfierException} and set its error code in case of any errors. + * For the given example you should use + * {@code DOIIdentifierException.RESERVER_FIRST} as error code. * * @author Pascal-Nicolas Becker */ @@ -38,14 +43,6 @@ public interface DOIConnector { * identifiers they should never be deleted. For example, if you send a HTTP * DELETE request to the DataCite Metadata API directly, it will set the DOI * to inactive.

- * - *

A DOIConnector does not have to check whether the DOI is reserved, - * registered or not. It will only send the request and return the answer in - * form of a boolean weather the deletion was successful or not. It may even - * throw an DOIIdentifierException in case you are not allowed to delete a - * DOI, the DOI does not exist, ... So please be sure that the deletion of a - * DOI is conform with the rules of the registry and that the DOI is in the - * appropriate state (f.e. reserved but not registered).

* * @param context * @param doi @@ -57,12 +54,11 @@ public interface DOIConnector { /** * Sends a request to the DOI registry to reserve a DOI. - * - * Please check on your own if the DOI is already reserved or even - * registered before you try to reserve it. You can use - * {@link isDOIRegistered} and {@link isDOIReserved} for it. The - * DOIConnector won't do any tests and throws an DOIIdentifierException in - * case of any problems with the DOI you want to reserve. + * + * The DOIConnector should check weather this DOI is reserved for another + * object already. In this case it should throw an {@link + * DOIIdentifierException} and set the error code to {@code + * DOIIdentifierException.DOI_ALREADY_EXISTS}. * * @param context * @param dso @@ -75,12 +71,11 @@ public interface DOIConnector { /** * Sends a request to the DOI registry to register a DOI. * - * Please check on your own if the DOI is already reserved or even - * registered before you try to register it. You can use the methods - * {@code DOIConnector.isDOIRegistered(...)} and - * {@code DOIConnector.isDOIReserved(...)} for it. The DOIConnector won't - * do any tests and throws an DOIIdentifierException in case of any problems - * with the DOI you want to register. + * The DOIConnector ensures compliance with the workflow of the registration + * agency. For example, if a DOI has to be reserved before it can be + * registered the DOIConnector has to check if it is reserved. In this case + * you can throw an DOIIdentifierExcpetion and set the error code to + * {@link DOIIdentifierException.RESERVE_FIRST}. * * @param context * @param dso @@ -92,9 +87,10 @@ public interface DOIConnector { throws DOIIdentifierException; /** - * Sends a request to the DOI registry to update Metadata for a DOI. - * The DOIConnector won't do any tests and throws an IdentifierException - * in case of any problems with the DOI you want to update the metadata. + * Sends a request to the DOI registry to update metadata for a DOI. + * + * The DOIConnector should check weather the DOI is reserved or registered + * for the specified DSpace Object before it sends the metadata update. * * @param context * @param dso diff --git a/dspace-api/src/main/java/org/dspace/identifier/doi/DOIIdentifierException.java b/dspace-api/src/main/java/org/dspace/identifier/doi/DOIIdentifierException.java index 34afe036e8..a5d3be6560 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/doi/DOIIdentifierException.java +++ b/dspace-api/src/main/java/org/dspace/identifier/doi/DOIIdentifierException.java @@ -49,7 +49,7 @@ public class DOIIdentifierException extends IdentifierException { * be registered. This error code signals that a unreserved DOI should be * registered and that the registration agency denied it. */ - public static final int REGISTER_FIRST = 6; + public static final int RESERVE_FIRST = 6; /** * Error while authenticating against the registration agency. */ @@ -97,7 +97,7 @@ public class DOIIdentifierException extends IdentifierException { return "FOREIGN_DOI"; case BAD_ANSWER: return "BAD_ANSWER"; - case REGISTER_FIRST: + case RESERVE_FIRST: return "REGISTER_FIRST"; case AUTHENTICATION_ERROR: return "AUTHENTICATION_ERROR"; diff --git a/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java b/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java index 63717274ec..736ede53ad 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java +++ b/dspace-api/src/main/java/org/dspace/identifier/doi/DataCiteConnector.java @@ -65,12 +65,12 @@ implements DOIConnector * Stores the scheme used to connect to the DataCite server. It will be set * by spring dependency injection. */ - private String SCHEME; + protected String SCHEME; /** * Stores the hostname of the DataCite server. Set by spring dependency * injection. */ - private String HOST; + protected String HOST; /** * Path on the DataCite server used to generate DOIs. Set by spring @@ -188,7 +188,7 @@ implements DOIConnector this.CROSSWALK_NAME = CROSSWALK_NAME; } - private void prepareXwalk() + protected void prepareXwalk() { if (null != this.xwalk) return; @@ -203,7 +203,7 @@ implements DOIConnector } } - private String getUsername() + protected String getUsername() { if (null == this.USERNAME) { @@ -218,7 +218,7 @@ implements DOIConnector return this.USERNAME; } - private String getPassword() + protected String getPassword() { if (null == this.PASSWORD) { @@ -450,7 +450,22 @@ implements DOIConnector @Override public void reserveDOI(Context context, DSpaceObject dso, String doi) throws DOIIdentifierException - { + { + // check if DOI is reserved at the registration agency + if (this.isDOIReserved(context, doi)) + { + // if doi is registered for this object we still should check its + // status in our database (see below). + // if it is registered for another object we should notify an admin + if (!this.isDOIReserved(context, dso, doi)) + { + log.warn("DOI {} is reserved for another object already.", doi); + throw new DOIIdentifierException(DOIIdentifierException.DOI_ALREADY_EXISTS); + } + // the DOI is reserved for this Object. We use {@code reserveDOI} to + // send metadata updates, so don't return here! + } + this.prepareXwalk(); if (!this.xwalk.canDisseminate(dso)) @@ -557,7 +572,40 @@ implements DOIConnector public void registerDOI(Context context, DSpaceObject dso, String doi) throws DOIIdentifierException { - log.debug("Want to register DOI {}!", doi); + // check if the DOI is already registered online + if (this.isDOIRegistered(context, doi)) + { + // if it is registered for another object we should notify an admin + if (!this.isDOIRegistered(context, dso, doi)) + { + // DOI is reserved for another object + log.warn("DOI {} is registered for another object already.", doi); + throw new DOIIdentifierException(DOIIdentifierException.DOI_ALREADY_EXISTS); + } + // doi is registered for this object, we're done + return; + } + else + { + // DataCite wants us to reserve a DOI before we can register it + if (!this.isDOIReserved(context, dso, doi)) + { + // check if doi is already reserved for another dso + if (this.isDOIReserved(context, doi)) + { + log.warn("Trying to register DOI {}, that is reserved for " + + "another dso.", doi); + throw new DOIIdentifierException("Trying to register a DOI " + + "that is reserved for another object.", + DOIIdentifierException.DOI_ALREADY_EXISTS); + } + + // the DOIIdentifierProvider should catch and handle this + throw new DOIIdentifierException("You need to reserve a DOI " + + "before you can register it.", + DOIIdentifierException.RESERVE_FIRST); + } + } // send doi=\nurl= to mds/doi DataCiteResponse resp = null; @@ -600,7 +648,7 @@ implements DOIConnector + "of DOIs. The DOI we wanted to register had not been " + "reserved in advance. Please contact the administrator " + "or take a look in DSpace log file.", - DOIIdentifierException.REGISTER_FIRST); + DOIIdentifierException.RESERVE_FIRST); } // Catch all other http status code in case we forgot one. default : @@ -619,18 +667,27 @@ implements DOIConnector public void updateMetadata(Context context, DSpaceObject dso, String doi) throws DOIIdentifierException { + // check if doi is reserved for another object + if (!this.isDOIReserved(context, dso, doi) && this.isDOIReserved(context, doi)) + { + log.warn("Trying to update metadata for DOI {}, that is reserved" + + " for another dso.", doi); + throw new DOIIdentifierException("Trying to update metadta for " + + "a DOI that is reserved for another object.", + DOIIdentifierException.DOI_ALREADY_EXISTS); + } // We can use reserveDOI to update metadata. Datacite API uses the same // request for reservartion as for updating metadata. this.reserveDOI(context, dso, doi); } - private DataCiteResponse sendDOIPostRequest(String doi, String url) + protected DataCiteResponse sendDOIPostRequest(String doi, String url) throws DOIIdentifierException { // post mds/doi/ // body must contaion "doi=\nurl=}n" URIBuilder uribuilder = new URIBuilder(); - uribuilder.setScheme("https").setHost(HOST).setPath(DOI_PATH); + uribuilder.setScheme(SCHEME).setHost(HOST).setPath(DOI_PATH); HttpPost httppost = null; try @@ -641,7 +698,7 @@ implements DOIConnector { log.error("The URL we constructed to check a DOI " + "produced a URISyntaxException. Please check the configuration parameters!"); - log.error("The URL was {}.", "https://" + HOST + + log.error("The URL was {}.", SCHEME + "://" + HOST + DOI_PATH + "/" + doi.substring(DOI.SCHEME.length())); throw new RuntimeException("The URL we constructed to check a DOI " + "produced a URISyntaxException. Please check the configuration parameters!", e); @@ -674,12 +731,12 @@ implements DOIConnector } - private DataCiteResponse sendMetadataDeleteRequest(String doi) + protected DataCiteResponse sendMetadataDeleteRequest(String doi) throws DOIIdentifierException { // delete mds/metadata/ URIBuilder uribuilder = new URIBuilder(); - uribuilder.setScheme("https").setHost(HOST).setPath(METADATA_PATH + uribuilder.setScheme(SCHEME).setHost(HOST).setPath(METADATA_PATH + doi.substring(DOI.SCHEME.length())); HttpDelete httpdelete = null; @@ -691,7 +748,7 @@ implements DOIConnector { log.error("The URL we constructed to check a DOI " + "produced a URISyntaxException. Please check the configuration parameters!"); - log.error("The URL was {}.", "https://" + HOST + + log.error("The URL was {}.", SCHEME + "://" + HOST + DOI_PATH + "/" + doi.substring(DOI.SCHEME.length())); throw new RuntimeException("The URL we constructed to check a DOI " + "produced a URISyntaxException. Please check the configuration parameters!", e); @@ -699,23 +756,23 @@ implements DOIConnector return sendHttpRequest(httpdelete, doi); } - private DataCiteResponse sendDOIGetRequest(String doi) + protected DataCiteResponse sendDOIGetRequest(String doi) throws DOIIdentifierException { return sendGetRequest(doi, DOI_PATH); } - private DataCiteResponse sendMetadataGetRequest(String doi) + protected DataCiteResponse sendMetadataGetRequest(String doi) throws DOIIdentifierException { return sendGetRequest(doi, METADATA_PATH); } - private DataCiteResponse sendGetRequest(String doi, String path) + protected DataCiteResponse sendGetRequest(String doi, String path) throws DOIIdentifierException { URIBuilder uribuilder = new URIBuilder(); - uribuilder.setScheme("https").setHost(HOST).setPath(path + uribuilder.setScheme(SCHEME).setHost(HOST).setPath(path + doi.substring(DOI.SCHEME.length())); HttpGet httpget = null; @@ -727,7 +784,7 @@ implements DOIConnector { log.error("The URL we constructed to check a DOI " + "produced a URISyntaxException. Please check the configuration parameters!"); - log.error("The URL was {}.", "https://" + HOST + + log.error("The URL was {}.", SCHEME + "://" + HOST + DOI_PATH + "/" + doi.substring(DOI.SCHEME.length())); throw new RuntimeException("The URL we constructed to check a DOI " + "produced a URISyntaxException. Please check the configuration parameters!", e); @@ -735,7 +792,7 @@ implements DOIConnector return sendHttpRequest(httpget, doi); } - private DataCiteResponse sendMetadataPostRequest(String doi, Element metadataRoot) + protected DataCiteResponse sendMetadataPostRequest(String doi, Element metadataRoot) throws DOIIdentifierException { Format format = Format.getCompactFormat(); @@ -744,13 +801,13 @@ implements DOIConnector return sendMetadataPostRequest(doi, xout.outputString(new Document(metadataRoot))); } - private DataCiteResponse sendMetadataPostRequest(String doi, String metadata) + protected DataCiteResponse sendMetadataPostRequest(String doi, String metadata) throws DOIIdentifierException { // post mds/metadata/ // body must contain metadata in DataCite-XML. URIBuilder uribuilder = new URIBuilder(); - uribuilder.setScheme("https").setHost(HOST).setPath(METADATA_PATH); + uribuilder.setScheme(SCHEME).setHost(HOST).setPath(METADATA_PATH); HttpPost httppost = null; try @@ -761,7 +818,7 @@ implements DOIConnector { log.error("The URL we constructed to check a DOI " + "produced a URISyntaxException. Please check the configuration parameters!"); - log.error("The URL was {}.", "https://" + HOST + + log.error("The URL was {}.", SCHEME + "://" + HOST + DOI_PATH + "/" + doi.substring(DOI.SCHEME.length())); throw new RuntimeException("The URL we constructed to check a DOI " + "produced a URISyntaxException. Please check the configuration parameters!", e); @@ -799,7 +856,7 @@ implements DOIConnector * @return * @throws DOIIdentifierException */ - private DataCiteResponse sendHttpRequest(HttpUriRequest req, String doi) + protected DataCiteResponse sendHttpRequest(HttpUriRequest req, String doi) throws DOIIdentifierException { DefaultHttpClient httpclient = new DefaultHttpClient(); @@ -923,7 +980,7 @@ implements DOIConnector } // returns null or handle - private String extractAlternateIdentifier(Context context, String content) + protected String extractAlternateIdentifier(Context context, String content) throws SQLException, DOIIdentifierException { if (content == null) @@ -969,12 +1026,12 @@ implements DOIConnector return handle; } - private String extractDOI(Element root) { + protected String extractDOI(Element root) { Element doi = root.getChild("identifier", root.getNamespace()); return (null == doi) ? null : doi.getTextTrim(); } - private Element addDOI(String doi, Element root) { + protected Element addDOI(String doi, Element root) { if (null != extractDOI(root)) { return root; @@ -985,7 +1042,7 @@ implements DOIConnector return root.addContent(0, identifier); } - private class DataCiteResponse + protected class DataCiteResponse { private final int statusCode; private final String content; diff --git a/dspace-api/src/main/java/org/dspace/submit/lookup/ArXivService.java b/dspace-api/src/main/java/org/dspace/submit/lookup/ArXivService.java index c2c3a8e393..42e3b1de08 100644 --- a/dspace-api/src/main/java/org/dspace/submit/lookup/ArXivService.java +++ b/dspace-api/src/main/java/org/dspace/submit/lookup/ArXivService.java @@ -76,124 +76,75 @@ public class ArXivService } private List search(String query, String arxivid, int max_result) - throws IOException, HttpException - { - List results = new ArrayList(); - if (!ConfigurationManager.getBooleanProperty(SubmissionLookupService.CFG_MODULE, "remoteservice.demo")) - { - GetMethod method = null; - try - { - HttpClient client = new HttpClient(); - client.setTimeout(timeout); - method = new GetMethod("http://export.arxiv.org/api/query"); - NameValuePair id = new NameValuePair("id_list", arxivid); - NameValuePair queryParam = new NameValuePair("search_query", - query); - NameValuePair count = new NameValuePair("max_results", - String.valueOf(max_result)); - method.setQueryString(new NameValuePair[] { id, queryParam, - count }); - // Execute the method. - int statusCode = client.executeMethod(method); + throws IOException, HttpException + { + List results = new ArrayList(); + GetMethod method = null; + try + { + HttpClient client = new HttpClient(); + client.setTimeout(timeout); + method = new GetMethod("http://export.arxiv.org/api/query"); + NameValuePair id = new NameValuePair("id_list", arxivid); + NameValuePair queryParam = new NameValuePair("search_query", + query); + NameValuePair count = new NameValuePair("max_results", + String.valueOf(max_result)); + method.setQueryString(new NameValuePair[] { id, queryParam, + count }); + // Execute the method. + int statusCode = client.executeMethod(method); - if (statusCode != HttpStatus.SC_OK) - { - if (statusCode == HttpStatus.SC_BAD_REQUEST) - throw new RuntimeException("arXiv query is not valid"); - else - throw new RuntimeException("Http call failed: " - + method.getStatusLine()); - } + if (statusCode != HttpStatus.SC_OK) + { + if (statusCode == HttpStatus.SC_BAD_REQUEST) + throw new RuntimeException("arXiv query is not valid"); + else + throw new RuntimeException("Http call failed: " + + method.getStatusLine()); + } - try - { - DocumentBuilderFactory factory = DocumentBuilderFactory - .newInstance(); - factory.setValidating(false); - factory.setIgnoringComments(true); - factory.setIgnoringElementContentWhitespace(true); + try + { + DocumentBuilderFactory factory = DocumentBuilderFactory + .newInstance(); + factory.setValidating(false); + factory.setIgnoringComments(true); + factory.setIgnoringElementContentWhitespace(true); - DocumentBuilder db = factory.newDocumentBuilder(); - Document inDoc = db.parse(method.getResponseBodyAsStream()); + DocumentBuilder db = factory.newDocumentBuilder(); + Document inDoc = db.parse(method.getResponseBodyAsStream()); - Element xmlRoot = inDoc.getDocumentElement(); - List dataRoots = XMLUtils.getElementList(xmlRoot, - "entry"); + Element xmlRoot = inDoc.getDocumentElement(); + List dataRoots = XMLUtils.getElementList(xmlRoot, + "entry"); - for (Element dataRoot : dataRoots) - { - Record crossitem = ArxivUtils - .convertArxixDomToRecord(dataRoot); - if (crossitem != null) - { - results.add(crossitem); - } - } - } - catch (Exception e) - { - throw new RuntimeException( - "ArXiv identifier is not valid or not exist"); - } - } - finally - { - if (method != null) - { - method.releaseConnection(); - } - } - } - else - { - InputStream stream = null; - try - { - File file = new File( - ConfigurationManager.getProperty("dspace.dir") - + "/config/crosswalks/demo/arxiv.xml"); - stream = new FileInputStream(file); - try - { - DocumentBuilderFactory factory = DocumentBuilderFactory - .newInstance(); - factory.setValidating(false); - factory.setIgnoringComments(true); - factory.setIgnoringElementContentWhitespace(true); - DocumentBuilder db = factory.newDocumentBuilder(); - Document inDoc = db.parse(stream); + for (Element dataRoot : dataRoots) + { + Record crossitem = ArxivUtils + .convertArxixDomToRecord(dataRoot); + if (crossitem != null) + { + results.add(crossitem); + } + } + } + catch (Exception e) + { + throw new RuntimeException( + "ArXiv identifier is not valid or not exist"); + } + } + finally + { + if (method != null) + { + method.releaseConnection(); + } + } - Element xmlRoot = inDoc.getDocumentElement(); - List dataRoots = XMLUtils.getElementList(xmlRoot, - "entry"); - for (Element dataRoot : dataRoots) - { - Record crossitem = ArxivUtils - .convertArxixDomToRecord(dataRoot); - - if (crossitem != null) - { - results.add(crossitem); - } - } - } - catch (Exception e) - { - throw new RuntimeException( - "ArXiv identifier is not valid or not exist"); - } - } - finally - { - if (stream != null) - { - stream.close(); - } - } - } - return results; - } + return results; + } public Record getByArXivIDs(String raw) throws HttpException, IOException { diff --git a/dspace-api/src/main/java/org/dspace/submit/lookup/CrossRefOnlineDataLoader.java b/dspace-api/src/main/java/org/dspace/submit/lookup/CrossRefOnlineDataLoader.java index c5c379088f..ec86ac45ec 100644 --- a/dspace-api/src/main/java/org/dspace/submit/lookup/CrossRefOnlineDataLoader.java +++ b/dspace-api/src/main/java/org/dspace/submit/lookup/CrossRefOnlineDataLoader.java @@ -35,6 +35,9 @@ public class CrossRefOnlineDataLoader extends NetworkSubmissionLookupDataLoader private boolean searchProvider = true; + private String apiKey = null; + private int maxResults = 10; + public void setSearchProvider(boolean searchProvider) { this.searchProvider = searchProvider; @@ -60,9 +63,14 @@ public class CrossRefOnlineDataLoader extends NetworkSubmissionLookupDataLoader Set dois = keys.get(DOI); List items = null; List results = new ArrayList(); + + if (getApiKey() == null){ + throw new RuntimeException("No CrossRef API key is specified!"); + } + try { - items = crossrefService.search(context, dois); + items = crossrefService.search(context, dois, getApiKey()); } catch (JDOMException e) { @@ -89,8 +97,12 @@ public class CrossRefOnlineDataLoader extends NetworkSubmissionLookupDataLoader public List search(Context context, String title, String author, int year) throws HttpException, IOException { + if (getApiKey() == null){ + throw new RuntimeException("No CrossRef API key is specified!"); + } + List items = crossrefService.search(context, title, author, - year, 10); + year, getMaxResults(), getApiKey()); return items; } @@ -99,4 +111,20 @@ public class CrossRefOnlineDataLoader extends NetworkSubmissionLookupDataLoader { return searchProvider; } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public int getMaxResults() { + return maxResults; + } + + public void setMaxResults(int maxResults) { + this.maxResults = maxResults; + } } diff --git a/dspace-api/src/main/java/org/dspace/submit/lookup/CrossRefService.java b/dspace-api/src/main/java/org/dspace/submit/lookup/CrossRefService.java index 79338d508b..32a5fa19ce 100644 --- a/dspace-api/src/main/java/org/dspace/submit/lookup/CrossRefService.java +++ b/dspace-api/src/main/java/org/dspace/submit/lookup/CrossRefService.java @@ -29,7 +29,6 @@ import org.apache.commons.httpclient.methods.GetMethod; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.dspace.app.util.XMLUtils; -import org.dspace.core.ConfigurationManager; import org.dspace.core.Context; import org.dspace.core.LogManager; import org.jdom.JDOMException; @@ -58,7 +57,7 @@ public class CrossRefService this.timeout = timeout; } - public List search(Context context, Set dois) + public List search(Context context, Set dois, String apiKey) throws HttpException, IOException, JDOMException, ParserConfigurationException, SAXException { @@ -67,84 +66,77 @@ public class CrossRefService { for (String record : dois) { - try - { - if (!ConfigurationManager - .getBooleanProperty(SubmissionLookupService.CFG_MODULE, "remoteservice.demo")) - { - GetMethod method = null; - try - { - String apiKey = ConfigurationManager - .getProperty(SubmissionLookupService.CFG_MODULE, "crossref.api-key"); + try + { + GetMethod method = null; + try + { + HttpClient client = new HttpClient(); + client.setConnectionTimeout(timeout); + method = new GetMethod( + "http://www.crossref.org/openurl/"); - HttpClient client = new HttpClient(); - client.setConnectionTimeout(timeout); - method = new GetMethod( - "http://www.crossref.org/openurl/"); + NameValuePair pid = new NameValuePair("pid", apiKey); + NameValuePair noredirect = new NameValuePair( + "noredirect", "true"); + NameValuePair id = new NameValuePair("id", record); + method.setQueryString(new NameValuePair[] { pid, + noredirect, id }); + // Execute the method. + int statusCode = client.executeMethod(method); - NameValuePair pid = new NameValuePair("pid", apiKey); - NameValuePair noredirect = new NameValuePair( - "noredirect", "true"); - NameValuePair id = new NameValuePair("id", record); - method.setQueryString(new NameValuePair[] { pid, - noredirect, id }); - // Execute the method. - int statusCode = client.executeMethod(method); + if (statusCode != HttpStatus.SC_OK) + { + throw new RuntimeException("Http call failed: " + + method.getStatusLine()); + } - if (statusCode != HttpStatus.SC_OK) - { - throw new RuntimeException("Http call failed: " - + method.getStatusLine()); - } + Record crossitem; + try + { + DocumentBuilderFactory factory = DocumentBuilderFactory + .newInstance(); + factory.setValidating(false); + factory.setIgnoringComments(true); + factory.setIgnoringElementContentWhitespace(true); - Record crossitem; - try - { - DocumentBuilderFactory factory = DocumentBuilderFactory - .newInstance(); - factory.setValidating(false); - factory.setIgnoringComments(true); - factory.setIgnoringElementContentWhitespace(true); + DocumentBuilder db = factory + .newDocumentBuilder(); + Document inDoc = db.parse(method + .getResponseBodyAsStream()); - DocumentBuilder db = factory - .newDocumentBuilder(); - Document inDoc = db.parse(method - .getResponseBodyAsStream()); + Element xmlRoot = inDoc.getDocumentElement(); + Element queryResult = XMLUtils.getSingleElement(xmlRoot, "query_result"); + Element body = XMLUtils.getSingleElement(queryResult, "body"); + Element dataRoot = XMLUtils.getSingleElement(body, "query"); - Element xmlRoot = inDoc.getDocumentElement(); - Element queryResult = XMLUtils.getSingleElement(xmlRoot, "query_result"); - Element body = XMLUtils.getSingleElement(queryResult, "body"); - Element dataRoot = XMLUtils.getSingleElement(body, "query"); - - crossitem = CrossRefUtils - .convertCrossRefDomToRecord(dataRoot); - results.add(crossitem); - } - catch (Exception e) - { - log.warn(LogManager - .getHeader( - context, - "retrieveRecordDOI", - record - + " DOI is not valid or not exist: " - + e.getMessage())); - } - } - finally - { - if (method != null) - { - method.releaseConnection(); - } - } - } - } - catch (RuntimeException rt) - { - log.error(rt.getMessage(), rt); - } + crossitem = CrossRefUtils + .convertCrossRefDomToRecord(dataRoot); + results.add(crossitem); + } + catch (Exception e) + { + log.warn(LogManager + .getHeader( + context, + "retrieveRecordDOI", + record + + " DOI is not valid or not exist: " + + e.getMessage())); + } + } + finally + { + if (method != null) + { + method.releaseConnection(); + } + } + } + catch (RuntimeException rt) + { + log.error(rt.getMessage(), rt); + } } } return results; @@ -176,7 +168,7 @@ public class CrossRefService } public List search(Context context, String title, String authors, - int year, int count) throws IOException, HttpException + int year, int count, String apiKey) throws IOException, HttpException { GetMethod method = null; try @@ -210,7 +202,7 @@ public class CrossRefService } method.releaseConnection(); - return search(context, dois); + return search(context, dois, apiKey); } catch (Exception e) { diff --git a/dspace-api/src/main/java/org/dspace/submit/lookup/PubmedFileDataLoader.java b/dspace-api/src/main/java/org/dspace/submit/lookup/PubmedFileDataLoader.java index 393e67a20e..d8a99fad38 100644 --- a/dspace-api/src/main/java/org/dspace/submit/lookup/PubmedFileDataLoader.java +++ b/dspace-api/src/main/java/org/dspace/submit/lookup/PubmedFileDataLoader.java @@ -93,7 +93,7 @@ public class PubmedFileDataLoader extends FileDataLoader Record record = null; try { - record = PubmedUtils.convertCrossRefDomToRecord(xmlArticle); + record = PubmedUtils.convertPubmedDomToRecord(xmlArticle); recordSet.addRecord(convertFields(record)); } catch (Exception e) diff --git a/dspace-api/src/main/java/org/dspace/submit/lookup/PubmedService.java b/dspace-api/src/main/java/org/dspace/submit/lookup/PubmedService.java index aa438259fa..d493672f34 100644 --- a/dspace-api/src/main/java/org/dspace/submit/lookup/PubmedService.java +++ b/dspace-api/src/main/java/org/dspace/submit/lookup/PubmedService.java @@ -212,128 +212,71 @@ public class PubmedService throws HttpException, IOException, ParserConfigurationException, SAXException { - List results = new ArrayList(); - if (!ConfigurationManager.getBooleanProperty(SubmissionLookupService.CFG_MODULE, "remoteservice.demo")) - { - GetMethod method = null; - try - { - HttpClient client = new HttpClient(); - client.setTimeout(5 * timeout); - method = new GetMethod( - "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi"); + List results = new ArrayList(); + GetMethod method = null; + try + { + HttpClient client = new HttpClient(); + client.setTimeout(5 * timeout); + method = new GetMethod( + "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi"); - NameValuePair db = new NameValuePair("db", "pubmed"); - NameValuePair retmode = new NameValuePair("retmode", "xml"); - NameValuePair rettype = new NameValuePair("rettype", "full"); - NameValuePair id = new NameValuePair("id", StringUtils.join( - pubmedIDs.iterator(), ",")); - method.setQueryString(new NameValuePair[] { db, retmode, - rettype, id }); - // Execute the method. - int statusCode = client.executeMethod(method); + NameValuePair db = new NameValuePair("db", "pubmed"); + NameValuePair retmode = new NameValuePair("retmode", "xml"); + NameValuePair rettype = new NameValuePair("rettype", "full"); + NameValuePair id = new NameValuePair("id", StringUtils.join( + pubmedIDs.iterator(), ",")); + method.setQueryString(new NameValuePair[] { db, retmode, + rettype, id }); + // Execute the method. + int statusCode = client.executeMethod(method); - if (statusCode != HttpStatus.SC_OK) - { - throw new RuntimeException("WS call failed: " - + method.getStatusLine()); - } + if (statusCode != HttpStatus.SC_OK) + { + throw new RuntimeException("WS call failed: " + + method.getStatusLine()); + } - DocumentBuilderFactory factory = DocumentBuilderFactory - .newInstance(); - factory.setValidating(false); - factory.setIgnoringComments(true); - factory.setIgnoringElementContentWhitespace(true); + DocumentBuilderFactory factory = DocumentBuilderFactory + .newInstance(); + factory.setValidating(false); + factory.setIgnoringComments(true); + factory.setIgnoringElementContentWhitespace(true); - DocumentBuilder builder = factory.newDocumentBuilder(); - Document inDoc = builder - .parse(method.getResponseBodyAsStream()); + DocumentBuilder builder = factory.newDocumentBuilder(); + Document inDoc = builder + .parse(method.getResponseBodyAsStream()); - Element xmlRoot = inDoc.getDocumentElement(); - List pubArticles = XMLUtils.getElementList(xmlRoot, - "PubmedArticle"); + Element xmlRoot = inDoc.getDocumentElement(); + List pubArticles = XMLUtils.getElementList(xmlRoot, + "PubmedArticle"); - for (Element xmlArticle : pubArticles) - { - Record pubmedItem = null; - try - { - pubmedItem = PubmedUtils - .convertCrossRefDomToRecord(xmlArticle); - results.add(pubmedItem); - } - catch (Exception e) - { - throw new RuntimeException( - "PubmedID is not valid or not exist: " - + e.getMessage(), e); - } - } + for (Element xmlArticle : pubArticles) + { + Record pubmedItem = null; + try + { + pubmedItem = PubmedUtils + .convertPubmedDomToRecord(xmlArticle); + results.add(pubmedItem); + } + catch (Exception e) + { + throw new RuntimeException( + "PubmedID is not valid or not exist: " + + e.getMessage(), e); + } + } - return results; - } - finally - { - if (method != null) - { - method.releaseConnection(); - } - } - } - else - { - InputStream stream = null; - try - { - File file = new File( - ConfigurationManager.getProperty("dspace.dir") - + "/config/crosswalks/demo/pubmed.xml"); - stream = new FileInputStream(file); - - DocumentBuilderFactory factory = DocumentBuilderFactory - .newInstance(); - factory.setValidating(false); - factory.setIgnoringComments(true); - factory.setIgnoringElementContentWhitespace(true); - - DocumentBuilder builder = factory.newDocumentBuilder(); - Document inDoc = builder.parse(stream); - - Element xmlRoot = inDoc.getDocumentElement(); - List pubArticles = XMLUtils.getElementList(xmlRoot, - "PubmedArticle"); - - for (Element xmlArticle : pubArticles) - { - Record pubmedItem = null; - try - { - pubmedItem = PubmedUtils - .convertCrossRefDomToRecord(xmlArticle); - results.add(pubmedItem); - } - catch (Exception e) - { - throw new RuntimeException( - "PubmedID is not valid or not exist: " - + e.getMessage(), e); - } - } - - return results; - } - catch (Exception e) - { - throw new RuntimeException(e.getMessage(), e); - } - finally - { - if (stream != null) - { - stream.close(); - } - } - } + return results; + } + finally + { + if (method != null) + { + method.releaseConnection(); + } + } } public List search(String doi, String pmid) throws HttpException, diff --git a/dspace-api/src/main/java/org/dspace/submit/lookup/PubmedUtils.java b/dspace-api/src/main/java/org/dspace/submit/lookup/PubmedUtils.java index 7d54c3d664..552db676ef 100644 --- a/dspace-api/src/main/java/org/dspace/submit/lookup/PubmedUtils.java +++ b/dspace-api/src/main/java/org/dspace/submit/lookup/PubmedUtils.java @@ -34,7 +34,7 @@ import org.w3c.dom.Element; public class PubmedUtils { - public static Record convertCrossRefDomToRecord(Element pubArticle) + public static Record convertPubmedDomToRecord(Element pubArticle) { MutableRecord record = new SubmissionLookupPublication(""); diff --git a/dspace-api/src/main/java/org/dspace/submit/lookup/SubmissionLookupService.java b/dspace-api/src/main/java/org/dspace/submit/lookup/SubmissionLookupService.java index 512bf4197e..b3a6334d55 100644 --- a/dspace-api/src/main/java/org/dspace/submit/lookup/SubmissionLookupService.java +++ b/dspace-api/src/main/java/org/dspace/submit/lookup/SubmissionLookupService.java @@ -55,6 +55,8 @@ public class SubmissionLookupService private TransformationEngine phase1TransformationEngine; private TransformationEngine phase2TransformationEngine; + + private List detailFields = null; public void setPhase2TransformationEngine( TransformationEngine phase2TransformationEngine) @@ -212,4 +214,12 @@ public class SubmissionLookupService { return this.fileProviders; } + + public List getDetailFields() { + return detailFields; + } + + public void setDetailFields(List detailFields) { + this.detailFields = detailFields; + } } diff --git a/dspace-api/src/main/resources/Messages.properties b/dspace-api/src/main/resources/Messages.properties index f75d0e297b..249041d4f6 100644 --- a/dspace-api/src/main/resources/Messages.properties +++ b/dspace-api/src/main/resources/Messages.properties @@ -78,6 +78,8 @@ itemlist.dc.type.degree = Degree itemlist.et-al = et al itemlist.thumbnail = Preview +itemlist.title.undefined = Undefined + jsp.adminhelp = jsp.administer = Administer jsp.admintools = Admin Tools diff --git a/dspace-api/src/test/java/org/dspace/identifier/MockDOIConnector.java b/dspace-api/src/test/java/org/dspace/identifier/MockDOIConnector.java index 2517b6dadf..db0f1d9fea 100644 --- a/dspace-api/src/test/java/org/dspace/identifier/MockDOIConnector.java +++ b/dspace-api/src/test/java/org/dspace/identifier/MockDOIConnector.java @@ -125,7 +125,7 @@ implements org.dspace.identifier.doi.DOIConnector if (!reserved.containsKey(doi)) { throw new DOIIdentifierException("Trying to register an unreserverd " - + "DOI.", DOIIdentifierException.REGISTER_FIRST); + + "DOI.", DOIIdentifierException.RESERVE_FIRST); } if (reserved.get(doi).intValue() != dso.getID()) diff --git a/dspace-jspui/pom.xml b/dspace-jspui/pom.xml index 705dfd37cc..75f88ba28a 100644 --- a/dspace-jspui/pom.xml +++ b/dspace-jspui/pom.xml @@ -13,7 +13,7 @@ org.dspace dspace-parent - 4.0-rc2-SNAPSHOT + 4.0-rc3-SNAPSHOT .. diff --git a/dspace-jspui/src/main/java/org/dspace/app/webui/json/SubmissionLookupJSONRequest.java b/dspace-jspui/src/main/java/org/dspace/app/webui/json/SubmissionLookupJSONRequest.java index 404173b70b..aa2aef6172 100644 --- a/dspace-jspui/src/main/java/org/dspace/app/webui/json/SubmissionLookupJSONRequest.java +++ b/dspace-jspui/src/main/java/org/dspace/app/webui/json/SubmissionLookupJSONRequest.java @@ -329,7 +329,7 @@ public class SubmissionLookupJSONRequest extends JSONRequest private Map getDetails(ItemSubmissionLookupDTO item, Context context) { - List fieldOrder = getFieldOrderFromConfiguration(); + List fieldOrder = getFieldOrder(); Record totalData = item.getTotalPublication(service.getProviders()); Set availableFields = totalData.getFields(); List fieldsLabels = new ArrayList(); @@ -339,10 +339,8 @@ public class SubmissionLookupJSONRequest extends JSONRequest { try { - fieldsLabels.add(new String[] { - f, - I18nUtil.getMessage("jsp.submission-lookup.detail." - + f, context) }); + if (totalData.getValues(f)!=null && totalData.getValues(f).size()>0) + fieldsLabels.add(new String[] {f, I18nUtil.getMessage("jsp.submission-lookup.detail."+ f, context) }); } catch (MissingResourceException e) { @@ -368,24 +366,37 @@ public class SubmissionLookupJSONRequest extends JSONRequest return data; } - private List getFieldOrderFromConfiguration() + private List getFieldOrder() { - String config = ConfigurationManager - .getProperty("submission-lookup.detail.fields"); - if (config == null) - { - config = "title,authors,editors,years,doi,pmid,eid,arxiv,journal,jissn,jeissn,volume,issue,serie,sissn,seissn,abstract,mesh,keywords,subtype"; - } - List result = new ArrayList(); - String[] split = config.split(","); - for (String s : split) - { - if (StringUtils.isNotBlank(s)) - { - result.add(s.trim()); - } - } - return result; + if (service.getDetailFields()!=null){ + return service.getDetailFields(); + } + + //Default values, in case the property is not set + List defaultValues = new ArrayList(); + defaultValues.add("title"); + defaultValues.add("authors"); + defaultValues.add("editors"); + defaultValues.add("translators"); + defaultValues.add("chairs"); + defaultValues.add("issued"); + defaultValues.add("abstract"); + defaultValues.add("doi"); + defaultValues.add("journal"); + defaultValues.add("volume"); + defaultValues.add("issue"); + defaultValues.add("publisher"); + defaultValues.add("jissn"); + defaultValues.add("pisbn"); + defaultValues.add("eisbn"); + defaultValues.add("arxivCategory"); + defaultValues.add("keywords"); + defaultValues.add("mesh"); + defaultValues.add("language"); + defaultValues.add("subtype"); + defaultValues.add("translators"); + + return defaultValues; } private List> getLightResultList( diff --git a/dspace-jspui/src/main/java/org/dspace/app/webui/jsptag/BrowseListTag.java b/dspace-jspui/src/main/java/org/dspace/app/webui/jsptag/BrowseListTag.java index f510dbd53a..3de8495938 100644 --- a/dspace-jspui/src/main/java/org/dspace/app/webui/jsptag/BrowseListTag.java +++ b/dspace-jspui/src/main/java/org/dspace/app/webui/jsptag/BrowseListTag.java @@ -483,7 +483,7 @@ public class BrowseListTag extends TagSupport metadata = UIUtil.displayDate(dd, false, false, hrq); } // format the title field correctly for withdrawn and private items (ie. don't link) - else if (field.equals(titleField) && (items[i].isWithdrawn() || !isDiscoverable(hrq, items[i]))) + else if (field.equals(titleField) && items[i].isWithdrawn()) { metadata = Utils.addEntities(metadataArray[0].value); } @@ -570,7 +570,24 @@ public class BrowseListTag extends TagSupport metadata = "" + sb.toString() + ""; } } - + //In case title has no value, replace it with "undefined" so as the user has something to + //click in order to access the item page + else if (field.equals(titleField)){ + String undefined = LocaleSupport.getLocalizedMessage(pageContext, "itemlist.title.undefined"); + if (items[i].isWithdrawn()) + { + metadata = "("+undefined+")"; + } + // format the title field correctly (as long as the item isn't withdrawn, link to it) + else + { + metadata = "" + + "("+undefined+")" + + ""; + } + } + // prepare extra special layout requirements for dates String extras = ""; if (isDate[colIdx]) @@ -887,21 +904,4 @@ public class BrowseListTag extends TagSupport throw new JspException("Server does not support DSpace's default encoding. ", e); } } - - /* whether the embedded item of the bitem is discoverable or not? */ - private boolean isDiscoverable(HttpServletRequest hrq, BrowseItem bitem) - throws JspException - { - try - { - Context c = UIUtil.obtainContext(hrq); - Item item = Item.find(c, bitem.getID()); - - return item.isDiscoverable(); - } - catch (SQLException sqle) - { - throw new JspException(sqle.getMessage(), sqle); - } - } } diff --git a/dspace-jspui/src/main/java/org/dspace/app/webui/jsptag/ItemListTag.java b/dspace-jspui/src/main/java/org/dspace/app/webui/jsptag/ItemListTag.java index 5bdb105d9d..8fa54b328a 100644 --- a/dspace-jspui/src/main/java/org/dspace/app/webui/jsptag/ItemListTag.java +++ b/dspace-jspui/src/main/java/org/dspace/app/webui/jsptag/ItemListTag.java @@ -535,6 +535,23 @@ public class ItemListTag extends TagSupport metadata = "" + sb.toString() + ""; } } + //In case title has no value, replace it with "undefined" so as the user has something to + //click in order to access the item page + else if (field.equals(titleField)){ + String undefined = LocaleSupport.getLocalizedMessage(pageContext, "itemlist.title.undefined"); + if (items[i].isWithdrawn()) + { + metadata = "("+undefined+")"; + } + // format the title field correctly (as long as the item isn't withdrawn, link to it) + else + { + metadata = "" + + "("+undefined+")" + + ""; + } + } // prepare extra special layout requirements for dates String extras = ""; diff --git a/dspace-jspui/src/main/webapp/community-home.jsp b/dspace-jspui/src/main/webapp/community-home.jsp index 5788dfe17c..b3e00a85a3 100644 --- a/dspace-jspui/src/main/webapp/community-home.jsp +++ b/dspace-jspui/src/main/webapp/community-home.jsp @@ -226,7 +226,8 @@
<% - if (subcommunities.length != 0) + boolean showLogos = ConfigurationManager.getBooleanProperty("jspui.community-home.logos", true); + if (subcommunities.length != 0) { %>
@@ -241,7 +242,7 @@
<% Bitstream logoCom = subcommunities[j].getLogo(); - if (logoCom != null) { %> + if (showLogos && logoCom != null) { %>
Logo
@@ -297,7 +298,7 @@
<% Bitstream logoCol = collections[i].getLogo(); - if (logoCol != null) { %> + if (showLogos && logoCol != null) { %>
Logo
diff --git a/dspace-jspui/src/main/webapp/community-list.jsp b/dspace-jspui/src/main/webapp/community-list.jsp index 735d57e583..336a7ca114 100644 --- a/dspace-jspui/src/main/webapp/community-list.jsp +++ b/dspace-jspui/src/main/webapp/community-list.jsp @@ -53,9 +53,10 @@ void showCommunity(Community c, JspWriter out, HttpServletRequest request, ItemCounter ic, Map collectionMap, Map subcommunityMap) throws ItemCountException, IOException, SQLException { + boolean showLogos = ConfigurationManager.getBooleanProperty("jspui.community-list.logos", true); out.println( "
  • " ); Bitstream logo = c.getLogo(); - if (logo != null) + if (showLogos && logo != null) { out.println(""); Bitstream logoCol = cols[j].getLogo(); - if (logoCol != null) + if (showLogos && logoCol != null) { out.println("

    <% - + boolean showLogos = ConfigurationManager.getBooleanProperty("jspui.home-page.logos", true); for (int i = 0; i < communities.length; i++) { %>
    <% Bitstream logo = communities[i].getLogo(); - if (logo != null) { %> + if (showLogos && logo != null) { %>
    Logo
    diff --git a/dspace-jspui/src/main/webapp/layout/header-default.jsp b/dspace-jspui/src/main/webapp/layout/header-default.jsp index 0ad8443046..250124b2fa 100644 --- a/dspace-jspui/src/main/webapp/layout/header-default.jsp +++ b/dspace-jspui/src/main/webapp/layout/header-default.jsp @@ -133,6 +133,14 @@
    <% } + else + { + %> +
    + +
    +<% + } %> diff --git a/dspace-jspui/src/main/webapp/layout/header-submission.jsp b/dspace-jspui/src/main/webapp/layout/header-submission.jsp index 4ab16d0fd7..3bee332a94 100644 --- a/dspace-jspui/src/main/webapp/layout/header-submission.jsp +++ b/dspace-jspui/src/main/webapp/layout/header-submission.jsp @@ -133,6 +133,14 @@
    <% } + else + { + %> +
    + +
    +<% + } %> diff --git a/dspace-jspui/src/main/webapp/layout/navbar-minimal.jsp b/dspace-jspui/src/main/webapp/layout/navbar-minimal.jsp new file mode 100644 index 0000000000..89566aba8b --- /dev/null +++ b/dspace-jspui/src/main/webapp/layout/navbar-minimal.jsp @@ -0,0 +1,99 @@ +<%-- + + The contents of this file are subject to the license and copyright + detailed in the LICENSE and NOTICE files at the root of the source + tree and available online at + + http://www.dspace.org/license/ + +--%> +<%-- + - Default navigation bar +--%> + +<%@page import="org.apache.commons.lang.StringUtils"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> + +<%@ page contentType="text/html;charset=UTF-8" %> + +<%@ taglib uri="/WEB-INF/dspace-tags.tld" prefix="dspace" %> + +<%@ page import="java.util.ArrayList" %> +<%@ page import="java.util.List" %> +<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %> +<%@ page import="org.dspace.app.webui.util.UIUtil" %> +<%@ page import="org.dspace.content.Collection" %> +<%@ page import="org.dspace.content.Community" %> +<%@ page import="org.dspace.eperson.EPerson" %> +<%@ page import="org.dspace.core.ConfigurationManager" %> +<%@ page import="org.dspace.browse.BrowseIndex" %> +<%@ page import="org.dspace.browse.BrowseInfo" %> +<%@ page import="java.util.Map" %> +<% + // Is anyone logged in? + EPerson user = (EPerson) request.getAttribute("dspace.current.user"); + + // Is the logged in user an admin + Boolean admin = (Boolean)request.getAttribute("is.admin"); + boolean isAdmin = (admin == null ? false : admin.booleanValue()); + + // Get the current page, minus query string + String currentPage = UIUtil.getOriginalURL(request); + int c = currentPage.indexOf( '?' ); + if( c > -1 ) + { + currentPage = currentPage.substring( 0, c ); + } + + // E-mail may have to be truncated + String navbarEmail = null; + + if (user != null) + { + navbarEmail = user.getEmail(); + } +%> + + +
    + diff --git a/dspace-lni/dspace-lni-client/pom.xml b/dspace-lni/dspace-lni-client/pom.xml index a0f953710e..ce943384d9 100644 --- a/dspace-lni/dspace-lni-client/pom.xml +++ b/dspace-lni/dspace-lni-client/pom.xml @@ -11,7 +11,7 @@ org.dspace dspace-parent - 4.0-rc2-SNAPSHOT + 4.0-rc3-SNAPSHOT ../.. diff --git a/dspace-lni/pom.xml b/dspace-lni/pom.xml index 49ef3a61ce..5f2b9d2314 100644 --- a/dspace-lni/pom.xml +++ b/dspace-lni/pom.xml @@ -11,7 +11,7 @@ org.dspace dspace-parent - 4.0-rc2-SNAPSHOT + 4.0-rc3-SNAPSHOT .. diff --git a/dspace-oai/pom.xml b/dspace-oai/pom.xml index 99ad6b4cf3..7846435201 100644 --- a/dspace-oai/pom.xml +++ b/dspace-oai/pom.xml @@ -8,7 +8,7 @@ dspace-parent org.dspace - 4.0-rc2-SNAPSHOT + 4.0-rc3-SNAPSHOT .. diff --git a/dspace-rest/pom.xml b/dspace-rest/pom.xml index 01fca39b81..e229ebec4b 100644 --- a/dspace-rest/pom.xml +++ b/dspace-rest/pom.xml @@ -3,14 +3,14 @@ org.dspace dspace-rest war - 4.0-rc2-SNAPSHOT + 4.0-rc3-SNAPSHOT DSpace RESTful web services API http://demo.dspace.org org.dspace dspace-parent - 4.0-rc2-SNAPSHOT + 4.0-rc3-SNAPSHOT .. diff --git a/dspace-rest/src/main/java/org/dspace/rest/common/Collection.java b/dspace-rest/src/main/java/org/dspace/rest/common/Collection.java index e086db2482..b8e32ab91d 100644 --- a/dspace-rest/src/main/java/org/dspace/rest/common/Collection.java +++ b/dspace-rest/src/main/java/org/dspace/rest/common/Collection.java @@ -40,11 +40,7 @@ public class Collection extends DSpaceObject { //Collection-Metadata private String license; - //String provenance_description; - //String short_description; - //String introductory_text; - //String copyright_text; - //String side_bar_text; + private String copyrightText, introductoryText, shortDescription, sidebarText; //Calculated private Integer numberItems; @@ -62,6 +58,11 @@ public class Collection extends DSpaceObject { expandFields = Arrays.asList(expand.split(",")); } + this.setCopyrightText(collection.getMetadata(org.dspace.content.Collection.COPYRIGHT_TEXT)); + this.setIntroductoryText(collection.getMetadata(org.dspace.content.Collection.INTRODUCTORY_TEXT)); + this.setShortDescription(collection.getMetadata(org.dspace.content.Collection.SHORT_DESCRIPTION)); + this.setSidebarText(collection.getMetadata(org.dspace.content.Collection.SIDEBAR_TEXT)); + if(expandFields.contains("parentCommunityList") || expandFields.contains("all")) { org.dspace.content.Community[] parentCommunities = collection.getCommunities(); for(org.dspace.content.Community parentCommunity : parentCommunities) { @@ -109,6 +110,9 @@ public class Collection extends DSpaceObject { this.logo = new Bitstream(collection.getLogo(), null); } } + else { + this.addExpand("logo"); + } if(!expandFields.contains("all")) { this.addExpand("all"); @@ -164,4 +168,36 @@ public class Collection extends DSpaceObject { public void setLicense(String license) { this.license = license; } + + public String getCopyrightText() { + return copyrightText; + } + + public void setCopyrightText(String copyrightText) { + this.copyrightText = copyrightText; + } + + public String getIntroductoryText() { + return introductoryText; + } + + public void setIntroductoryText(String introductoryText) { + this.introductoryText = introductoryText; + } + + public String getShortDescription() { + return shortDescription; + } + + public void setShortDescription(String shortDescription) { + this.shortDescription = shortDescription; + } + + public String getSidebarText() { + return sidebarText; + } + + public void setSidebarText(String sidebarText) { + this.sidebarText = sidebarText; + } } diff --git a/dspace-rest/src/main/java/org/dspace/rest/common/Community.java b/dspace-rest/src/main/java/org/dspace/rest/common/Community.java index ad7e425bd6..1c13561007 100644 --- a/dspace-rest/src/main/java/org/dspace/rest/common/Community.java +++ b/dspace-rest/src/main/java/org/dspace/rest/common/Community.java @@ -58,6 +58,7 @@ public class Community extends DSpaceObject{ this.setCopyrightText(community.getMetadata(org.dspace.content.Community.COPYRIGHT_TEXT)); this.setIntroductoryText(community.getMetadata(org.dspace.content.Community.INTRODUCTORY_TEXT)); + this.setShortDescription(community.getMetadata(org.dspace.content.Community.SHORT_DESCRIPTION)); this.setSidebarText(community.getMetadata(org.dspace.content.Community.SIDEBAR_TEXT)); this.setCountItems(community.countItems()); diff --git a/dspace-services/pom.xml b/dspace-services/pom.xml index aae79a3d4e..4f855c03d2 100644 --- a/dspace-services/pom.xml +++ b/dspace-services/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 4.0-rc2-SNAPSHOT + 4.0-rc3-SNAPSHOT diff --git a/dspace-solr/pom.xml b/dspace-solr/pom.xml index 3580b05f5a..7a073e5a17 100644 --- a/dspace-solr/pom.xml +++ b/dspace-solr/pom.xml @@ -20,7 +20,7 @@ org.dspace dspace-parent - 4.0-rc2-SNAPSHOT + 4.0-rc3-SNAPSHOT .. diff --git a/dspace-sword/pom.xml b/dspace-sword/pom.xml index 16397bf044..3816afff97 100644 --- a/dspace-sword/pom.xml +++ b/dspace-sword/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 4.0-rc2-SNAPSHOT + 4.0-rc3-SNAPSHOT .. diff --git a/dspace-swordv2/pom.xml b/dspace-swordv2/pom.xml index 5ff6ba6b5b..00257ed46b 100644 --- a/dspace-swordv2/pom.xml +++ b/dspace-swordv2/pom.xml @@ -13,7 +13,7 @@ org.dspace dspace-parent - 4.0-rc2-SNAPSHOT + 4.0-rc3-SNAPSHOT .. diff --git a/dspace-xmlui/pom.xml b/dspace-xmlui/pom.xml index 4f45625bcb..e707c0fe12 100644 --- a/dspace-xmlui/pom.xml +++ b/dspace-xmlui/pom.xml @@ -11,7 +11,7 @@ org.dspace dspace-parent - 4.0-rc2-SNAPSHOT + 4.0-rc3-SNAPSHOT .. diff --git a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/discovery/AbstractSearch.java b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/discovery/AbstractSearch.java index 467488ce92..cea3a01f90 100644 --- a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/discovery/AbstractSearch.java +++ b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/discovery/AbstractSearch.java @@ -401,7 +401,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement //}// Empty query } - protected String addFilterQueriesToUrl(String pageURLMask) { + protected String addFilterQueriesToUrl(String pageURLMask) throws UIException { Map filterQueryParams = getParameterFilterQueries(); if(filterQueryParams != null) { @@ -413,7 +413,7 @@ public abstract class AbstractSearch extends AbstractDSpaceTransformer implement { for (String filterQueryValue : filterQueryValues) { - maskBuilder.append("&").append(filterQueryParam).append("=").append(filterQueryValue); + maskBuilder.append("&").append(filterQueryParam).append("=").append(encodeForURL(filterQueryValue)); } } } diff --git a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/cocoon/DSpaceCocoonServletFilter.java b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/cocoon/DSpaceCocoonServletFilter.java index ac13a1463f..b8c576fb93 100644 --- a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/cocoon/DSpaceCocoonServletFilter.java +++ b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/cocoon/DSpaceCocoonServletFilter.java @@ -9,6 +9,7 @@ package org.dspace.app.xmlui.cocoon; import java.io.File; import java.io.IOException; +import java.net.SocketException; import java.net.URL; import java.net.URLConnection; @@ -273,11 +274,18 @@ public class DSpaceCocoonServletFilter implements Filter { // invoke the next filter arg2.doFilter(realRequest, realResponse); } - - } catch (RuntimeException e) { - ContextUtil.abortContext(realRequest); - LOG.error("Serious Runtime Error Occurred Processing Request!", e); - throw e; + } catch (IOException e) { + ContextUtil.abortContext(realRequest); + if (LOG.isDebugEnabled()) { + LOG.debug("The connection was reset", e); + } + else { + LOG.error("Client closed the connection before file download was complete"); + } + } catch (RuntimeException e) { + ContextUtil.abortContext(realRequest); + LOG.error("Serious Runtime Error Occurred Processing Request!", e); + throw e; } catch (Exception e) { ContextUtil.abortContext(realRequest); LOG.error("Serious Error Occurred Processing Request!", e); diff --git a/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-nc-nd.png b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-nc-nd.png new file mode 100644 index 0000000000..49f272f828 Binary files /dev/null and b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-nc-nd.png differ diff --git a/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-nc-sa.png b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-nc-sa.png new file mode 100644 index 0000000000..0f2a0f1072 Binary files /dev/null and b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-nc-sa.png differ diff --git a/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-nc.png b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-nc.png new file mode 100644 index 0000000000..5f98214707 Binary files /dev/null and b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-nc.png differ diff --git a/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-nd.png b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-nd.png new file mode 100644 index 0000000000..8f317035e6 Binary files /dev/null and b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-nd.png differ diff --git a/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-sa.png b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-sa.png new file mode 100644 index 0000000000..f0a944e0b8 Binary files /dev/null and b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by-sa.png differ diff --git a/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by.png b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by.png new file mode 100644 index 0000000000..822491edb9 Binary files /dev/null and b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-by.png differ diff --git a/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-generic.png b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-generic.png new file mode 100644 index 0000000000..4590b0a7a0 Binary files /dev/null and b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-generic.png differ diff --git a/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-mark.png b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-mark.png new file mode 100644 index 0000000000..f1eafe1d83 Binary files /dev/null and b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-mark.png differ diff --git a/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-zero.png b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-zero.png new file mode 100644 index 0000000000..59f27f3000 Binary files /dev/null and b/dspace-xmlui/src/main/webapp/themes/Mirage/images/creativecommons/cc-zero.png differ diff --git a/dspace-xmlui/src/main/webapp/themes/Mirage/lib/xsl/aspect/artifactbrowser/item-list.xsl b/dspace-xmlui/src/main/webapp/themes/Mirage/lib/xsl/aspect/artifactbrowser/item-list.xsl index a1ae0de772..4efbc00705 100644 --- a/dspace-xmlui/src/main/webapp/themes/Mirage/lib/xsl/aspect/artifactbrowser/item-list.xsl +++ b/dspace-xmlui/src/main/webapp/themes/Mirage/lib/xsl/aspect/artifactbrowser/item-list.xsl @@ -243,7 +243,7 @@ -
    +
    diff --git a/dspace-xmlui/src/main/webapp/themes/Mirage/lib/xsl/aspect/artifactbrowser/item-view.xsl b/dspace-xmlui/src/main/webapp/themes/Mirage/lib/xsl/aspect/artifactbrowser/item-view.xsl index e0b7b3208d..1e395c0d60 100644 --- a/dspace-xmlui/src/main/webapp/themes/Mirage/lib/xsl/aspect/artifactbrowser/item-view.xsl +++ b/dspace-xmlui/src/main/webapp/themes/Mirage/lib/xsl/aspect/artifactbrowser/item-view.xsl @@ -388,7 +388,7 @@
    -
    +
    @@ -519,22 +519,29 @@ - - - - - (group) - - - (individual) - - - , - + + + administrators only + + + + + + + (group) + + + (individual) + + + , + + + - + diff --git a/dspace-xmlui/src/main/webapp/themes/Mirage/lib/xsl/core/page-structure.xsl b/dspace-xmlui/src/main/webapp/themes/Mirage/lib/xsl/core/page-structure.xsl index 5955a6bde7..d96844eaa3 100644 --- a/dspace-xmlui/src/main/webapp/themes/Mirage/lib/xsl/core/page-structure.xsl +++ b/dspace-xmlui/src/main/webapp/themes/Mirage/lib/xsl/core/page-structure.xsl @@ -485,17 +485,10 @@ alt="{$ccLicenseName}" title="{$ccLicenseName}" > - - - - - - - - - float:left; margin:0em 1em 0em 0em; border:none; - - + + + + @@ -508,6 +501,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /images/creativecommons/ + + + + + + + + + + + float:left; margin:0em 1em 0em 0em; border:none; + + + +