From f8d3c4ba592a7583bf87acde2f05385962759e66 Mon Sep 17 00:00:00 2001 From: Jose Blanco Date: Mon, 29 Jan 2024 13:31:28 -0500 Subject: [PATCH] proxy, mapping and file load fix. --- Dockerfile | 3 +- Dockerfile.test | 4 +- .../java/org/dspace/app/util/DCInput.java | 174 +-------- .../java/org/dspace/app/util/DCInputSet.java | 2 - .../org/dspace/app/util/DCInputsReader.java | 302 ++++++---------- .../app/util/SubmissionConfigReader.java | 4 +- .../java/org/dspace/content/Bitstream.java | 4 - .../dspace/content/BitstreamServiceImpl.java | 18 +- .../main/java/org/dspace/content/Bundle.java | 25 +- .../postgres/V7.6_2023.08.16__um_tables.sql | 85 ++++- .../SubmissionFormRestRepository.java | 24 +- dspace/config/spring/api/discovery.xml | 337 ++++++++++++++++-- 12 files changed, 554 insertions(+), 428 deletions(-) diff --git a/Dockerfile b/Dockerfile index f1ff6adf5ac..58cd56345bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,8 @@ ARG JDK_VERSION=11 # Step 1 - Run Maven Build -FROM dspace/dspace-dependencies:dspace-7_x as build +#FROM dspace/dspace-dependencies:dspace-7_x as build +FROM dspace/dspace-dependencies:dspace-7.6 as build ARG TARGET_DIR=dspace-installer WORKDIR /app # The dspace-installer directory will be written to /install diff --git a/Dockerfile.test b/Dockerfile.test index 4e9b2b5b434..8304f11e98e 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -10,7 +10,9 @@ ARG JDK_VERSION=11 # Step 1 - Run Maven Build -FROM dspace/dspace-dependencies:dspace-7_x as build +# UM Chnage. need to use the 7.6 dependencies because 7_x no longer uses docker. +#FROM dspace/dspace-dependencies:dspace-7_x as build +FROM dspace/dspace-dependencies:dspace-7.6 as build ARG TARGET_DIR=dspace-installer WORKDIR /app # The dspace-installer directory will be written to /install diff --git a/dspace-api/src/main/java/org/dspace/app/util/DCInput.java b/dspace-api/src/main/java/org/dspace/app/util/DCInput.java index 90bd65dcd79..6a5c624636a 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/DCInput.java +++ b/dspace-api/src/main/java/org/dspace/app/util/DCInput.java @@ -21,29 +21,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -// UM Change -import javax.servlet.http.HttpServletRequest; -import org.dspace.core.Context; -import javax.servlet.ServletException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -// For UM Changes. -import org.dspace.core.Constants; -import org.dspace.eperson.EPerson; -import java.util.UUID; -import org.dspace.content.service.CollectionService; -import org.dspace.content.factory.ContentServiceFactory; - -//UM Changes -import org.dspace.web.ContextUtil; -import org.dspace.services.RequestService; -import org.dspace.services.model.Request; -import org.dspace.utils.DSpace; -import org.dspace.services.factory.DSpaceServicesFactory; -import org.dspace.content.Collection; - /** * Class representing a line in an input form. * @@ -51,10 +28,6 @@ */ public class DCInput { - private CollectionService collectionService = - ContentServiceFactory.getInstance().getCollectionService(); - - private static final Logger log = LoggerFactory.getLogger(DCInput.class); /** @@ -205,21 +178,6 @@ public class DCInput { */ public DCInput(Map fieldMap, Map> listMap) { - // UM Change - needed for mapping and proxy depositor logic. - Context c = ContextUtil.obtainCurrentRequestContext(); - HttpServletRequest request = null; - - RequestService requestService = new DSpace().getRequestService(); - - Request currentRequest = requestService.getCurrentRequest(); - if ( currentRequest != null) - { - request = currentRequest.getHttpServletRequest(); - } - // End UM Change - - - dcElement = fieldMap.get("dc-element"); dcQualifier = fieldMap.get("dc-qualifier"); @@ -253,140 +211,10 @@ public DCInput(Map fieldMap, Map> listMap) || "list".equals(inputType)) { valueListName = fieldMap.get("value-pairs-name"); -/// As far as I can tell this does nothing. - - if ( valueListName.equals("collection_mappings") ) - { - try - { - valueList.add ( "In just DC" ); - valueList.add ( "In just DC" ); - - - // Having this here causes perfomace problems in depoist pages loading and traverssing. - //HandleService handleService = HandleServiceFactory.getInstance().getHandleService(); - //AuthorizeService authorizeService = AuthorizeServiceFactory.getInstance().getAuthorizeService(); - //ContentServiceFactory contentServiceFactory = ContentServiceFactory.getInstance(); - //List collections = contentServiceFactory.getCollectionService().findAll(c); - - String pr_collection_id = DSpaceServicesFactory.getInstance().getConfigurationService() - .getProperty("pr.collectionid"); - List collections = collectionService.findAuthorizedOptimized(c, Constants.ADD); - for (Collection t : collections) { - String handle = t.getHandle(); - if ( handle != null ) - { - //DSpaceObject coll = handleService.resolveToObject(c, handle); - //Collection coll = (Collection) handleService.resolveToObject(c, handle); - //if ( authorizeService.authorizeActionBoolean ( c, coll, Constants.ADD ) ) - //{ - String name = t.getName(); - UUID id = t.getID(); - String the_id = id.toString(); - - if ( !the_id.equals(pr_collection_id) ) - { - log.info("PROX-JustDC: Adding collections for mapping."); - - valueList.add ( name ); - valueList.add ( the_id ); - } - //} - } - } - - log.info("PROX-JustDC: DONE Adding collections for mapping."); - - valueList.add ( "None" ); - valueList.add ( "-1" ); - } - catch (Exception e) - { - log.info("PROX-JustDC: ERROR but it may be OK jose, creating collection mapping context is null."); - //Do Nothing - } - - } - - else if ( valueListName.startsWith("depositor")) - { - - try - { - - String collectionHandle = valueListName.substring(10).replace("_", "/"); - log.info ("PROX-JustDC: this is the coll=" + collectionHandle); - - valueList.add ( "In just DC" ); - valueList.add ( "In just DC" ); - - - - log.info("PROX-JustDC: Creating depositor pick list " + collectionHandle); - - //Get the eperson - EPerson e = c.getCurrentUser(); - - UUID userid = e.getID(); - - // Jim asked to remove this option. - //valueList.add ( "" ); - //valueList.add ( "" ); - - EPerson[] Proxies = e.getProxies ( c, userid, collectionHandle ); - - String nameMain = e.getFullName(); - String emailMain = e.getEmail(); - - - String labelMain = nameMain + ", " + emailMain; - valueList.add ( labelMain ); - - //valueList.add ( "SELF" ); - valueList.add ( "SELF" ); - for (int i = 0; i < Proxies.length; i++) - { - String name = Proxies[i].getFullName(); - String email = Proxies[i].getEmail(); - UUID id = Proxies[i].getID(); - - String label = name + ", " + email; - - log.info("PROX-JustDC: Adding proxies." + label + " " + id.toString()); - - valueList.add ( label ); - valueList.add ( id.toString() ); - } - - log.info("PROX-JustDC: DONE Adding proxies."); - - } - catch (Exception e) - { - log.info("PROX-JustDC: ERROR but it may be OK jose, creating the depositor picklist for proxies, request is null"); - //Do Nothing - } - } - else - { - valueList = (List) listMap.get(valueListName); - } - - - - - // The first value is how it came with 7.6. - // valueList = listMap.get(valueListName); - //valueList = (List) listMap.get(valueListName); + valueList = listMap.get(valueListName); } - - - - - - hint = fieldMap.get("hint"); warning = fieldMap.get("required"); required = warning != null && warning.length() > 0; diff --git a/dspace-api/src/main/java/org/dspace/app/util/DCInputSet.java b/dspace-api/src/main/java/org/dspace/app/util/DCInputSet.java index e5596b0c6f4..b3974645f50 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/DCInputSet.java +++ b/dspace-api/src/main/java/org/dspace/app/util/DCInputSet.java @@ -51,8 +51,6 @@ public DCInputSet(String formName, List>> rows, Map field = rows.get(i).get(j); - log.info("DC-Setup: field, listMap=" + field + "=============>" + listMap); - log.info("DC-Setup: "); inputs[i][j] = new DCInput(field, listMap); } } diff --git a/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java b/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java index 765d5445d03..783ff73f3da 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java +++ b/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java @@ -78,13 +78,11 @@ public class DCInputsReader { - private static final Logger log = LoggerFactory.getLogger(DCInputsReader.class); private CollectionService collectionService = ContentServiceFactory.getInstance().getCollectionService(); - /** * The ID of the default collection. Will never be the ID of a named * collection @@ -135,20 +133,12 @@ public DCInputsReader() String defsFile = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir") + File.separator + "config" + File.separator + FORM_DEF_FILE; -log.info("PROX: building without a filename=" + defsFile); -log.info("JOSEPROX: fileName one = " + defsFile); - buildInputs(defsFile); } public DCInputsReader(String fileName) - throws DCInputsReaderException { - -log.info("PROX: building with a filename=" + fileName); - -log.info("JOSEPROX: fileName two = " + fileName); - + throws DCInputsReaderException { buildInputs(fileName); } @@ -158,9 +148,6 @@ private void buildInputs(String fileName) formDefns = new HashMap>>>(); valuePairs = new HashMap>(); - log.info("PROX: filename of input beiong built =" + fileName); - - String uri = "file:" + new File(fileName).getAbsolutePath(); try { @@ -181,11 +168,119 @@ private void buildInputs(String fileName) } public Iterator getPairsNameIterator() { + String defsFile = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir") + + File.separator + "config" + File.separator + FORM_DEF_FILE; + return valuePairs.keySet().iterator(); } + // There is code here to support proxy deposits and collection mapping + // at ingestion. public List getPairs(String name) { - return valuePairs.get(name); + String defsFile = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir") + + File.separator + "config" + File.separator + FORM_DEF_FILE; + + // UM Change - needed for mapping and proxy depositor logic. + Context c = ContextUtil.obtainCurrentRequestContext(); + + HttpServletRequest request = null; + + RequestService requestService = new DSpace().getRequestService(); + + Request currentRequest = requestService.getCurrentRequest(); + if ( currentRequest != null) + { + log.info("PROX: curretnRequest is not null"); + request = currentRequest.getHttpServletRequest(); + } + + List myList = new ArrayList<>(); + + if (name.equals("collection_mappings")) { + try + { + String pr_collection_id = DSpaceServicesFactory.getInstance().getConfigurationService() + .getProperty("pr.collectionid"); + + List collections = collectionService.findAuthorizedOptimized(c, Constants.ADD); + for (Collection t : collections) { + String handle = t.getHandle(); + if ( handle != null ) + { + String nameUser = t.getName(); + UUID id = t.getID(); + String the_id = id.toString(); + + if ( !the_id.equals(pr_collection_id) ) + { + myList.add(nameUser); + myList.add( the_id ); + } + } + } + + } + catch (Exception exc) + { + log.info("PROX: ERROR but it may be OK, creating collection mapping context is null."); + myList.add("ERROR collmapping"); + myList.add("ERROR collmapping"); + } + } else if (name.startsWith("depositor")) { + try + { + // UM Change. + // Get the collection handle from the configuration. + // This is different from the way we did it in 6.3 + // depositor_123456789_6 + // 01234567890 + String collectionHandle = name.substring(10).replace("_", "/"); + log.info ("PROX: this is the coll=" + collectionHandle); + + if ( c.getCurrentUser() != null ) + { + //Get the eperson + EPerson ePerson = c.getCurrentUser(); + UUID userid = ePerson.getID(); + + String nameMain = ePerson.getFullName(); + String emailMain = ePerson.getEmail(); + + String labelMain = nameMain + ", " + emailMain; + + myList.add(labelMain); + myList.add("SELF"); + + + EPerson[] Proxies = ePerson.getProxies ( c, userid, collectionHandle ); + + log.info ("PROX: processing request"); + for (int k = 0; k < Proxies.length; k++) + { + String nameFull = Proxies[k].getFullName(); + String email = Proxies[k].getEmail(); + UUID id = Proxies[k].getID(); + + String label = nameFull + ", " + email; + + myList.add(label); + myList.add(id.toString()); + + } + } + } + catch (Exception exc2 ) + { + log.info("PROX: ERROR but it may be OK, creating the depositor picklist for proxies, request is null==>" + exc2.toString()); + myList.add ( "ERROR proxy depositor" ); + myList.add ( "ERROR proxy depositor" ); + } + } else { + myList = valuePairs.get(name); + } + + return myList; + } /** @@ -198,7 +293,7 @@ public List getPairs(String name) { * @throws ServletException */ public List getInputsByCollectionHandle(String collectionHandle) - throws DCInputsReaderException { + throws DCInputsReaderException { SubmissionConfig config; try { config = new SubmissionConfigReader().getSubmissionConfigByCollection(collectionHandle); @@ -251,19 +346,11 @@ public List getInputsBySubmissionName(String name) public DCInputSet getInputsByFormName(String formName) throws DCInputsReaderException { -log.info("JOSEPROX: formName = " + formName); - -// Jose - String defsFile = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("dspace.dir") + File.separator + "config" + File.separator + FORM_DEF_FILE; - - buildInputs(defsFile); - - - + // check mini-cache, and return if match // lastInputSet = null; //if (lastInputSet != null && lastInputSet.getFormName().equals(formName)) { @@ -273,7 +360,7 @@ public DCInputSet getInputsByFormName(String formName) // cache miss - construct new DCInputSet List>> pages = formDefns.get(formName); if (pages == null) { - throw new DCInputsReaderException("Missing the " + formName + " form"); + throw new DCInputsReaderException("Missing the " + formName + " form defsFile " + defsFile); } lastInputSet = new DCInputSet(formName, pages, valuePairs); @@ -598,25 +685,6 @@ private String checkForDups(String formName, Map field, List collections = collectionService.findAuthorizedOptimized(c, Constants.ADD); - for (Collection t : collections) { - String handle = t.getHandle(); - if ( handle != null ) - { - String name = t.getName(); - UUID id = t.getID(); - String the_id = id.toString(); - - if ( !the_id.equals(pr_collection_id) ) - { - log.info ("PROX: mapping this is the label=" + name); - log.info ("PROX: mapping this is the id=" + the_id); - - - pairs.add ( name ); - pairs.add ( the_id ); - } - } - } - - - } - catch (Exception exc) - { - log.info("PROX: ERROR but it may be OK, creating collection mapping context is null."); - //Do Nothing - } - }else if ( ( pairsName.startsWith("depositor") ) && ( ( c != null ) && (request != null) ) ) { - try - { - // UM Change. - // Get the collection handle from the configuration. - // This is different from the way we did it in 6.3 - // depositor_123456789_6 - // 01234567890 - String collectionHandle = pairsName.substring(10).replace("_", "/"); - log.info ("PROX: this is the coll=" + collectionHandle); - - pairs.add ( "abc" ); - pairs.add ( "-10" ); - - - pairs.add ( "def" ); - pairs.add ( "-100" ); - - pairs.add ( "ghi" ); - pairs.add ( "SELF" ); - - - - -if ( c.getCurrentUser() == null ) -{ - log.info ("PROX: current user is null"); -} -else { - - log.info ("PROX: current user is NOT null"); - -} - - - if ( c.getCurrentUser() != null ) - { - - - pairs.add ( "in the current User check" ); - pairs.add ( "current user check" ); - - //Get the eperson - EPerson ePerson = c.getCurrentUser(); - UUID userid = ePerson.getID(); - - String nameMain = ePerson.getFullName(); - String emailMain = ePerson.getEmail(); - - - String labelMain = nameMain + ", " + emailMain; - - log.info ("PROX: proxy this is the label=" + labelMain); - log.info ("PROX: proxy this is the id=" + "SELF"); - - pairs.add ( labelMain ); - pairs.add ( "SELF" ); - - EPerson[] Proxies = ePerson.getProxies ( c, userid, collectionHandle ); - - log.info ("PROX: processing request"); - for (int k = 0; k < Proxies.length; k++) - { - String name = Proxies[k].getFullName(); - String email = Proxies[k].getEmail(); - UUID id = Proxies[k].getID(); - - String label = name + ", " + email; - - log.info ("PROX: proxy this is the label=" + label); - log.info ("PROX: proxy this is the id=" + id.toString()); - - pairs.add ( label ); - pairs.add ( id.toString() ); - } - } - - } - catch (Exception exc2 ) - { - log.info("PROX: ERROR but it may be OK jose, creating the depositor picklist for proxies, request is null==>" + exc2.toString()); - //Do Nothing - pairs.add ( "test here" ); - pairs.add ( "test here value" ); - - - } - }else{ - log.info ("PROX: default this is the label=" + display); - log.info ("PROX: default this is the id=" + storage); - - pairs.add(display); - pairs.add(storage); - } - // UM Change End - + pairs.add(display); + pairs.add(storage); } // ignore any children that aren't a 'pair' } } // ignore any children that aren't a 'value-pair' @@ -904,7 +834,7 @@ private String getValue(Node nd) { } public String getInputFormNameByCollectionAndField(Collection collection, String field) - throws DCInputsReaderException { + throws DCInputsReaderException { List inputSets = getInputsByCollectionHandle(collection.getHandle()); for (DCInputSet inputSet : inputSets) { String[] tokenized = Utils.tokenize(field); diff --git a/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java b/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java index 95bf0b06105..0f144fd69f4 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java +++ b/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java @@ -240,15 +240,13 @@ public SubmissionConfig getSubmissionConfigByName(String submitName) { log.debug("Loading submission process config named '" + submitName + "'"); - lastSubmissionConfig = null; // check mini-cache, and return if match if (lastSubmissionConfig != null && lastSubmissionConfig.getSubmissionName().equals(submitName)) { log.debug("Found submission process config '" + submitName + "' in cache."); - // Don't use cache. - //return lastSubmissionConfig; + return lastSubmissionConfig; } // cache miss - construct new SubmissionConfig diff --git a/dspace-api/src/main/java/org/dspace/content/Bitstream.java b/dspace-api/src/main/java/org/dspace/content/Bitstream.java index 47c1ce5b582..91a7712eb97 100644 --- a/dspace-api/src/main/java/org/dspace/content/Bitstream.java +++ b/dspace-api/src/main/java/org/dspace/content/Bitstream.java @@ -241,10 +241,6 @@ public void setSizeBytes(long sizeBytes) { public Integer getFormatId() { return formatId; } - - public void setFormatId(Integer formatId) { - this.formatId = formatId; - } // End /** diff --git a/dspace-api/src/main/java/org/dspace/content/BitstreamServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/BitstreamServiceImpl.java index 5eb036a4bcf..edd097f1382 100644 --- a/dspace-api/src/main/java/org/dspace/content/BitstreamServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/BitstreamServiceImpl.java @@ -135,11 +135,21 @@ public Bitstream create(Context context, InputStream is) throws IOException, SQL // Set the format to "unknown" Bitstream bitstream = find(context, bitstreamID); + + log.info(LogHelper.getHeader(context, "DONE: with find create_bitstream", + "bitstream_id=" + bitstreamID)); + setFormat(context, bitstream, null); + log.info(LogHelper.getHeader(context, "DONE: with format creation", + "bitstream_id=" + bitstreamID)); + context.addEvent( new Event(Event.CREATE, Constants.BITSTREAM, bitstreamID, null, getIdentifiers(context, bitstream))); + log.info(LogHelper.getHeader(context, "DONE: with event", + "bitstream_id=" + bitstreamID)); + return bitstream; } @@ -244,10 +254,14 @@ public void setFormat(Context context, Bitstream bitstream, BitstreamFormat bits @Override public void update(Context context, Bitstream bitstream) throws SQLException, AuthorizeException { - // Check authorisation + + log.info(LogHelper.getHeader(context, "update_bitstream before the auth check", + "bitstream_id=" + bitstream.getID())); + + authorizeService.authorizeAction(context, bitstream, Constants.WRITE); - log.info(LogHelper.getHeader(context, "update_bitstream", + log.info(LogHelper.getHeader(context, "update_bitstream after the auth check", "bitstream_id=" + bitstream.getID())); super.update(context, bitstream); if (bitstream.isModified()) { diff --git a/dspace-api/src/main/java/org/dspace/content/Bundle.java b/dspace-api/src/main/java/org/dspace/content/Bundle.java index d4ee10b74b6..95f5b730f14 100644 --- a/dspace-api/src/main/java/org/dspace/content/Bundle.java +++ b/dspace-api/src/main/java/org/dspace/content/Bundle.java @@ -28,6 +28,9 @@ import org.hibernate.proxy.HibernateProxyHelper; import org.dspace.services.factory.DSpaceServicesFactory; + +import org.apache.logging.log4j.Logger; + /** * Class representing bundles of bitstreams stored in the DSpace system *

@@ -42,6 +45,9 @@ @Entity @Table(name = "bundle") public class Bundle extends DSpaceObject implements DSpaceObjectLegacySupport { + + private static Logger log = org.apache.logging.log4j.LogManager.getLogger(Bundle.class); + @Column(name = "bundle_id", insertable = false, updatable = false) private Integer legacyId; @@ -145,8 +151,22 @@ public List getBitstreams() { String hidden_format = DSpaceServicesFactory.getInstance().getConfigurationService() .getProperty("hidden.format"); - for(Bitstream bit: bitstreamList) { - if( (bit.getFormatId() != null) && (bit.getFormatId() != Integer.valueOf(hidden_format) ) ) { + // When a bitstream is first uploaded using the UI, this method gets called. At that + // moment the getFormatId() is null, but you still need to retun hte list of bistreams. + // I had some code in here that would return an empty list of bits when the format was null. + // So in this case, when in the submission form, when the user picked the 1st bitstream it + // would report an error in the load. Then when the user picked the next bit, it would + // pass, but the bitstreams being reported on the bit section was the first. It always seemd + // like we were off by one. + + + for(Bitstream bit: bitstreamList) { + // This is the case at file creation. + if( (bit.getFormatId() == null) ) + { + bitstreamsNoHiddenFiles.add(bit); + }else if (bit.getFormatId() != Integer.valueOf(hidden_format) ) + { bitstreamsNoHiddenFiles.add(bit); } } @@ -154,6 +174,7 @@ public List getBitstreams() { return bitstreamsNoHiddenFiles; } + // UM Change. I created this method in case we need it. Presently not used. public List getBitstreamsAll() { List bitstreamList = new ArrayList<>(this.bitstreams); return bitstreamList; diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2023.08.16__um_tables.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2023.08.16__um_tables.sql index 1ebae905508..976852e78ac 100644 --- a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2023.08.16__um_tables.sql +++ b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2023.08.16__um_tables.sql @@ -19,5 +19,88 @@ create table consolidatedstatstable (consolidatedstatstable_id integer NOT NULL create table individual_stats (id SERIAL PRIMARY KEY, email varchar(200), enabled varchar(10)); - create table admin_stats ( collemail varchar (200) primary key ); + + + + +create table crawlerip ( date varchar(100), ip text, site text, ipcount integer); + +create table all_ips ( ip varchar(30), hostname varchar(250), stat_date varchar(250)); +CREATE UNIQUE INDEX ip_idx ON all_ips (ip); + +create table crawlers_dspace ( ip text); + +create table rawstats ( colldt varchar (250), total_item_view integer, total_bit_view integer); + + + + +create table statsdata (item_id integer, handle varchar(250), authors text, title text, dateadded text, + numofbits integer, + display_authors text, + display_title text, + publisher text, + collid integer, + collid_uuid varchar(250), + item_uuid varchar(250)); + + +CREATE UNIQUE INDEX stats_date ON statsdata (dateadded); +CREATE UNIQUE INDEX stats_date_handle ON statsdata (handle, dateadded); +CREATE UNIQUE INDEX stats_handle_idx ON statsdata (handle); + +create table bitstreamipstatsdata +(date text, + collid varchar(250), + item_id varchar(250), + handle varchar(250), + isumip integer, + referer text, + filename text); +CREATE UNIQUE INDEX bitip_idx ON bitstreamipstatsdata (date, collid, handle, isumip); + +create table itemipstatsdata +(date text, + collid varchar(250), + item_id varchar(250), + handle varchar(250), + insideindicator integer, + isumip integer, + referer text); + +CREATE UNIQUE INDEX itemip_idx ON itemipstatsdata (date, collid, handle, isumip, insideindicator); + +create table bitspecificdata ( + collid integer, + colldt varchar(250), + handle varchar(250), + filename text, + bitum integer, + bitnonum integer, + total integer, + bitreferer text, + collid_uuid varchar(250)); + + +CREATE UNIQUE INDEX bitspecificdata_colldt_idx ON bitspecificdata (colldt); +CREATE UNIQUE INDEX bitspecificdata_handle_filename_idx ON bitspecificdata (handle, filename); +CREATE UNIQUE INDEX bitspecificdata_handle_idx ON bitspecificdata (handle); + +create table statsidanddate ( + collid integer, + colldt varchar(250), + collid_uuid varchar(250)); + + +CREATE UNIQUE INDEX stats_1 ON statsidanddate (collid_uuid); +CREATE UNIQUE INDEX stats_2 ON statsidanddate (colldt); +CREATE UNIQUE INDEX stats_3 ON statsidanddate (collid_uuid, colldt); + + + + + + + + diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionFormRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionFormRestRepository.java index 47778f5eceb..b954c5447a2 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionFormRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionFormRestRepository.java @@ -38,7 +38,6 @@ public class SubmissionFormRestRepository extends DSpaceRestRepository(); @@ -51,32 +50,17 @@ public SubmissionFormRestRepository() throws DCInputsReaderException { @Override public SubmissionFormRest findOne(Context context, String submitName) { try { - log.info("PROX: subcheck two"); - - defaultInputReader = new DCInputsReader(); - Locale[] locales = I18nUtil.getSupportedLocales(); - inputReaders = new HashMap(); - for (Locale locale : locales) { - inputReaders.put(locale, new DCInputsReader(I18nUtil.getInputFormsFileName(locale))); - } - - - Locale currentLocale = context.getCurrentLocale(); DCInputsReader inputReader = inputReaders.get(currentLocale); - - inputReader = defaultInputReader; - + if (inputReader == null) { + inputReader = defaultInputReader; + } DCInputSet subConfs = inputReader.getInputsByFormName(submitName); if (subConfs == null) { - log.info("PROX: subcheck two returning null"); return null; } - log.info("PROX: subcheck two returning a valid value"); return converter.toRest(subConfs, utils.obtainProjection()); } catch (DCInputsReaderException e) { - log.info("PROX: subcheck two error =>" + e.getMessage()); - throw new IllegalStateException(e.getMessage(), e); } } @@ -85,7 +69,6 @@ public SubmissionFormRest findOne(Context context, String submitName) { @Override public Page findAll(Context context, Pageable pageable) { try { - log.info("PROX: subcheck three"); Locale currentLocale = context.getCurrentLocale(); DCInputsReader inputReader; if (currentLocale != null) { @@ -104,7 +87,6 @@ public Page findAll(Context context, Pageable pageable) { @Override public Class getDomainClass() { - log.info("PROX: subcheck four"); return SubmissionFormRest.class; } diff --git a/dspace/config/spring/api/discovery.xml b/dspace/config/spring/api/discovery.xml index fb25f11598f..6b013a20f14 100644 --- a/dspace/config/spring/api/discovery.xml +++ b/dspace/config/spring/api/discovery.xml @@ -54,9 +54,17 @@ --> + + + + + + + + @@ -157,13 +165,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (search.resourcetype:Item AND latestVersion:true) OR search.resourcetype:Collection OR search.resourcetype:Community + -withdrawn:true AND -discoverable:false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + dc.title + dc.contributor.author + dc.creator + dc.subject + + + + + + + + + + + + + + + + + - - + + + + + + + + @@ -175,8 +346,12 @@ - - + + + + + + @@ -310,8 +485,11 @@ - - + + + + + @@ -323,8 +501,11 @@ - - + + + + + @@ -449,8 +630,11 @@ - - + + + + + @@ -462,8 +646,11 @@ - - + + + + + @@ -589,8 +776,11 @@ - - + + + + + @@ -604,8 +794,11 @@ - - + + + + + @@ -1105,8 +1298,11 @@ - - + + + + + @@ -1118,8 +1314,11 @@ - - + + + + + @@ -1175,8 +1374,11 @@ - - + + + + + @@ -1188,8 +1390,11 @@ - - + + + + + @@ -1371,13 +1576,15 @@ - + + - + + @@ -1425,13 +1632,15 @@ - + + - + + @@ -2127,7 +2336,8 @@ - + + @@ -2290,6 +2500,53 @@ + + + + + dc.description.peerreviewed + + + + + + + + + + + + + + + + dc.description.thesisdegreediscipline + + + + + + + + + + + + + + + dc.identifier.source + + + + + + + + + + + @@ -2320,11 +2577,11 @@ - - + + - dc.subject.* + dc.subject.hlbtoplevel @@ -2334,6 +2591,22 @@ + + + + + dc.subject.hlbsecondlevel + + + + + + + + + + +