diff --git a/.travis.yml b/.travis.yml
index 0581138cef..8c006d0a0f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -38,9 +38,10 @@ script:
# -P !assembly => Skip normal assembly (as it can be memory intensive)
# -B => Maven batch/non-interactive mode (recommended for CI)
# -V => Display Maven version info before build
- - "mvn clean install license:check -Dmaven.test.skip=false -DskipITs=false -P !assembly -B -V"
+ # -Dsurefire.rerunFailingTestsCount=2 => try again for flakey tests, and keep track of/report on number of retries
+ - "mvn clean install license:check -Dmaven.test.skip=false -DskipITs=false -P !assembly -B -V -Dsurefire.rerunFailingTestsCount=2"
# 2. [Assemble DSpace] Ensure assembly process works (from [src]/dspace/), including Mirage 2
# -Dmirage2.on=true => Build Mirage2
# -Dmirage2.deps.included=false => Don't include Mirage2 build dependencies (We installed them in before_install)
# -P !assembly => SKIP the actual building of [src]/dspace/dspace-installer (as it can be memory intensive)
- - "cd dspace && mvn package -Dmirage2.on=true -Dmirage2.deps.included=false -P !assembly -B -V"
+ - "cd dspace && mvn package -Dmirage2.on=true -Dmirage2.deps.included=false -P !assembly -B -V -Dsurefire.rerunFailingTestsCount=2"
diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml
index 089b98d3ed..1ce9be2d2e 100644
--- a/dspace-api/pom.xml
+++ b/dspace-api/pom.xml
@@ -12,7 +12,7 @@
org.dspace
dspace-parent
- 6.0-rc2-SNAPSHOT
+ 6.0-rc3-SNAPSHOT
..
@@ -683,13 +683,15 @@
org.apache.ws.commons.axiom
axiom-impl
- 1.2.17
+
+ 1.2.14
org.apache.ws.commons.axiom
axiom-api
- 1.2.17
+
+ 1.2.14
org.glassfish.jersey.core
diff --git a/dspace-api/src/main/java/org/apache/solr/handler/extraction/ExtractingParams.java b/dspace-api/src/main/java/org/apache/solr/handler/extraction/ExtractingParams.java
index 60d53822a2..68319795a6 100644
--- a/dspace-api/src/main/java/org/apache/solr/handler/extraction/ExtractingParams.java
+++ b/dspace-api/src/main/java/org/apache/solr/handler/extraction/ExtractingParams.java
@@ -36,7 +36,7 @@ public interface ExtractingParams {
/**
* The param prefix for mapping Tika metadata to Solr fields.
- *
+ *
* To map a field, add a name like:
*
fmap.title=solr.title
*
@@ -48,7 +48,7 @@ public interface ExtractingParams {
/**
* The boost value for the name of the field. The boost can be specified by a name mapping.
- *
+ *
* For example
*
* map.title=solr.title
@@ -73,9 +73,9 @@ public interface ExtractingParams {
* Restrict the extracted parts of a document to be indexed
* by passing in an XPath expression. All content that satisfies the XPath expr.
* will be passed to the {@link SolrContentHandler}.
- *
+ *
* See Tika's docs for what the extracted document looks like.
- *
+ *
* @see #CAPTURE_ELEMENTS
*/
public static final String XPATH_EXPRESSION = "xpath";
@@ -104,11 +104,11 @@ public interface ExtractingParams {
/**
* Capture the specified fields (and everything included below it that isn't capture by some other capture field) separately from the default. This is different
* then the case of passing in an XPath expression.
- *
+ *
* The Capture field is based on the localName returned to the {@link SolrContentHandler}
* by Tika, not to be confused by the mapped field. The field name can then
* be mapped into the index schema.
- *
+ *
* For instance, a Tika document may look like:
*
* <html>
diff --git a/dspace-api/src/main/java/org/dspace/administer/CommunityFiliator.java b/dspace-api/src/main/java/org/dspace/administer/CommunityFiliator.java
index 8e7ece9464..08f6c54aa2 100644
--- a/dspace-api/src/main/java/org/dspace/administer/CommunityFiliator.java
+++ b/dspace-api/src/main/java/org/dspace/administer/CommunityFiliator.java
@@ -46,6 +46,11 @@ public class CommunityFiliator
handleService = HandleServiceFactory.getInstance().getHandleService();
}
+ /**
+ *
+ * @param argv arguments
+ * @throws Exception if error
+ */
public static void main(String[] argv) throws Exception
{
// create an options object and populate it
@@ -174,6 +179,15 @@ public class CommunityFiliator
}
}
+ /**
+ *
+ * @param c context
+ * @param parent parent Community
+ * @param child child community
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorize error
+ * @throws IOException if IO error
+ */
public void filiate(Context c, Community parent, Community child)
throws SQLException, AuthorizeException, IOException
{
@@ -212,6 +226,15 @@ public class CommunityFiliator
+ "' is parent of community: '" + child.getID() + "'");
}
+ /**
+ *
+ * @param c context
+ * @param parent parent Community
+ * @param child child community
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorize error
+ * @throws IOException if IO error
+ */
public void defiliate(Context c, Community parent, Community child)
throws SQLException, AuthorizeException, IOException
{
@@ -250,6 +273,13 @@ public class CommunityFiliator
+ "'");
}
+ /**
+ * Find a community by ID
+ * @param c context
+ * @param communityID community ID
+ * @return Community object
+ * @throws SQLException if database error
+ */
protected Community resolveCommunity(Context c, String communityID)
throws SQLException
{
diff --git a/dspace-api/src/main/java/org/dspace/administer/CreateAdministrator.java b/dspace-api/src/main/java/org/dspace/administer/CreateAdministrator.java
index cb722769a0..b4dbb592c1 100644
--- a/dspace-api/src/main/java/org/dspace/administer/CreateAdministrator.java
+++ b/dspace-api/src/main/java/org/dspace/administer/CreateAdministrator.java
@@ -59,6 +59,7 @@ public final class CreateAdministrator
*
* @param argv
* command-line arguments
+ * @throws Exception if error
*/
public static void main(String[] argv)
throws Exception
@@ -92,7 +93,7 @@ public final class CreateAdministrator
/**
* constructor, which just creates and object with a ready context
*
- * @throws Exception
+ * @throws Exception if error
*/
protected CreateAdministrator()
throws Exception
@@ -106,7 +107,7 @@ public final class CreateAdministrator
* Method which will negotiate with the user via the command line to
* obtain the administrator's details
*
- * @throws Exception
+ * @throws Exception if error
*/
protected void negotiateAdministratorDetails()
throws Exception
@@ -228,7 +229,7 @@ public final class CreateAdministrator
* @param language preferred language
* @param pw desired password
*
- * @throws Exception
+ * @throws Exception if error
*/
protected void createAdministrator(String email, String first, String last,
String language, String pw)
diff --git a/dspace-api/src/main/java/org/dspace/administer/MetadataExporter.java b/dspace-api/src/main/java/org/dspace/administer/MetadataExporter.java
index 70529f0255..d21acc038e 100644
--- a/dspace-api/src/main/java/org/dspace/administer/MetadataExporter.java
+++ b/dspace-api/src/main/java/org/dspace/administer/MetadataExporter.java
@@ -7,19 +7,7 @@
*/
package org.dspace.administer;
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.commons.cli.PosixParser;
+import org.apache.commons.cli.*;
import org.apache.xml.serialize.Method;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
@@ -31,6 +19,14 @@ import org.dspace.content.service.MetadataSchemaService;
import org.dspace.core.Context;
import org.xml.sax.SAXException;
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
/**
* @author Graham Triggs
@@ -39,13 +35,14 @@ import org.xml.sax.SAXException;
* from the metadata schemas for the repository.
*
* The form of the XML is as follows
- *
+ * {@code
*
*
* dc
* http://dublincore.org/documents/dcmi-terms/
*
*
+ * }
*/
public class MetadataExporter
{
@@ -54,12 +51,12 @@ public class MetadataExporter
protected static MetadataFieldService metadataFieldService = ContentServiceFactory.getInstance().getMetadataFieldService();
/**
- * @param args
- * @throws ParseException
- * @throws SAXException
- * @throws IOException
- * @throws SQLException
- * @throws RegistryExportException
+ * @param args commandline arguments
+ * @throws ParseException if parser error
+ * @throws SAXException if XML parse error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws RegistryExportException if export error
*/
public static void main(String[] args) throws ParseException, SQLException, IOException, SAXException, RegistryExportException
{
@@ -91,6 +88,15 @@ public class MetadataExporter
saveRegistry(file, schema);
}
+ /**
+ * Save a registry to a filepath
+ * @param file filepath
+ * @param schema schema definition to save
+ * @throws SQLException if database error
+ * @throws IOException if IO error
+ * @throws SAXException if XML error
+ * @throws RegistryExportException if export error
+ */
public static void saveRegistry(String file, String schema) throws SQLException, IOException, SAXException, RegistryExportException
{
// create a context
@@ -145,12 +151,12 @@ public class MetadataExporter
/**
* Serialize the schema registry. If the parameter 'schema' is null or empty, save all schemas
- * @param context
- * @param xmlSerializer
- * @param schema
- * @throws SQLException
- * @throws SAXException
- * @throws RegistryExportException
+ * @param context DSpace Context
+ * @param xmlSerializer XML serializer
+ * @param schema schema (may be null to save all)
+ * @throws SQLException if database error
+ * @throws SAXException if XML error
+ * @throws RegistryExportException if export error
*/
public static void saveSchema(Context context, XMLSerializer xmlSerializer, String schema) throws SQLException, SAXException, RegistryExportException
{
@@ -176,10 +182,10 @@ public class MetadataExporter
/**
* Serialize a single schema (namespace) registry entry
*
- * @param xmlSerializer
- * @param mdSchema
- * @throws SAXException
- * @throws RegistryExportException
+ * @param xmlSerializer XML serializer
+ * @param mdSchema DSpace metadata schema
+ * @throws SAXException if XML error
+ * @throws RegistryExportException if export error
*/
private static void saveSchema(XMLSerializer xmlSerializer, MetadataSchema mdSchema) throws SAXException, RegistryExportException
{
@@ -223,13 +229,13 @@ public class MetadataExporter
/**
* Serialize a single metadata field registry entry to xml
*
- * @param context
- * @param xmlSerializer
- * @param mdField
- * @throws SAXException
- * @throws RegistryExportException
- * @throws SQLException
- * @throws IOException
+ * @param context DSpace context
+ * @param xmlSerializer xml serializer
+ * @param mdField DSpace metadata field
+ * @throws SAXException if XML error
+ * @throws RegistryExportException if export error
+ * @throws SQLException if database error
+ * @throws IOException if IO error
*/
private static void saveType(Context context, XMLSerializer xmlSerializer, MetadataField mdField) throws SAXException, RegistryExportException, SQLException, IOException
{
@@ -291,24 +297,29 @@ public class MetadataExporter
xmlSerializer.endElement("dc-type");
}
+ static Map schemaMap = new HashMap();
/**
* Helper method to retrieve a schema name for the field.
* Caches the name after looking up the id.
+ * @param context DSpace Context
+ * @param mdField DSpace metadata field
+ * @return name of schema
+ * @throws SQLException if database error
+ * @throws RegistryExportException if export error
*/
- static Map schemaMap = new HashMap();
private static String getSchemaName(Context context, MetadataField mdField) throws SQLException, RegistryExportException
{
// Get name from cache
- String name = schemaMap.get(mdField.getMetadataSchema().getSchemaID());
+ String name = schemaMap.get(mdField.getMetadataSchema().getID());
if (name == null)
{
// Name not retrieved before, so get the schema now
- MetadataSchema mdSchema = metadataSchemaService.find(context, mdField.getMetadataSchema().getSchemaID());
+ MetadataSchema mdSchema = metadataSchemaService.find(context, mdField.getMetadataSchema().getID());
if (mdSchema != null)
{
name = mdSchema.getName();
- schemaMap.put(mdSchema.getSchemaID(), name);
+ schemaMap.put(mdSchema.getID(), name);
}
else
{
diff --git a/dspace-api/src/main/java/org/dspace/administer/MetadataImporter.java b/dspace-api/src/main/java/org/dspace/administer/MetadataImporter.java
index 490301fb26..1e1882d7ae 100644
--- a/dspace-api/src/main/java/org/dspace/administer/MetadataImporter.java
+++ b/dspace-api/src/main/java/org/dspace/administer/MetadataImporter.java
@@ -47,6 +47,7 @@ import org.xml.sax.SAXException;
*
* The format of the XML file is as follows:
*
+ * {@code
*
*
* icadmin
@@ -58,6 +59,7 @@ import org.xml.sax.SAXException;
* [....]
*
*
+ * }
*/
public class MetadataImporter
{
@@ -67,9 +69,19 @@ public class MetadataImporter
/** logging category */
private static final Logger log = LoggerFactory.getLogger(MetadataImporter.class);
- /**
- * main method for reading user input from the command line
- */
+ /**
+ * main method for reading user input from the command line
+ * @param args arguments
+ * @throws ParseException if parse error
+ * @throws SQLException if database error
+ * @throws IOException if IO error
+ * @throws TransformerException if transformer error
+ * @throws ParserConfigurationException if config error
+ * @throws AuthorizeException if authorization error
+ * @throws SAXException if parser error
+ * @throws NonUniqueMetadataException if duplicate metadata
+ * @throws RegistryImportException if import fails
+ **/
public static void main(String[] args)
throws ParseException, SQLException, IOException, TransformerException,
ParserConfigurationException, AuthorizeException, SAXException,
@@ -103,6 +115,15 @@ public class MetadataImporter
* Load the data from the specified file path into the database
*
* @param file the file path containing the source data
+ * @param forceUpdate whether to force update
+ * @throws SQLException if database error
+ * @throws IOException if IO error
+ * @throws TransformerException if transformer error
+ * @throws ParserConfigurationException if config error
+ * @throws AuthorizeException if authorization error
+ * @throws SAXException if parser error
+ * @throws NonUniqueMetadataException if duplicate metadata
+ * @throws RegistryImportException if import fails
*/
public static void loadRegistry(String file, boolean forceUpdate)
throws SQLException, IOException, TransformerException, ParserConfigurationException,
@@ -158,7 +179,12 @@ public class MetadataImporter
* DSpace context object
* @param node
* the node in the DOM tree
- * @throws NonUniqueMetadataException
+ * @throws SQLException if database error
+ * @throws IOException if IO error
+ * @throws TransformerException if transformer error
+ * @throws AuthorizeException if authorization error
+ * @throws NonUniqueMetadataException if duplicate metadata
+ * @throws RegistryImportException if import fails
*/
private static void loadSchema(Context context, Node node, boolean updateExisting)
throws SQLException, IOException, TransformerException,
@@ -221,7 +247,12 @@ public class MetadataImporter
* DSpace context object
* @param node
* the node in the DOM tree
- * @throws NonUniqueMetadataException
+ * @throws SQLException if database error
+ * @throws IOException if IO error
+ * @throws TransformerException if transformer error
+ * @throws AuthorizeException if authorization error
+ * @throws NonUniqueMetadataException if duplicate metadata
+ * @throws RegistryImportException if import fails
*/
private static void loadType(Context context, Node node)
throws SQLException, IOException, TransformerException,
diff --git a/dspace-api/src/main/java/org/dspace/administer/RegistryExportException.java b/dspace-api/src/main/java/org/dspace/administer/RegistryExportException.java
index 5f2ea7e227..d40a11ec19 100644
--- a/dspace-api/src/main/java/org/dspace/administer/RegistryExportException.java
+++ b/dspace-api/src/main/java/org/dspace/administer/RegistryExportException.java
@@ -25,7 +25,7 @@ public class RegistryExportException extends Exception
/**
* create an exception with only a message
*
- * @param message
+ * @param message exception message
*/
public RegistryExportException(String message)
{
@@ -35,8 +35,8 @@ public class RegistryExportException extends Exception
/**
* create an exception with an inner exception and a message
*
- * @param message
- * @param e
+ * @param message exception message
+ * @param e reference to Throwable
*/
public RegistryExportException(String message, Throwable e)
{
@@ -46,7 +46,7 @@ public class RegistryExportException extends Exception
/**
* create an exception with an inner exception
*
- * @param e
+ * @param e reference to Throwable
*/
public RegistryExportException(Throwable e)
{
diff --git a/dspace-api/src/main/java/org/dspace/administer/RegistryImportException.java b/dspace-api/src/main/java/org/dspace/administer/RegistryImportException.java
index b49bc4111b..5a15631dfb 100644
--- a/dspace-api/src/main/java/org/dspace/administer/RegistryImportException.java
+++ b/dspace-api/src/main/java/org/dspace/administer/RegistryImportException.java
@@ -25,7 +25,7 @@ public class RegistryImportException extends Exception
/**
* create an exception with only a message
*
- * @param message
+ * @param message error message
*/
public RegistryImportException(String message)
{
@@ -35,8 +35,8 @@ public class RegistryImportException extends Exception
/**
* create an exception with an inner exception and a message
*
- * @param message
- * @param e
+ * @param message error message
+ * @param e throwable
*/
public RegistryImportException(String message, Throwable e)
{
@@ -46,7 +46,7 @@ public class RegistryImportException extends Exception
/**
* create an exception with an inner exception
*
- * @param e
+ * @param e throwable
*/
public RegistryImportException(Throwable e)
{
diff --git a/dspace-api/src/main/java/org/dspace/administer/RegistryImporter.java b/dspace-api/src/main/java/org/dspace/administer/RegistryImporter.java
index 6f34eae3cd..b8a7c2456a 100644
--- a/dspace-api/src/main/java/org/dspace/administer/RegistryImporter.java
+++ b/dspace-api/src/main/java/org/dspace/administer/RegistryImporter.java
@@ -40,6 +40,9 @@ public class RegistryImporter
* the filename to load from
*
* @return the DOM representation of the XML file
+ * @throws IOException if IO error
+ * @throws ParserConfigurationException if configuration parse error
+ * @throws SAXException if XML parse error
*/
public static Document loadXML(String filename)
throws IOException, ParserConfigurationException, SAXException
@@ -68,7 +71,7 @@ public class RegistryImporter
* the element, whose child element you want the CDATA from
* @param childName
* the name of the element you want the CDATA from
- *
+ * @throws TransformerException if error
* @return the CDATA as a String
*/
public static String getElementData(Node parentElement, String childName)
@@ -116,7 +119,7 @@ public class RegistryImporter
* the element, whose child element you want the CDATA from
* @param childName
* the name of the element you want the CDATA from
- *
+ * @throws TransformerException if error
* @return the CDATA as a String
*/
public static String[] getRepeatedElementData(Node parentElement,
diff --git a/dspace-api/src/main/java/org/dspace/administer/RegistryLoader.java b/dspace-api/src/main/java/org/dspace/administer/RegistryLoader.java
index 3246506c7e..092a61e145 100644
--- a/dspace-api/src/main/java/org/dspace/administer/RegistryLoader.java
+++ b/dspace-api/src/main/java/org/dspace/administer/RegistryLoader.java
@@ -56,6 +56,7 @@ public class RegistryLoader
*
* @param argv
* command-line arguments
+ * @throws Exception if error
*/
public static void main(String[] argv) throws Exception
{
@@ -121,6 +122,12 @@ public class RegistryLoader
* DSpace context object
* @param filename
* the filename of the XML file to load
+ * @throws SQLException if database error
+ * @throws IOException if IO error
+ * @throws TransformerException if transformer error
+ * @throws ParserConfigurationException if config error
+ * @throws AuthorizeException if authorization error
+ * @throws SAXException if parser error
*/
public static void loadBitstreamFormats(Context context, String filename)
throws SQLException, IOException, ParserConfigurationException,
@@ -151,6 +158,10 @@ public class RegistryLoader
* DSpace context object
* @param node
* the node in the DOM tree
+ * @throws SQLException if database error
+ * @throws IOException if IO error
+ * @throws TransformerException if transformer error
+ * @throws AuthorizeException if authorization error
*/
private static void loadFormat(Context context, Node node)
throws SQLException, IOException, TransformerException,
@@ -206,7 +217,9 @@ public class RegistryLoader
*
* @param filename
* the filename to load from
- *
+ * @throws IOException if IO error
+ * @throws ParserConfigurationException if config error
+ * @throws SAXException if parser error
* @return the DOM representation of the XML file
*/
private static Document loadXML(String filename) throws IOException,
@@ -234,7 +247,7 @@ public class RegistryLoader
* the element, whose child element you want the CDATA from
* @param childName
* the name of the element you want the CDATA from
- *
+ * @throws TransformerException if transformer error
* @return the CDATA as a String
*/
private static String getElementData(Node parentElement, String childName)
@@ -282,7 +295,7 @@ public class RegistryLoader
* the element, whose child element you want the CDATA from
* @param childName
* the name of the element you want the CDATA from
- *
+ * @throws TransformerException if transformer error
* @return the CDATA as a String
*/
private static String[] getRepeatedElementData(Node parentElement,
diff --git a/dspace-api/src/main/java/org/dspace/administer/StructBuilder.java b/dspace-api/src/main/java/org/dspace/administer/StructBuilder.java
index 5ee16eee38..e90d4ae962 100644
--- a/dspace-api/src/main/java/org/dspace/administer/StructBuilder.java
+++ b/dspace-api/src/main/java/org/dspace/administer/StructBuilder.java
@@ -46,7 +46,7 @@ import org.xml.sax.SAXException;
* an XML file.
*
* The XML file structure needs to be:
- *
+ * {@code
*
*
* ....
@@ -56,7 +56,7 @@ import org.xml.sax.SAXException;
*
*
*
- *
+ * }
* it can be arbitrarily deep, and supports all the metadata elements
* that make up the community and collection metadata. See the system
* documentation for more details
@@ -88,10 +88,12 @@ public class StructBuilder
*
* This is of the form:
*
- * StructBuilder -f [xml source] -e [administrator email] -o [output file]
+ * {@code StructBuilder -f [xml source] -e [administrator email] -o [output file]}
*
* The output file will contain exactly the same as the source xml document, but
* with the handle for each imported item added as an attribute.
+ * @param argv commandline arguments
+ * @throws Exception if an error occurs
*/
public static void main(String[] argv)
throws Exception
@@ -203,7 +205,7 @@ public class StructBuilder
* fails it generates an error and ceases execution
*
* @param document the XML document object
- * @throws TransformerException
+ * @throws TransformerException if transformer error
*
*/
private static void validate(org.w3c.dom.Document document)
diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSVLine.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSVLine.java
index b71f7c7c24..d8d793f063 100644
--- a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSVLine.java
+++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSVLine.java
@@ -150,7 +150,7 @@ public class DSpaceCSVLine implements Serializable
* Write this line out as a CSV formatted string, in the order given by the headings provided
*
* @param headings The headings which define the order the elements must be presented in
- * @param fieldSeparator
+ * @param fieldSeparator field separator
* @return The CSV formatted String
*/
protected String toCSV(List headings, String fieldSeparator)
@@ -179,7 +179,7 @@ public class DSpaceCSVLine implements Serializable
* Internal method to create a CSV formatted String joining a given set of elements
*
* @param values The values to create the string from
- * @param valueSeparator
+ * @param valueSeparator value separator
* @return The line as a CSV formatted String
*/
protected String valueToCSV(List values, String valueSeparator)
diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataExport.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataExport.java
index cb79723370..319535b003 100644
--- a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataExport.java
+++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataExport.java
@@ -71,7 +71,7 @@ public class MetadataExport
try
{
// Try to export the community
- this.toExport = buildFromCommunity(c, toExport, new ArrayList(), 0);
+ this.toExport = buildFromCommunity(c, toExport, 0);
this.exportAll = exportAll;
}
catch (SQLException sqle)
@@ -86,13 +86,13 @@ public class MetadataExport
/**
* Build an array list of item ids that are in a community (include sub-communities and collections)
*
+ * @param context DSpace context
* @param community The community to build from
- * @param itemIDs The itemID (used for recursion - use an empty ArrayList)
* @param indent How many spaces to use when writing out the names of items added
* @return The list of item ids
- * @throws SQLException
+ * @throws SQLException if database error
*/
- protected Iterator- buildFromCommunity(Context context, Community community, List itemIDs, int indent)
+ protected Iterator
- buildFromCommunity(Context context, Community community, int indent)
throws SQLException
{
// Add all the collections
@@ -106,12 +106,7 @@ public class MetadataExport
}
Iterator
- items = itemService.findByCollection(context, collection);
- if(result == null)
- {
- result = items;
- }else{
- result = Iterators.concat(result, items);
- }
+ result = addItemsToResult(result,items);
}
// Add all the sub-communities
@@ -122,7 +117,19 @@ public class MetadataExport
{
System.out.print(" ");
}
- buildFromCommunity(context, subCommunity, itemIDs, indent + 1);
+ Iterator
- items = buildFromCommunity(context, subCommunity, indent + 1);
+ result = addItemsToResult(result,items);
+ }
+
+ return result;
+ }
+
+ private Iterator
- addItemsToResult(Iterator
- result, Iterator
- items) {
+ if(result == null)
+ {
+ result = items;
+ }else{
+ result = Iterators.concat(result, items);
}
return result;
@@ -176,6 +183,7 @@ public class MetadataExport
* main method to run the metadata exporter
*
* @param argv the command line arguments given
+ * @throws Exception if error occurs
*/
public static void main(String[] argv) throws Exception
{
diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java
index 323305fa23..82598b1c2e 100644
--- a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java
+++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java
@@ -420,8 +420,7 @@ public class MetadataImport
* @param change Whether or not to make the update
* @param md The element to compare
* @param changes The changes object to populate
- *
- * @param line
+ * @param line line in CSV file
* @throws SQLException if there is a problem accessing a Collection from the database, from its handle
* @throws AuthorizeException if there is an authorization problem with permissions
*/
diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImportInvalidHeadingException.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImportInvalidHeadingException.java
index c1eb0db0d5..0ee4980909 100644
--- a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImportInvalidHeadingException.java
+++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImportInvalidHeadingException.java
@@ -41,6 +41,7 @@ public class MetadataImportInvalidHeadingException extends Exception
*
* @param message the error message
* @param theType the type of the error
+ * @param theColumn column number
*/
public MetadataImportInvalidHeadingException(String message, int theType, int theColumn)
{
diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/package-info.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/package-info.java
index 5393ca8aa1..2a55f9cbd3 100644
--- a/dspace-api/src/main/java/org/dspace/app/bulkedit/package-info.java
+++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/package-info.java
@@ -9,7 +9,6 @@
/**
*
The DSpace Batch Metadata Editor, which uses a CSV file to export/import
* item metadata.
- *
*
* - works on items, communities, collections or the whole site
* - can also create new items, delete items and withdraw/restore them
diff --git a/dspace-api/src/main/java/org/dspace/app/checker/ChecksumChecker.java b/dspace-api/src/main/java/org/dspace/app/checker/ChecksumChecker.java
index bdfc7a34f5..df8b1eddbf 100644
--- a/dspace-api/src/main/java/org/dspace/app/checker/ChecksumChecker.java
+++ b/dspace-api/src/main/java/org/dspace/app/checker/ChecksumChecker.java
@@ -29,7 +29,7 @@ import org.dspace.core.Utils;
/**
* Command line access to the checksum checker. Options are listed in the
- * documentation for the main method.
+ * documentation for the main method.
*
* @author Jim Downing
* @author Grace Carpenter
@@ -72,6 +72,7 @@ public final class ChecksumChecker
* -p
* Don't prune results before running checker
*
+ * @throws SQLException if error
*/
public static void main(String[] args) throws SQLException {
// set up command line parser
diff --git a/dspace-api/src/main/java/org/dspace/app/harvest/Harvest.java b/dspace-api/src/main/java/org/dspace/app/harvest/Harvest.java
index c1e809e68c..3e74bc12e7 100644
--- a/dspace-api/src/main/java/org/dspace/app/harvest/Harvest.java
+++ b/dspace-api/src/main/java/org/dspace/app/harvest/Harvest.java
@@ -390,7 +390,8 @@ public class Harvest
hc.setHarvestStartTime(null);
harvestedCollectionService.update(context, hc);
}
- context.restoreAuthSystemState();
+ context.restoreAuthSystemState();
+ context.dispatchEvents();
}
catch (Exception e) {
System.out.println("Changes could not be committed");
diff --git a/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExportCLITool.java b/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExportCLITool.java
index 6c94a462ed..9ed24ba433 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExportCLITool.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExportCLITool.java
@@ -34,8 +34,8 @@ import java.util.*;
* core in RDF schema / contents - text file, listing one file per line / file1
* - files contained in the item / file2 / ...
*
- * issues -doesn't handle special characters in metadata (needs to turn &'s into
- * &, etc.)
+ * issues -doesn't handle special characters in metadata (needs to turn {@code &'s} into
+ * {@code &}, etc.)
*
* Modified by David Little, UCSD Libraries 12/21/04 to allow the registration
* of files (bitstreams) into DSpace.
diff --git a/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExportServiceImpl.java b/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExportServiceImpl.java
index 39e86e2c9e..28181e6ea0 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExportServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemexport/ItemExportServiceImpl.java
@@ -57,8 +57,8 @@ import org.springframework.beans.factory.annotation.Autowired;
* core in RDF schema / contents - text file, listing one file per line / file1
* - files contained in the item / file2 / ...
*
- * issues -doesn't handle special characters in metadata (needs to turn &'s into
- * &, etc.)
+ * issues -doesn't handle special characters in metadata (needs to turn {@code &'s} into
+ * {@code &}, etc.)
*
* Modified by David Little, UCSD Libraries 12/21/04 to allow the registration
* of files (bitstreams) into DSpace.
@@ -180,10 +180,11 @@ public class ItemExportServiceImpl implements ItemExportService
* Discover the different schemas in use and output a separate metadata XML
* file for each schema.
*
- * @param c
- * @param i
- * @param destDir
- * @throws Exception
+ * @param c DSpace context
+ * @param i DSpace Item
+ * @param destDir destination directory
+ * @param migrate Whether to use the migrate option or not
+ * @throws Exception if error
*/
protected void writeMetadata(Context c, Item i, File destDir, boolean migrate)
throws Exception
@@ -202,7 +203,15 @@ public class ItemExportServiceImpl implements ItemExportService
}
}
- // output the item's dublin core into the item directory
+ /**
+ * output the item's dublin core into the item directory
+ * @param c DSpace context
+ * @param schema schema
+ * @param i DSpace Item
+ * @param destDir destination directory
+ * @param migrate Whether to use the migrate option or not
+ * @throws Exception if error
+ */
protected void writeMetadata(Context c, String schema, Item i,
File destDir, boolean migrate) throws Exception
{
@@ -318,7 +327,13 @@ public class ItemExportServiceImpl implements ItemExportService
}
}
- // create the file 'handle' which contains the handle assigned to the item
+ /**
+ * create the file 'handle' which contains the handle assigned to the item
+ * @param c DSpace Context
+ * @param i DSpace Item
+ * @param destDir destination directory
+ * @throws Exception if error
+ */
protected void writeHandle(Context c, Item i, File destDir)
throws Exception
{
@@ -358,7 +373,9 @@ public class ItemExportServiceImpl implements ItemExportService
* the item being exported
* @param destDir
* the item's export directory
- * @throws Exception
+ * @param excludeBitstreams
+ * whether to exclude bitstreams
+ * @throws Exception if error
* if there is any problem writing to the export directory
*/
protected void writeBitstreams(Context c, Item i, File destDir,
@@ -531,7 +548,8 @@ public class ItemExportServiceImpl implements ItemExportService
* - the dspace context
* @param additionalEmail
* - email address to cc in addition the the current user email
- * @throws Exception
+ * @param toMigrate Whether to use the migrate option or not
+ * @throws Exception if error
*/
protected void processDownloadableExport(List dsObjects,
Context context, final String additionalEmail, boolean toMigrate) throws Exception
@@ -808,7 +826,7 @@ public class ItemExportServiceImpl implements ItemExportService
"A dspace.cfg entry for 'org.dspace.app.itemexport.download.dir' does not exist.");
}
File result = new File(downloadDir + System.getProperty("file.separator") + ePerson.getID());
- if(!result.exists())
+ if(!result.exists() && ePerson.getLegacyId()!=null)
{
//Check for the old identifier
result = new File(downloadDir + System.getProperty("file.separator") + ePerson.getLegacyId());
@@ -868,6 +886,13 @@ public class ItemExportServiceImpl implements ItemExportService
return file.length();
}
+ /**
+ * Attempt to find an EPerson based on string ID
+ * @param context DSpace context
+ * @param strID string identifier
+ * @return EPerson object (if found)
+ * @throws SQLException if database error
+ */
protected EPerson getEPersonFromString(Context context, String strID) throws SQLException {
EPerson eperson;
try{
@@ -1105,6 +1130,14 @@ public class ItemExportServiceImpl implements ItemExportService
}
}
+ /**
+ *
+ * @param cpFile file
+ * @param strSource source location
+ * @param strTarget target location
+ * @param cpZipOutputStream current zip outputstream
+ * @throws Exception if error
+ */
protected void zipFiles(File cpFile, String strSource,
String strTarget, ZipOutputStream cpZipOutputStream)
throws Exception
@@ -1158,6 +1191,11 @@ public class ItemExportServiceImpl implements ItemExportService
}
}
+ /**
+ * Delete a directory
+ * @param path directory path
+ * @return true if successful, false otherwise
+ */
protected boolean deleteDirectory(File path)
{
if (path.exists())
diff --git a/dspace-api/src/main/java/org/dspace/app/itemexport/service/ItemExportService.java b/dspace-api/src/main/java/org/dspace/app/itemexport/service/ItemExportService.java
index 141bc8e3db..e93a2f22b2 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemexport/service/ItemExportService.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemexport/service/ItemExportService.java
@@ -30,8 +30,8 @@ import java.util.List;
* core in RDF schema / contents - text file, listing one file per line / file1
* - files contained in the item / file2 / ...
*
- * issues -doesn't handle special characters in metadata (needs to turn &'s into
- * &, etc.)
+ * issues -doesn't handle special characters in metadata (needs to turn {@code &'s} into
+ * {@code &}, etc.)
*
* Modified by David Little, UCSD Libraries 12/21/04 to allow the registration
* of files (bitstreams) into DSpace.
@@ -59,7 +59,8 @@ public interface ItemExportService {
* @param zipFileName The name to save the zip file as
* @param seqStart The first number in the sequence
* @param migrate Whether to use the migrate option or not
- * @throws Exception
+ * @param excludeBitstreams Whether to exclude bitstreams or not
+ * @throws Exception if error
*/
public void exportAsZip(Context context, Iterator- items,
String destDirName, String zipFileName,
@@ -74,7 +75,8 @@ public interface ItemExportService {
* - the dspace object to export
* @param context
* - the dspace context
- * @throws Exception
+ * @param migrate Whether to use the migrate option or not
+ * @throws Exception if error
*/
public void createDownloadableExport(DSpaceObject dso,
Context context, boolean migrate) throws Exception;
@@ -87,7 +89,8 @@ public interface ItemExportService {
* - List containing dspace objects
* @param context
* - the dspace context
- * @throws Exception
+ * @param migrate Whether to use the migrate option or not
+ * @throws Exception if error
*/
public void createDownloadableExport(List dsObjects,
Context context, boolean migrate) throws Exception;
@@ -102,7 +105,8 @@ public interface ItemExportService {
* - the dspace context
* @param additionalEmail
* - cc email to use
- * @throws Exception
+ * @param migrate Whether to use the migrate option or not
+ * @throws Exception if error
*/
public void createDownloadableExport(DSpaceObject dso,
Context context, String additionalEmail, boolean migrate) throws Exception;
@@ -117,7 +121,8 @@ public interface ItemExportService {
* - the dspace context
* @param additionalEmail
* - cc email to use
- * @throws Exception
+ * @param migrate Whether to use the migrate option or not
+ * @throws Exception if error
*/
public void createDownloadableExport(List dsObjects,
Context context, String additionalEmail, boolean migrate) throws Exception;
@@ -126,13 +131,14 @@ public interface ItemExportService {
/**
* Create a file name based on the date and eperson
*
+ * @param type Type of object (as string)
* @param eperson
* - eperson who requested export and will be able to download it
* @param date
* - the date the export process was created
* @return String representing the file name in the form of
* 'export_yyy_MMM_dd_count_epersonID'
- * @throws Exception
+ * @throws Exception if error
*/
public String assembleFileName(String type, EPerson eperson,
Date date) throws Exception;
@@ -146,7 +152,7 @@ public interface ItemExportService {
* - the eperson who requested export archive
* @return String representing a directory in the form of
* org.dspace.app.itemexport.download.dir/epersonID
- * @throws Exception
+ * @throws Exception if error
*/
public String getExportDownloadDirectory(EPerson ePerson)
throws Exception;
@@ -157,7 +163,7 @@ public interface ItemExportService {
*
* @return String representing config file entry for
* org.dspace.app.itemexport.work.dir
- * @throws Exception
+ * @throws Exception if error
*/
public String getExportWorkDirectory() throws Exception;
@@ -169,7 +175,7 @@ public interface ItemExportService {
* @param eperson
* the eperson requesting the download
* @return an input stream of the file to be downloaded
- * @throws Exception
+ * @throws Exception if error
*/
public InputStream getExportDownloadInputStream(String fileName,
EPerson eperson) throws Exception;
@@ -177,12 +183,24 @@ public interface ItemExportService {
/**
* Get the file size of the export archive represented by the file name.
*
+ * @param context DSpace context
* @param fileName
* name of the file to get the size.
- * @throws Exception
+ * @throws Exception if error
+ * @return size as long
*/
public long getExportFileSize(Context context, String fileName) throws Exception;
+ /**
+ * Get the last modified date of the export archive represented by the file name.
+ *
+ * @param context DSpace context
+ * @param fileName
+ * name of the file to get the size.
+ * @return date as long
+ * @see java.io.File#lastModified()
+ * @throws Exception if error
+ */
public long getExportFileLastModified(Context context, String fileName)
throws Exception;
@@ -203,10 +221,10 @@ public interface ItemExportService {
* Reads the download directory for the eperson to see if any export
* archives are available
*
- * @param eperson
+ * @param eperson EPerson object
* @return a list of file names representing export archives that have been
* processed
- * @throws Exception
+ * @throws Exception if error
*/
public List getExportsAvailable(EPerson eperson)
throws Exception;
@@ -218,7 +236,7 @@ public interface ItemExportService {
*
* @param eperson
* - the eperson to clean up
- * @throws Exception
+ * @throws Exception if error
*/
public void deleteOldExportArchives(EPerson eperson) throws Exception;
@@ -228,7 +246,7 @@ public interface ItemExportService {
* determine if the current exports are too old and need purgeing
* Removes all old exports, not just those for the person doing the export.
*
- * @throws Exception
+ * @throws Exception if error
*/
public void deleteOldExportArchives() throws Exception;
@@ -245,7 +263,7 @@ public interface ItemExportService {
* @param fileName
* - the file name to be downloaded. It is added to the url in
* the email
- * @throws MessagingException
+ * @throws MessagingException if error
*/
public void emailSuccessMessage(Context context, EPerson eperson,
String fileName) throws MessagingException;
@@ -260,11 +278,17 @@ public interface ItemExportService {
* - EPerson to send the error message to
* @param error
* - the error message
- * @throws MessagingException
+ * @throws MessagingException if error
*/
public void emailErrorMessage(EPerson eperson, String error)
throws MessagingException;
+ /**
+ * Zip source to target
+ * @param strSource source file
+ * @param target target file
+ * @throws Exception if error
+ */
public void zip(String strSource, String target) throws Exception;
}
diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/BTEBatchImportService.java b/dspace-api/src/main/java/org/dspace/app/itemimport/BTEBatchImportService.java
index 1513eaecf4..df2a63eaa9 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemimport/BTEBatchImportService.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemimport/BTEBatchImportService.java
@@ -20,7 +20,7 @@ import java.util.Map;
/**
- * This class acts as a Service in the procedure ot batch import using the Biblio-Transformation-Engine
+ * This class acts as a Service in the procedure to batch import using the Biblio-Transformation-Engine
*/
public class BTEBatchImportService
{
@@ -39,7 +39,7 @@ public class BTEBatchImportService
/**
* Setter method for dataLoaders parameter
- * @param dataLoaders
+ * @param dataLoaders map of data loaders
*/
public void setDataLoaders(Map dataLoaders)
{
@@ -47,7 +47,7 @@ public class BTEBatchImportService
}
/**
- *
+ * Get data loaders
* @return the map of DataLoaders
*/
public Map getDataLoaders()
@@ -56,7 +56,7 @@ public class BTEBatchImportService
}
/**
- *
+ * Get output map
* @return the outputMapping
*/
public Map getOutputMap() {
@@ -65,20 +65,32 @@ public class BTEBatchImportService
/**
* Setter method for the outputMapping
- * @param outputMapping
+ * @param outputMap the output mapping
*/
public void setOutputMap(Map outputMap) {
this.outputMap = outputMap;
}
+ /**
+ * Get transformation engine
+ * @return transformation engine
+ */
public TransformationEngine getTransformationEngine() {
return transformationEngine;
}
+ /**
+ * set transformation engine
+ * @param transformationEngine transformation engine
+ */
public void setTransformationEngine(TransformationEngine transformationEngine) {
this.transformationEngine = transformationEngine;
}
+ /**
+ * Getter of file data loaders
+ * @return List of file data loaders
+ */
public List getFileDataLoaders(){
List result = new ArrayList();
diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/BatchUpload.java b/dspace-api/src/main/java/org/dspace/app/itemimport/BatchUpload.java
index 7fe492c945..58e40c6ab9 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemimport/BatchUpload.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemimport/BatchUpload.java
@@ -7,9 +7,7 @@
*/
package org.dspace.app.itemimport;
-import java.io.BufferedReader;
import java.io.File;
-import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.LineNumberReader;
@@ -19,7 +17,6 @@ import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
-import java.util.Scanner;
/**
* @author kstamatis
@@ -37,7 +34,8 @@ public class BatchUpload {
private String errorMsgHTML = "";
/**
- *
+ * Initialize with directory
+ * @param dirPath directory path
*/
public BatchUpload(String dirPath) {
@@ -45,13 +43,20 @@ public class BatchUpload {
}
+ /**
+ * Initialize with directory
+ * @param dir directory path
+ */
public BatchUpload(File dir) {
this.initializeWithFile(dir);
}
-
+ /**
+ * Initialize with directory
+ * @param dir directory path
+ */
private void initializeWithFile(File dir){
this.dir = dir;
@@ -89,6 +94,12 @@ public class BatchUpload {
}
}
+ /**
+ * Count lines in file
+ * @param filename file name
+ * @return lines in file
+ * @throws IOException if IO error
+ */
private int countLines(String filename) throws IOException {
LineNumberReader reader = new LineNumberReader(new FileReader(filename));
int cnt = 0;
@@ -106,6 +117,11 @@ public class BatchUpload {
return cnt;
}
+ /**
+ * Read a file
+ * @param filename file name
+ * @throws IOException if IO error
+ */
private void readFile(String filename) throws IOException {
LineNumberReader reader = new LineNumberReader(new FileReader(filename));
String lineRead = "";
@@ -125,40 +141,76 @@ public class BatchUpload {
reader.close();
}
+ /**
+ * Get date
+ * @return Date
+ */
public Date getDate() {
return date;
}
+ /**
+ * Get path to directory
+ * @return directory
+ */
public File getDir() {
return dir;
}
+ /**
+ * Whether successulf
+ * @return true or false
+ */
public boolean isSuccessful() {
return successful;
}
+ /**
+ * Get items imported
+ * @return number of items
+ */
public int getItemsImported() {
return itemsImported;
}
+ /**
+ * Get total items
+ * @return total
+ */
public int getTotalItems() {
return totalItems;
}
+ /**
+ * Get formatted date (DD/MM/YY)
+ * @return date as string
+ */
public String getDateFormatted(){
SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy - HH:mm");
return df.format(date);
}
+ /**
+ * Get handles of imported files
+ * @return list of handles
+ */
public List getHandlesImported() {
return handlesImported;
}
+ /**
+ * Get error message
+ * @return error message
+ */
public String getErrorMsg() {
return errorMsg;
}
+ /**
+ * Get error message as HTML
+ * @return error message string as HTML
+ */
public String getErrorMsgHTML() {
return errorMsgHTML;
}
diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
index 8fa39910bb..2a564c3dda 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java
@@ -175,10 +175,10 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
* @param mycollections The collections the items are inserted to
* @param sourceDir The filepath to the file to read data from
* @param mapFile The filepath to mapfile to be generated
- * @param template
+ * @param template whether to use collection template item as starting point
* @param inputType The type of the input data (bibtex, csv, etc.)
* @param workingDir The path to create temporary files (for command line or UI based)
- * @throws Exception
+ * @throws Exception if error occurs
*/
@Override
public void addBTEItems(Context c, List mycollections,
@@ -457,10 +457,14 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
/**
* item? try and add it to the archive.
+ * @param c current Context
* @param mycollections - add item to these Collections.
* @param path - directory containing the item directories.
* @param itemname handle - non-null means we have a pre-defined handle already
* @param mapOut - mapfile we're writing
+ * @param template whether to use collection template item as starting point
+ * @return Item
+ * @throws Exception if error occurs
*/
protected Item addItem(Context c, List mycollections, String path,
String itemname, PrintWriter mapOut, boolean template) throws Exception
@@ -765,6 +769,8 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
* @param path The path to the data directory for this item
* @param filename The collections file filename. Should be "collections"
* @return A list of collections in which to insert the item or null
+ * @throws IOException if IO error
+ * @throws SQLException if database error
*/
protected List processCollectionFile(Context c, String path, String filename) throws IOException, SQLException
@@ -827,7 +833,12 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
}
/**
- * Read in the handle file or return null if empty or doesn't exist
+ * Read in the handle file contents or return null if empty or doesn't exist
+ * @param c DSpace context
+ * @param i DSpace item
+ * @param path path to handle file
+ * @param filename name of file
+ * @return handle file contents or null if doesn't exist
*/
protected String processHandleFile(Context c, Item i, String path, String filename)
{
@@ -886,6 +897,14 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
* Given a contents file and an item, stuffing it with bitstreams from the
* contents file Returns a List of Strings with lines from the contents
* file that request non-default bitstream permission
+ * @param c DSpace Context
+ * @param i DSpace item
+ * @param path path as string
+ * @param filename file name
+ * @return List of Strings
+ * @throws SQLException if database error
+ * @throws IOException if IO error
+ * @throws AuthorizeException if authorization error
*/
protected List processContentsFile(Context c, Item i, String path,
String filename) throws SQLException, IOException,
@@ -1129,14 +1148,15 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
/**
* each entry represents a bitstream....
- * @param c
- * @param i
- * @param path
- * @param fileName
- * @param bundleName
- * @throws SQLException
- * @throws IOException
- * @throws AuthorizeException
+ * @param c DSpace Context
+ * @param i Dspace Item
+ * @param path path to file
+ * @param fileName file name
+ * @param bundleName bundle name
+ * @param primary if primary bitstream
+ * @throws SQLException if database error
+ * @throws IOException if IO error
+ * @throws AuthorizeException if authorization error
*/
protected void processContentFileEntry(Context c, Item i, String path,
String fileName, String bundleName, boolean primary) throws SQLException,
@@ -1209,14 +1229,15 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
/**
* Register the bitstream file into DSpace
*
- * @param c
- * @param i
- * @param assetstore
+ * @param c DSpace Context
+ * @param i DSpace Item
+ * @param assetstore assetstore number
* @param bitstreamPath the full filepath expressed in the contents file
- * @param bundleName
- * @throws SQLException
- * @throws IOException
- * @throws AuthorizeException
+ * @param bundleName bundle name
+ * @param description bitstream description
+ * @throws SQLException if database error
+ * @throws IOException if IO error
+ * @throws AuthorizeException if authorization error
*/
protected void registerBitstream(Context c, Item i, int assetstore,
String bitstreamPath, String bundleName, String description )
@@ -1281,19 +1302,21 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
* Process the Options to apply to the Item. The options are tab delimited
*
* Options:
+ * {@code
* 48217870-MIT.pdf permissions: -r 'MIT Users' description: Full printable version (MIT only)
* permissions:[r|w]-['group name']
* description: 'the description of the file'
- *
+ * }
* where:
+ * {@code
* [r|w] (meaning: read|write)
* ['MIT Users'] (the group name)
- *
- * @param c
- * @param myItem
- * @param options
- * @throws SQLException
- * @throws AuthorizeException
+ * }
+ * @param c DSpace Context
+ * @param myItem DSpace Item
+ * @param options List of option strings
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
protected void processOptions(Context c, Item myItem, List options)
throws SQLException, AuthorizeException
@@ -1447,12 +1470,13 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
/**
* Set the Permission on a Bitstream.
*
- * @param c
- * @param g
- * @param actionID
- * @param bs
- * @throws SQLException
- * @throws AuthorizeException
+ * @param c DSpace Context
+ * @param g Dspace Group
+ * @param actionID action identifier
+ * @param bs Bitstream
+ * @see org.dspace.core.Constants
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
protected void setPermission(Context c, Group g, int actionID, Bitstream bs)
throws SQLException, AuthorizeException
@@ -1488,9 +1512,9 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
// XML utility methods
/**
* Lookup an attribute from a DOM node.
- * @param n
- * @param name
- * @return
+ * @param n node
+ * @param name attribute name
+ * @return attribute value
*/
private String getAttributeValue(Node n, String name)
{
@@ -1512,8 +1536,8 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
/**
* Return the String value of a Node.
- * @param node
- * @return
+ * @param node node
+ * @return string value
*/
protected String getStringValue(Node node)
{
@@ -1539,6 +1563,9 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
* the filename to load from
*
* @return the DOM representation of the XML file
+ * @throws IOException if IO error
+ * @throws ParserConfigurationException if config error
+ * @throws SAXException if XML error
*/
protected Document loadXML(String filename) throws IOException,
ParserConfigurationException, SAXException
@@ -1721,7 +1748,8 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
* @param resumeDir In case of a resume request, the directory that containsthe old mapfile and data
* @param inputType The input type of the data (bibtex, csv, etc.), in case of local file
* @param context The context
- * @throws Exception
+ * @param template whether to use template item
+ * @throws Exception if error
*/
@Override
public void processUIImport(String filepath, Collection owningCollection, String[] otherCollections, String resumeDir, String inputType, Context context, final boolean template) throws Exception
diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/service/ItemImportService.java b/dspace-api/src/main/java/org/dspace/app/itemimport/service/ItemImportService.java
index 59a51ffdeb..6a6a1ed964 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemimport/service/ItemImportService.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemimport/service/ItemImportService.java
@@ -36,15 +36,53 @@ import java.util.List;
public interface ItemImportService {
+ /**
+ *
+ * @param c DSpace Context
+ * @param mycollections List of Collections
+ * @param sourceDir source location
+ * @param mapFile map file
+ * @param template whether to use template item
+ * @throws Exception if error
+ */
public void addItemsAtomic(Context c, List mycollections, String sourceDir, String mapFile, boolean template) throws Exception;
+ /**
+ * Add items
+ * @param c DSpace Context
+ * @param mycollections List of Collections
+ * @param sourceDir source location
+ * @param mapFile map file
+ * @param template whether to use template item
+ * @throws Exception if error
+ */
public void addItems(Context c, List mycollections,
String sourceDir, String mapFile, boolean template) throws Exception;
+ /**
+ * Unzip a file
+ * @param zipfile file
+ * @return unzip location
+ * @throws IOException if error
+ */
public String unzip(File zipfile) throws IOException;
+ /**
+ * Unzip a file to a destination
+ * @param zipfile file
+ * @param destDir destination directory
+ * @return unzip location
+ * @throws IOException if error
+ */
public String unzip(File zipfile, String destDir) throws IOException;
+ /**
+ * Unzip a file in a specific source directory
+ * @param sourcedir source directory
+ * @param zipfilename file name
+ * @return unzip location
+ * @throws IOException if error
+ */
public String unzip(String sourcedir, String zipfilename) throws IOException;
/**
@@ -54,8 +92,10 @@ public interface ItemImportService {
* @param owningCollection The owning collection the items will belong to
* @param collections The collections the created items will be inserted to, apart from the owning one
* @param resumeDir In case of a resume request, the directory that containsthe old mapfile and data
+ * @param inputType The input type of the data (bibtex, csv, etc.), in case of local file
* @param context The context
- * @throws Exception
+ * @param template whether to use template item
+ * @throws Exception if error
*/
public void processUIImport(String url, Collection owningCollection, String[] collections, String resumeDir, String inputType, Context context, boolean template) throws Exception;
@@ -71,7 +111,7 @@ public interface ItemImportService {
* - eperson to send the email to
* @param fileName
* - the filepath to the mapfile created by the batch import
- * @throws javax.mail.MessagingException
+ * @throws MessagingException if error
*/
public void emailSuccessMessage(Context context, EPerson eperson,
String fileName) throws MessagingException;
@@ -86,39 +126,113 @@ public interface ItemImportService {
* - EPerson to send the error message to
* @param error
* - the error message
- * @throws MessagingException
+ * @throws MessagingException if error
*/
public void emailErrorMessage(EPerson eperson, String error)
throws MessagingException;
+ /**
+ * Get imports available for a person
+ * @param eperson EPerson object
+ * @return List of batch uploads
+ * @throws Exception if error
+ */
public List getImportsAvailable(EPerson eperson)
throws Exception;
+ /**
+ * Get import upload directory
+ * @param ePerson EPerson object
+ * @return directory
+ * @throws Exception if error
+ */
public String getImportUploadableDirectory(EPerson ePerson)
throws Exception;
+ /**
+ * Delete a batch by ID
+ * @param c DSpace Context
+ * @param uploadId identifier
+ * @throws Exception if error
+ */
public void deleteBatchUpload(Context c, String uploadId) throws Exception;
+ /**
+ * Replace items
+ * @param c DSpace Context
+ * @param mycollections List of Collections
+ * @param sourcedir source directory
+ * @param mapfile map file
+ * @param template whether to use template item
+ * @throws Exception if error
+ */
public void replaceItems(Context c, List mycollections, String sourcedir, String mapfile, boolean template) throws Exception;
+ /**
+ * Delete items via mapfile
+ * @param c DSpace Context
+ * @param mapfile map file
+ * @throws Exception if error
+ */
public void deleteItems(Context c, String mapfile) throws Exception;
+ /**
+ * Add items
+ * @param c DSpace Context
+ * @param mycollections List of Collections
+ * @param sourcedir source directory
+ * @param mapfile map file
+ * @param template whether to use template item
+ * @param bteInputType The input type of the data (bibtex, csv, etc.), in case of local file
+ * @param workingDir working directory
+ * @throws Exception if error
+ */
public void addBTEItems(Context c, List mycollections, String sourcedir, String mapfile, boolean template, String bteInputType, String workingDir) throws Exception;
+ /**
+ * Get temporary work directory
+ * @return directory as string
+ */
public String getTempWorkDir();
+ /**
+ * Get temporary work directory (as File)
+ * @return directory as File
+ */
public File getTempWorkDirFile();
+ /**
+ * Cleanup
+ */
public void cleanupZipTemp();
+ /**
+ * Set test flag
+ * @param isTest true or false
+ */
public void setTest(boolean isTest);
+ /**
+ * Set resume flag
+ * @param isResume true or false
+ */
public void setResume(boolean isResume);
+ /**
+ * Set use workflow
+ * @param useWorkflow whether to enable workflow
+ */
public void setUseWorkflow(boolean useWorkflow);
- public void setUseWorkflowSendEmail(boolean useWorkflow);
+ /**
+ * @param useWorkflowSendMail whether to send mail
+ */
+ public void setUseWorkflowSendEmail(boolean useWorkflowSendMail);
+ /**
+ * Set quiet flag
+ * @param isQuiet true or false
+ */
public void setQuiet(boolean isQuiet);
}
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/ActionManager.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/ActionManager.java
index abc81d302f..6a5579a958 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/ActionManager.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/ActionManager.java
@@ -24,6 +24,13 @@ public class ActionManager implements Iterable {
protected Map, UpdateAction> registry
= new LinkedHashMap, UpdateAction>();
+ /**
+ * Get update action
+ * @param actionClass UpdateAction class
+ * @return instantiation of UpdateAction class
+ * @throws InstantiationException if instantiation error
+ * @throws IllegalAccessException if illegal access error
+ */
public UpdateAction getUpdateAction(Class extends UpdateAction> actionClass)
throws InstantiationException, IllegalAccessException
{
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/AddBitstreamsAction.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/AddBitstreamsAction.java
index eebf8189a7..d78c73693b 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/AddBitstreamsAction.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/AddBitstreamsAction.java
@@ -46,17 +46,17 @@ public class AddBitstreamsAction extends UpdateBitstreamsAction {
}
/**
- * Adds bitstreams from the archive as listed in the contents file.
+ * Adds bitstreams from the archive as listed in the contents file.
*
- * @param context
- * @param itarch
- * @param isTest
- * @param suppressUndo
- * @throws IllegalArgumentException
- * @throws ParseException
- * @throws IOException
- * @throws AuthorizeException
- * @throws SQLException
+ * @param context DSpace Context
+ * @param itarch Item Archive
+ * @param isTest test flag
+ * @param suppressUndo undo flag
+ * @throws IOException if IO error
+ * @throws IllegalArgumentException if arg exception
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
+ * @throws ParseException if parse error
*/
@Override
public void execute(Context context, ItemArchive itarch, boolean isTest,
@@ -117,6 +117,22 @@ public class AddBitstreamsAction extends UpdateBitstreamsAction {
}
}
+ /**
+ * Add bitstream
+ * @param context DSpace Context
+ * @param itarch Item Archive
+ * @param item DSpace Item
+ * @param dir directory
+ * @param ce contents entry for bitstream
+ * @param suppressUndo undo flag
+ * @param isTest test flag
+ * @return bundle name
+ * @throws IOException if IO error
+ * @throws IllegalArgumentException if arg exception
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
+ * @throws ParseException if parse error
+ */
protected String addBitstream(Context context, ItemArchive itarch, Item item, File dir,
ContentsEntry ce, boolean suppressUndo, boolean isTest)
throws IOException, IllegalArgumentException, SQLException, AuthorizeException, ParseException
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/AddMetadataAction.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/AddMetadataAction.java
index 1856791317..74aa8525b1 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/AddMetadataAction.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/AddMetadataAction.java
@@ -31,14 +31,14 @@ public class AddMetadataAction extends UpdateMetadataAction {
protected MetadataFieldService metadataFieldService = ContentServiceFactory.getInstance().getMetadataFieldService();
/**
- * Adds metadata specified in the source archive
+ * Adds metadata specified in the source archive
*
- * @param context
- * @param itarch
- * @param isTest
- * @param suppressUndo
- * @throws AuthorizeException
- * @throws SQLException
+ * @param context DSpace Context
+ * @param itarch item archive
+ * @param isTest test flag
+ * @param suppressUndo undo flag
+ * @throws AuthorizeException if authorization error
+ * @throws SQLException if database error
*/
@Override
public void execute(Context context, ItemArchive itarch, boolean isTest,
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilter.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilter.java
index 617f2f50be..dd1cfccd7e 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilter.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilter.java
@@ -26,16 +26,16 @@ public abstract class BitstreamFilter {
/**
* The filter method
*
- * @param bitstream
+ * @param bitstream Bitstream
* @return whether the bitstream matches the criteria
- * @throws BitstreamFilterException
+ * @throws BitstreamFilterException if filter error
*/
public abstract boolean accept(Bitstream bitstream) throws BitstreamFilterException;
/**
*
* @param filepath - The complete path for the properties file
- * @throws IOException
+ * @throws IOException if IO error
*/
public void initProperties(String filepath)
throws IOException
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilterByBundleName.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilterByBundleName.java
index a983561635..e24ea0c42b 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilterByBundleName.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilterByBundleName.java
@@ -29,8 +29,8 @@ public class BitstreamFilterByBundleName extends BitstreamFilter {
/**
* Filter bitstream based on bundle name found in properties file
*
- * @param bitstream
- * @throws BitstreamFilterException
+ * @param bitstream Bitstream
+ * @throws BitstreamFilterException if filter error
* @return whether bitstream is in bundle
*
*/
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilterByFilename.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilterByFilename.java
index ba6c374ffd..292db98897 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilterByFilename.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilterByFilename.java
@@ -29,7 +29,9 @@ public class BitstreamFilterByFilename extends BitstreamFilter {
* Tests bitstream by matching the regular expression in the
* properties against the bitstream name
*
- * @return whether bitstream name matches the regular expression
+ * @param bitstream Bitstream
+ * @return whether bitstream name matches the regular expression
+ * @exception BitstreamFilterException if filter error
*/
@Override
public boolean accept(Bitstream bitstream) throws BitstreamFilterException
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilterException.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilterException.java
index d0971c564d..5126f7d5f3 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilterException.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/BitstreamFilterException.java
@@ -17,10 +17,18 @@ public class BitstreamFilterException extends Exception
private static final long serialVersionUID = 1L;
public BitstreamFilterException() {}
+ /**
+ *
+ * @param msg exception message
+ */
public BitstreamFilterException(String msg)
{
super(msg);
}
+ /**
+ *
+ * @param e exception
+ */
public BitstreamFilterException(Exception e)
{
super(e);
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/ContentsEntry.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/ContentsEntry.java
index 83cbce746b..61c7ca3b77 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/ContentsEntry.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/ContentsEntry.java
@@ -20,10 +20,12 @@ import org.dspace.core.Constants;
* Lacking a spec or full documentation for the file format,
* it looks from the source code that the ordering or elements is not fixed
*
- * e.g.:
+ * e.g.:
+ * {@code
* 48217870-MIT.pdf\tbundle: bundlename\tpermissions: -r 'MIT Users'\tdescription: Full printable version (MIT only)
* permissions: -[r|w] ['group name']
* description:
+ * }
*
*
*/
@@ -57,9 +59,9 @@ public class ContentsEntry
/**
* Factory method parses a line from the Contents Entry file
*
- * @param line
+ * @param line line as string
* @return the parsed ContentsEntry object
- * @throws ParseException
+ * @throws ParseException if parse error
*/
public static ContentsEntry parse(String line)
throws ParseException
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/DeleteBitstreamsAction.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/DeleteBitstreamsAction.java
index 6f9121fda2..2d44e3dc47 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/DeleteBitstreamsAction.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/DeleteBitstreamsAction.java
@@ -30,15 +30,15 @@ public class DeleteBitstreamsAction extends UpdateBitstreamsAction
/**
* Delete bitstream from item
*
- * @param context
- * @param itarch
- * @param isTest
- * @param suppressUndo
- * @throws IllegalArgumentException
- * @throws ParseException
- * @throws IOException
- * @throws AuthorizeException
- * @throws SQLException
+ * @param context DSpace Context
+ * @param itarch item archive
+ * @param isTest test flag
+ * @param suppressUndo undo flag
+ * @throws IOException if IO error
+ * @throws IllegalArgumentException if arg exception
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
+ * @throws ParseException if parse error
*/
@Override
public void execute(Context context, ItemArchive itarch, boolean isTest,
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/DeleteBitstreamsByFilterAction.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/DeleteBitstreamsByFilterAction.java
index c5b959c510..8a0caaa24a 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/DeleteBitstreamsByFilterAction.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/DeleteBitstreamsByFilterAction.java
@@ -35,7 +35,7 @@ public class DeleteBitstreamsByFilterAction extends UpdateBitstreamsAction {
/**
* Set filter
*
- * @param filter
+ * @param filter BitstreamFilter
*/
public void setBitstreamFilter(BitstreamFilter filter)
{
@@ -54,15 +54,15 @@ public class DeleteBitstreamsByFilterAction extends UpdateBitstreamsAction {
/**
* Delete bitstream
*
- * @param context
- * @param itarch
- * @param isTest
- * @param suppressUndo
- * @throws IllegalArgumentException
- * @throws ParseException
- * @throws IOException
- * @throws AuthorizeException
- * @throws SQLException
+ * @param context DSpace Context
+ * @param itarch item archive
+ * @param isTest test flag
+ * @param suppressUndo undo flag
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
+ * @throws ParseException if parse error
+ * @throws BitstreamFilterException if filter error
*/
@Override
public void execute(Context context, ItemArchive itarch, boolean isTest,
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/DeleteMetadataAction.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/DeleteMetadataAction.java
index 92b9f47772..a9a478efa4 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/DeleteMetadataAction.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/DeleteMetadataAction.java
@@ -28,12 +28,13 @@ public class DeleteMetadataAction extends UpdateMetadataAction {
/**
* Delete metadata from item
*
- * @param context
- * @param itarch
- * @param isTest
- * @param suppressUndo
- * @throws ParseException
- * @throws AuthorizeException
+ * @param context DSpace Context
+ * @param itarch Item Archive
+ * @param isTest test flag
+ * @param suppressUndo undo flag
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
+ * @throws ParseException if parse error
*/
@Override
public void execute(Context context, ItemArchive itarch, boolean isTest,
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/DtoMetadata.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/DtoMetadata.java
index 8ddd233306..2cdc72f1b1 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/DtoMetadata.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/DtoMetadata.java
@@ -16,7 +16,7 @@ import org.dspace.content.Item;
*
* Adds some utility methods
*
- * Really not at all general enough but supports Dublin Core and the compound form notation .[.]
+ * Really not at all general enough but supports Dublin Core and the compound form notation {@code .[.]}
*
* Does not support wildcard for qualifier
*
@@ -47,8 +47,9 @@ class DtoMetadata
* @param element not null, not empty
* @param qualifier null; don't allow empty string or * indicating 'any'
* @param language null or empty
- * @param value
+ * @param value value
* @return DtoMetadata object
+ * @throws IllegalArgumentException if arg error
*/
public static DtoMetadata create(String schema,
String element,
@@ -70,7 +71,9 @@ class DtoMetadata
*
* @param compoundForm of the form .[.]
* @param language null or empty
- * @param value
+ * @param value value
+ * @throws ParseException if parse error
+ * @throws IllegalArgumentException if arg error
*/
public static DtoMetadata create(String compoundForm, String language, String value)
throws ParseException, IllegalArgumentException
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/ItemArchive.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/ItemArchive.java
index 41146c9d20..3e4d32f7a2 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/ItemArchive.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/ItemArchive.java
@@ -85,6 +85,8 @@ public class ItemArchive {
* @param dir - The directory File in the source archive
* @param itemField - The metadata field in which the Item identifier is located
* if null, the default is the handle in the dc.identifier.uri field
+ * @return ItemArchive object
+ * @throws Exception if error
*
*/
public static ItemArchive create(Context context, File dir, String itemField)
@@ -137,6 +139,11 @@ public class ItemArchive {
return builder;
}
+ /**
+ * Getter for Transformer
+ * @return Transformer
+ * @throws TransformerConfigurationException if config error
+ */
protected Transformer getTransformer()
throws TransformerConfigurationException
{
@@ -176,7 +183,7 @@ public class ItemArchive {
/**
* Add metadata field to undo list
- * @param dtom
+ * @param dtom DtoMetadata (represents metadata field)
*/
public void addUndoMetadataField(DtoMetadata dtom)
{
@@ -194,7 +201,7 @@ public class ItemArchive {
/**
* Add bitstream id to delete contents file
- * @param bitstreamId
+ * @param bitstreamId bitstream ID
*/
public void addUndoDeleteContents(UUID bitstreamId)
{
@@ -207,7 +214,9 @@ public class ItemArchive {
* This is the default implementation
* that uses the dc.identifier.uri metadatafield
* that contains the item handle as its value
- *
+ * @param context DSpace Context
+ * @throws SQLException if database error
+ * @throws Exception if error
*/
private Item itemFromHandleInput(Context context)
throws SQLException, Exception
@@ -250,8 +259,8 @@ public class ItemArchive {
*
* @param context - the DSpace context
* @param itemField - the compound form of the metadata element ..
- * @throws SQLException
- * @throws Exception
+ * @throws SQLException if database error
+ * @throws Exception if error
*/
private Item itemFromMetadataField(Context context, String itemField)
throws SQLException, AuthorizeException, Exception
@@ -285,7 +294,11 @@ public class ItemArchive {
return item;
}
-
+ /**
+ * Get DtoMetadata field
+ * @param compoundForm compound form
+ * @return DtoMetadata field
+ */
private DtoMetadata getMetadataField(String compoundForm)
{
for (DtoMetadata dtom : dtomList)
@@ -301,8 +314,12 @@ public class ItemArchive {
/**
* write undo directory and files to Disk in archive format
*
- *
* @param undoDir - the root directory of the undo archive
+ * @throws IOException if IO error
+ * @throws ParserConfigurationException if config error
+ * @throws TransformerConfigurationException if transformer config error
+ * @throws TransformerException if transformer error
+ * @throws FileNotFoundException if file not found
*/
public void writeUndo(File undoDir)
throws IOException, ParserConfigurationException, TransformerConfigurationException,
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/ItemUpdate.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/ItemUpdate.java
index 834893ae75..e0e8ec1ac5 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/ItemUpdate.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/ItemUpdate.java
@@ -113,7 +113,7 @@ public class ItemUpdate {
/**
*
- * @param argv
+ * @param argv commandline args
*/
public static void main(String[] argv)
{
@@ -392,6 +392,16 @@ public class ItemUpdate {
System.exit(status);
}
+ /**
+ * process an archive
+ * @param context DSpace Context
+ * @param sourceDirPath source path
+ * @param itemField item field
+ * @param metadataIndexName index name
+ * @param alterProvenance whether to alter provenance
+ * @param isTest test flag
+ * @throws Exception if error
+ */
protected void processArchive(Context context, String sourceDirPath, String itemField,
String metadataIndexName, boolean alterProvenance, boolean isTest)
throws Exception
@@ -511,8 +521,8 @@ public class ItemUpdate {
*
* @param sourceDir - the original source directory
* @return the directory of the undo archive
- * @throws FileNotFoundException
- * @throws IOException
+ * @throws FileNotFoundException if file doesn't exist
+ * @throws IOException if IO error
*/
protected File initUndoArchive(File sourceDir)
throws FileNotFoundException, IOException
@@ -555,6 +565,12 @@ public class ItemUpdate {
//private void write
+ /**
+ * Set EPerson doing import
+ * @param context DSpace Context
+ * @param eperson EPerson obj
+ * @throws Exception if error
+ */
protected void setEPerson(Context context, String eperson)
throws Exception
{
@@ -589,7 +605,7 @@ public class ItemUpdate {
* poor man's logging
* As with ItemImport, API logging goes through log4j to the DSpace.log files
* whereas the batch logging goes to the console to be captured there.
- * @param s
+ * @param s String
*/
static void pr(String s)
{
@@ -598,7 +614,7 @@ public class ItemUpdate {
/**
* print if verbose flag is set
- * @param s
+ * @param s String
*/
static void prv(String s)
{
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/MetadataUtilities.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/MetadataUtilities.java
index a0929f12b5..c570de9e60 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/MetadataUtilities.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/MetadataUtilities.java
@@ -48,7 +48,7 @@ import org.dspace.core.ConfigurationManager;
/**
- * Miscellaneous methods for metadata handling that build on the API
+ * Miscellaneous methods for metadata handling that build on the API
* which might have general utility outside of the specific use
* in context in ItemUpdate.
*
@@ -68,11 +68,11 @@ public class MetadataUtilities {
clear (i.e. delete) all of these DCValues
* add them back, minus the one to actually delete
*
- *
- * @param item
- * @param dtom
- * @param isLanguageStrict -
- *
+ * @param context DSpace Context
+ * @param item Item Object
+ * @param dtom metadata field
+ * @param isLanguageStrict whether strict or not
+ * @throws SQLException if database error
* @return true if metadata field is found with matching value and was deleted
*/
public static boolean deleteMetadataByValue(Context context, Item item, DtoMetadata dtom, boolean isLanguageStrict) throws SQLException {
@@ -122,11 +122,13 @@ public class MetadataUtilities {
/**
* Append text to value metadata field to item
*
- * @param item
- * @param dtom
- * @param isLanguageStrict
- * @param textToAppend
+ * @param context DSpace Context
+ * @param item DSpace Item
+ * @param dtom metadata field
+ * @param isLanguageStrict if strict
+ * @param textToAppend text to append
* @throws IllegalArgumentException - When target metadata field is not found
+ * @throws SQLException if database error
*/
public static void appendMetadata(Context context, Item item, DtoMetadata dtom, boolean isLanguageStrict,
String textToAppend)
@@ -184,15 +186,15 @@ public class MetadataUtilities {
* Modification of method from ItemImporter.loadDublinCore
* as a Factory method
*
- * @param docBuilder -
+ * @param docBuilder DocumentBuilder
* @param is - InputStream of dublin_core.xml
* @return list of DtoMetadata representing the metadata fields relating to an Item
- * @throws SQLException
- * @throws IOException
- * @throws ParserConfigurationException
- * @throws SAXException
- * @throws TransformerException
- * @throws AuthorizeException
+ * @throws SQLException if database error
+ * @throws IOException if IO error
+ * @throws ParserConfigurationException if parser config error
+ * @throws SAXException if XML error
+ * @throws TransformerException if transformer error
+ * @throws AuthorizeException if authorization error
*/
public static List loadDublinCore(DocumentBuilder docBuilder, InputStream is)
throws SQLException, IOException, ParserConfigurationException,
@@ -269,12 +271,12 @@ public class MetadataUtilities {
/**
* Write dublin_core.xml
*
- * @param docBuilder
- * @param dtomList
+ * @param docBuilder DocumentBuilder
+ * @param dtomList List of metadata fields
* @return xml document
- * @throws ParserConfigurationException
- * @throws TransformerConfigurationException
- * @throws TransformerException
+ * @throws ParserConfigurationException if parser config error
+ * @throws TransformerConfigurationException if transformer config error
+ * @throws TransformerException if transformer error
*/
public static Document writeDublinCore(DocumentBuilder docBuilder, List dtomList)
throws ParserConfigurationException, TransformerConfigurationException, TransformerException
@@ -313,11 +315,11 @@ public class MetadataUtilities {
/**
* write xml document to output stream
- * @param doc
- * @param transformer
- * @param out
- * @throws IOException
- * @throws TransformerException
+ * @param doc XML Document
+ * @param transformer XML Transformer
+ * @param out OutputStream
+ * @throws IOException if IO Error
+ * @throws TransformerException if Transformer error
*/
public static void writeDocument(Document doc, Transformer transformer, OutputStream out)
throws IOException, TransformerException
@@ -332,9 +334,9 @@ public class MetadataUtilities {
// XML utility methods
/**
* Lookup an attribute from a DOM node.
- * @param n
- * @param name
- * @return
+ * @param n Node
+ * @param name name
+ * @return attribute value
*/
private static String getAttributeValue(Node n, String name)
{
@@ -355,8 +357,8 @@ public class MetadataUtilities {
/**
* Return the String value of a Node.
- * @param node
- * @return
+ * @param node node
+ * @return string value
*/
private static String getStringValue(Node node)
{
@@ -379,7 +381,11 @@ public class MetadataUtilities {
* Rewrite of ItemImport's functionality
* but just the parsing of the file, not the processing of its elements.
*
- * @validate flag to verify matching files in tree
+ * @param f file
+ * @return list of ContentsEntry
+ * @throws FileNotFoundException if file doesn't exist
+ * @throws IOException if IO error
+ * @throws ParseException if parse error
*/
public static List readContentsFile(File f)
throws FileNotFoundException, IOException, ParseException
@@ -421,9 +427,10 @@ public class MetadataUtilities {
/**
*
- * @param f
- * @throws FileNotFoundException
- * @throws IOException
+ * @param f file
+ * @return list of lines as strings
+ * @throws FileNotFoundException if file doesn't exist
+ * @throws IOException if IO Error
*/
public static List readDeleteContentsFile(File f)
throws FileNotFoundException, IOException
@@ -466,7 +473,7 @@ public class MetadataUtilities {
/**
* Get display of Metadatum
*
- * @param dcv
+ * @param dcv MetadataValue
* @return string displaying elements of the Metadatum
*/
public static String getDCValueString(MetadataValue dcv)
@@ -478,7 +485,10 @@ public class MetadataUtilities {
}
/**
- *
+ * Return compound form of a metadata field (i.e. schema.element.qualifier)
+ * @param schema schema
+ * @param element element
+ * @param qualifier qualifier
* @return a String representation of the two- or three-part form of a metadata element
* e.g. dc.identifier.uri
*/
@@ -495,9 +505,10 @@ public class MetadataUtilities {
}
/**
- * Parses metadata field given in the form .[.|.*]
+ * Parses metadata field given in the form {@code .[.|.*]}
* checks for correct number of elements (2 or 3) and for empty strings
*
+ * @param compoundForm compound form of metadata field
* @return String Array
* @throws ParseException if validity checks fail
*
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/OriginalBitstreamFilter.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/OriginalBitstreamFilter.java
index 8ca370b917..c865bfb511 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/OriginalBitstreamFilter.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/OriginalBitstreamFilter.java
@@ -27,10 +27,10 @@ public class OriginalBitstreamFilter extends BitstreamFilterByBundleName
/**
* Tests bitstreams for containment in an ORIGINAL bundle
- *
+ * @param bitstream Bitstream
* @return true if the bitstream is in the ORIGINAL bundle
*
- * @throws BitstreamFilterException
+ * @throws BitstreamFilterException if filter error
*/
@Override
public boolean accept(Bitstream bitstream)
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/OriginalWithDerivativesBitstreamFilter.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/OriginalWithDerivativesBitstreamFilter.java
index 084ae301bd..068a5a5e72 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/OriginalWithDerivativesBitstreamFilter.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/OriginalWithDerivativesBitstreamFilter.java
@@ -30,8 +30,8 @@ public class OriginalWithDerivativesBitstreamFilter extends BitstreamFilter
/**
* Tests bitstream for membership in specified bundles (ORIGINAL, TEXT, THUMBNAIL)
*
- * @param bitstream
- * @throws BitstreamFilterException
+ * @param bitstream Bitstream
+ * @throws BitstreamFilterException if error
* @return true if bitstream is in specified bundles
*/
@Override
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/UpdateAction.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/UpdateAction.java
index 30bffa409d..4fccfba1b7 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/UpdateAction.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/UpdateAction.java
@@ -21,13 +21,13 @@ public interface UpdateAction
/**
- * Action to update item
+ * Action to update item
*
- * @param context
- * @param itarch
- * @param isTest
- * @param suppressUndo
- * @throws Exception
+ * @param context DSpace context
+ * @param itarch item archive
+ * @param isTest test flag
+ * @param suppressUndo undo flag
+ * @throws Exception if error
*/
public void execute(Context context, ItemArchive itarch, boolean isTest, boolean suppressUndo)
throws Exception;
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/UpdateBitstreamsAction.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/UpdateBitstreamsAction.java
index 360f771fbf..7acd7d06bd 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/UpdateBitstreamsAction.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/UpdateBitstreamsAction.java
@@ -27,7 +27,7 @@ public abstract class UpdateBitstreamsAction implements UpdateAction {
/**
* Set variable to indicate that the dc.description.provenance field may
* be changed as a result of Bitstream changes by ItemUpdate
- * @param alterProvenance
+ * @param alterProvenance whether to alter provenance
*/
public void setAlterProvenance(boolean alterProvenance)
{
diff --git a/dspace-api/src/main/java/org/dspace/app/itemupdate/UpdateMetadataAction.java b/dspace-api/src/main/java/org/dspace/app/itemupdate/UpdateMetadataAction.java
index 99b8557ed3..284a9cefb2 100644
--- a/dspace-api/src/main/java/org/dspace/app/itemupdate/UpdateMetadataAction.java
+++ b/dspace-api/src/main/java/org/dspace/app/itemupdate/UpdateMetadataAction.java
@@ -13,7 +13,7 @@ import java.util.Set;
/**
* This abstract subclass for metadata actions
* maintains a collection for the target metadata fields
- * expressed as a string in the compound notation ( .. )
+ * expressed as a string in the compound notation ( {@code ..} )
* on which to apply the action when the method execute is called.
*
* Implemented as a Set to avoid problems with duplicates
@@ -36,7 +36,7 @@ public abstract class UpdateMetadataAction implements UpdateAction {
/**
* Set target fields
*
- * @param targetFields
+ * @param targetFields Set of target fields to update
*/
public void addTargetFields(Set targetFields) {
for (String tf : targetFields)
@@ -48,7 +48,7 @@ public abstract class UpdateMetadataAction implements UpdateAction {
/**
* Add array of target fields to update
- * @param targetFields
+ * @param targetFields array of target fields to update
*/
public void addTargetFields(String[] targetFields) {
for (String tf : targetFields)
@@ -61,7 +61,7 @@ public abstract class UpdateMetadataAction implements UpdateAction {
/**
* Add single field to update
*
- * @param targetField
+ * @param targetField target field to update
*/
public void addTargetField(String targetField) {
this.targetFields.add(targetField);
diff --git a/dspace-api/src/main/java/org/dspace/app/launcher/CommandRunner.java b/dspace-api/src/main/java/org/dspace/app/launcher/CommandRunner.java
index c3c1ae9d55..5d7a05ead5 100644
--- a/dspace-api/src/main/java/org/dspace/app/launcher/CommandRunner.java
+++ b/dspace-api/src/main/java/org/dspace/app/launcher/CommandRunner.java
@@ -23,6 +23,12 @@ import org.jdom.Document;
*/
public class CommandRunner
{
+ /**
+ *
+ * @param args commandline args
+ * @throws IOException if IO error
+ * @throws FileNotFoundException if file doesn't exist
+ */
public static void main(String[] args)
throws FileNotFoundException, IOException
{
@@ -46,11 +52,10 @@ public class CommandRunner
/**
* Read a file of command lines and execute each in turn.
*
- * @param doc details of recognized commands.
* @param script the file of command lines to be executed.
- * @return
- * @throws FileNotFoundException
- * @throws IOException
+ * @return status code
+ * @throws IOException if IO error
+ * @throws FileNotFoundException if file doesn't exist
*/
static int runManyCommands(String script)
throws FileNotFoundException, IOException
diff --git a/dspace-api/src/main/java/org/dspace/app/launcher/ScriptLauncher.java b/dspace-api/src/main/java/org/dspace/app/launcher/ScriptLauncher.java
index 88d5bf7cee..ede7ac4622 100644
--- a/dspace-api/src/main/java/org/dspace/app/launcher/ScriptLauncher.java
+++ b/dspace-api/src/main/java/org/dspace/app/launcher/ScriptLauncher.java
@@ -34,6 +34,8 @@ public class ScriptLauncher
* Execute the DSpace script launcher
*
* @param args Any parameters required to be passed to the scripts it executes
+ * @throws IOException if IO error
+ * @throws FileNotFoundException if file doesn't exist
*/
public static void main(String[] args)
throws FileNotFoundException, IOException
@@ -90,8 +92,8 @@ public class ScriptLauncher
/**
* Recognize and execute a single command.
- * @param doc
- * @param args
+ * @param doc Document
+ * @param args arguments
*/
static int runOneCommand(Document commandConfigs, String[] args)
{
@@ -275,6 +277,7 @@ public class ScriptLauncher
/**
* Display the commands that the current launcher config file knows about
+ * @param commandConfigs configs as Document
*/
private static void display(Document commandConfigs)
{
diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/BrandedPreviewJPEGFilter.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/BrandedPreviewJPEGFilter.java
index 1fe163fd99..fc0b8c9e26 100644
--- a/dspace-api/src/main/java/org/dspace/app/mediafilter/BrandedPreviewJPEGFilter.java
+++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/BrandedPreviewJPEGFilter.java
@@ -7,14 +7,7 @@
*/
package org.dspace.app.mediafilter;
-import java.awt.Graphics2D;
-import java.awt.Color;
import java.awt.image.*;
-import java.awt.RenderingHints;
-import java.awt.Transparency;
-import java.awt.Font;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import javax.imageio.ImageIO;
@@ -29,7 +22,7 @@ import org.dspace.app.mediafilter.JPEGFilter;
* thumbnail.maxwidth, thumbnail.maxheight, the size we want our thumbnail to be
* no bigger than. Creates only JPEGs.
*
- * @author Jason Sherman
+ * @author Jason Sherman jsherman@usao.edu
*/
public class BrandedPreviewJPEGFilter extends MediaFilter
{
@@ -69,10 +62,13 @@ public class BrandedPreviewJPEGFilter extends MediaFilter
/**
+ * @param currentItem item
* @param source
* source input stream
+ * @param verbose verbose mode
*
* @return InputStream the resulting input stream
+ * @throws Exception if error
*/
@Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)
diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/ExcelFilter.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/ExcelFilter.java
index 0ed7e79f08..05b9049aa1 100644
--- a/dspace-api/src/main/java/org/dspace/app/mediafilter/ExcelFilter.java
+++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/ExcelFilter.java
@@ -73,11 +73,14 @@ public class ExcelFilter extends MediaFilter
}
/**
- * @param source
- * source input stream
+ * @param item item
+ * @param source source input stream
+ * @param verbose verbose mode
*
* @return InputStream the resulting input stream
+ * @throws Exception if error
*/
+ @Override
public InputStream getDestinationStream(Item item, InputStream source, boolean verbose)
throws Exception
{
diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/FormatFilter.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/FormatFilter.java
index 86c900a4fd..702f65a8a6 100644
--- a/dspace-api/src/main/java/org/dspace/app/mediafilter/FormatFilter.java
+++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/FormatFilter.java
@@ -50,10 +50,13 @@ public interface FormatFilter
public String getDescription();
/**
+ * @param item Item
* @param source
* input stream
+ * @param verbose verbosity flag
*
* @return result of filter's transformation, written out to a bitstream
+ * @throws Exception if error
*/
public InputStream getDestinationStream(Item item, InputStream source, boolean verbose)
throws Exception;
@@ -67,15 +70,14 @@ public interface FormatFilter
* for any reason.
*
*
- * @param c
- * context
- * @param item
- * item containing bitstream to process
- * @param source
- * source bitstream to be processed
+ * @param c context
+ * @param item item containing bitstream to process
+ * @param source source bitstream to be processed
+ * @param verbose verbose mode
*
* @return true if bitstream processing should continue,
* false if this bitstream should be skipped
+ * @throws Exception if error
*/
public boolean preProcessBitstream(Context c, Item item, Bitstream source, boolean verbose)
throws Exception;
@@ -96,6 +98,7 @@ public interface FormatFilter
* @param generatedBitstream
* the bitstream which was generated by
* this filter.
+ * @throws Exception if error
*/
public void postProcessBitstream(Context c, Item item, Bitstream generatedBitstream)
throws Exception;
diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/HTMLFilter.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/HTMLFilter.java
index 576d520f3a..0a1c016a2c 100644
--- a/dspace-api/src/main/java/org/dspace/app/mediafilter/HTMLFilter.java
+++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/HTMLFilter.java
@@ -59,10 +59,12 @@ public class HTMLFilter extends MediaFilter
}
/**
- * @param source
- * source input stream
+ * @param currentItem item
+ * @param source source input stream
+ * @param verbose verbose mode
*
* @return InputStream the resulting input stream
+ * @throws Exception if error
*/
@Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)
diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/ImageMagickImageThumbnailFilter.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/ImageMagickImageThumbnailFilter.java
index 6698dbbe68..8959058acb 100644
--- a/dspace-api/src/main/java/org/dspace/app/mediafilter/ImageMagickImageThumbnailFilter.java
+++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/ImageMagickImageThumbnailFilter.java
@@ -24,10 +24,12 @@ public class ImageMagickImageThumbnailFilter extends ImageMagickThumbnailFilter
{
/**
- * @param source
- * source input stream
+ * @param currentItem item
+ * @param source source input stream
+ * @param verbose verbose mode
*
* @return InputStream the resulting input stream
+ * @throws Exception if error
*/
@Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)
diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/JPEGFilter.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/JPEGFilter.java
index 509dcd92eb..b4e409c261 100644
--- a/dspace-api/src/main/java/org/dspace/app/mediafilter/JPEGFilter.java
+++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/JPEGFilter.java
@@ -27,7 +27,7 @@ import org.dspace.core.ConfigurationManager;
* thumbnail.maxwidth, thumbnail.maxheight, the size we want our thumbnail to be
* no bigger than. Creates only JPEGs.
*
- * @author Jason Sherman
+ * @author Jason Sherman jsherman@usao.edu
*/
public class JPEGFilter extends MediaFilter implements SelfRegisterInputFormats
{
@@ -66,10 +66,12 @@ public class JPEGFilter extends MediaFilter implements SelfRegisterInputFormats
}
/**
- * @param source
- * source input stream
+ * @param currentItem item
+ * @param source source input stream
+ * @param verbose verbose mode
*
* @return InputStream the resulting input stream
+ * @throws Exception if error
*/
@Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)
@@ -239,6 +241,8 @@ public class JPEGFilter extends MediaFilter implements SelfRegisterInputFormats
* Convenience method that returns a blurred instance of the
* provided {@code BufferedImage}.
*
+ * @param buf buffered image
+ * @return updated BufferedImage
*/
public BufferedImage getBlurredInstance(BufferedImage buf)
{
diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilter.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilter.java
index 24281a3f20..8e60a68155 100644
--- a/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilter.java
+++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/MediaFilter.java
@@ -29,15 +29,14 @@ public abstract class MediaFilter implements FormatFilter
* for any reason.
*
*
- * @param c
- * context
- * @param item
- * item containing bitstream to process
- * @param source
- * source bitstream to be processed
+ * @param c context
+ * @param item item containing bitstream to process
+ * @param source source bitstream to be processed
+ * @param verbose verbose mode
*
* @return true if bitstream processing should continue,
* false if this bitstream should be skipped
+ * @throws Exception if error
*/
@Override
public boolean preProcessBitstream(Context c, Item item, Bitstream source, boolean verbose)
@@ -62,6 +61,7 @@ public abstract class MediaFilter implements FormatFilter
* @param generatedBitstream
* the bitstream which was generated by
* this filter.
+ * @throws java.lang.Exception
*/
@Override
public void postProcessBitstream(Context c, Item item, Bitstream generatedBitstream)
diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/PDFBoxThumbnail.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/PDFBoxThumbnail.java
index 50ca4e69e6..f482914a58 100644
--- a/dspace-api/src/main/java/org/dspace/app/mediafilter/PDFBoxThumbnail.java
+++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/PDFBoxThumbnail.java
@@ -7,13 +7,7 @@
*/
package org.dspace.app.mediafilter;
-import java.awt.Graphics2D;
-import java.awt.Color;
import java.awt.image.*;
-import java.awt.RenderingHints;
-import java.awt.Transparency;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import javax.imageio.ImageIO;
@@ -22,7 +16,6 @@ import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.rendering.PDFRenderer;
import org.dspace.content.Item;
-import org.dspace.core.ConfigurationManager;
import org.dspace.app.mediafilter.JPEGFilter;
@@ -33,8 +26,8 @@ import org.dspace.app.mediafilter.JPEGFilter;
* thumbnail.maxwidth, thumbnail.maxheight, the size we want our thumbnail to be
* no bigger than. Creates only JPEGs.
*
- * @author Ivan Masár
- * @author Jason Sherman
+ * @author Ivan Masár helix84@centrum.sk
+ * @author Jason Sherman jsherman@usao.edu
*/
public class PDFBoxThumbnail extends MediaFilter implements SelfRegisterInputFormats
{
@@ -73,10 +66,12 @@ public class PDFBoxThumbnail extends MediaFilter implements SelfRegisterInputFor
}
/**
- * @param source
- * source input stream
+ * @param currentItem item
+ * @param source source input stream
+ * @param verbose verbose mode
*
* @return InputStream the resulting input stream
+ * @throws Exception if error
*/
@Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)
diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/PDFFilter.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/PDFFilter.java
index a2c8f686a6..b68d488813 100644
--- a/dspace-api/src/main/java/org/dspace/app/mediafilter/PDFFilter.java
+++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/PDFFilter.java
@@ -68,10 +68,12 @@ public class PDFFilter extends MediaFilter
}
/**
- * @param source
- * source input stream
+ * @param currentItem item
+ * @param source source input stream
+ * @param verbose verbose mode
*
* @return InputStream the resulting input stream
+ * @throws Exception if error
*/
@Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)
diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/PowerPointFilter.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/PowerPointFilter.java
index c44f9b5d7b..dc21e9ee00 100644
--- a/dspace-api/src/main/java/org/dspace/app/mediafilter/PowerPointFilter.java
+++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/PowerPointFilter.java
@@ -64,10 +64,12 @@ public class PowerPointFilter extends MediaFilter
}
/**
- * @param source
- * source input stream
+ * @param currentItem item
+ * @param source source input stream
+ * @param verbose verbose mode
*
* @return InputStream the resulting input stream
+ * @throws Exception if error
*/
@Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)
diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/WordFilter.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/WordFilter.java
index 9ca52fb211..8a1452941e 100644
--- a/dspace-api/src/main/java/org/dspace/app/mediafilter/WordFilter.java
+++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/WordFilter.java
@@ -63,10 +63,12 @@ public class WordFilter extends MediaFilter
}
/**
- * @param source
- * source input stream
+ * @param currentItem item
+ * @param source source input stream
+ * @param verbose verbose mode
*
* @return InputStream the resulting input stream
+ * @throws Exception if error
*/
@Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)
diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/service/MediaFilterService.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/service/MediaFilterService.java
index 0a8385928e..d88a22bce7 100644
--- a/dspace-api/src/main/java/org/dspace/app/mediafilter/service/MediaFilterService.java
+++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/service/MediaFilterService.java
@@ -48,8 +48,11 @@ public interface MediaFilterService {
* Iterate through the item's bitstreams in the ORIGINAL bundle, applying
* filters if possible.
*
+ * @param context context
+ * @param myItem item
* @return true if any bitstreams processed,
* false if none
+ * @throws Exception if error
*/
public boolean filterItem(Context context, Item myItem) throws Exception;
@@ -60,8 +63,12 @@ public interface MediaFilterService {
* instantiated. Exceptions from filtering will be logged to STDOUT and
* swallowed.
*
+ * @param c context
+ * @param myItem item
+ * @param myBitstream bitstream
* @return true if bitstream processed,
* false if no applicable filter or already processed
+ * @throws Exception if error
*/
public boolean filterBitstream(Context c, Item myItem, Bitstream myBitstream) throws Exception;
@@ -72,7 +79,7 @@ public interface MediaFilterService {
* already been filtered, and if not or if overWrite is set, invokes the
* filter.
*
- * @param c
+ * @param context
* context
* @param item
* item containing bitstream to process
@@ -80,7 +87,7 @@ public interface MediaFilterService {
* source bitstream to process
* @param formatFilter
* FormatFilter to perform filtering
- *
+ * @throws Exception if error occurs
* @return true if new rendition is created, false if rendition already
* exists and overWrite is not set
*/
diff --git a/dspace-api/src/main/java/org/dspace/app/packager/Packager.java b/dspace-api/src/main/java/org/dspace/app/packager/Packager.java
index 8affcb64cb..8a69dfd697 100644
--- a/dspace-api/src/main/java/org/dspace/app/packager/Packager.java
+++ b/dspace-api/src/main/java/org/dspace/app/packager/Packager.java
@@ -478,12 +478,12 @@ public class Packager
* @param pkgParams Parameters to pass to individual packager instances
* @param sourceFile location of the source package to ingest
* @param parentObjs Parent DSpace object(s) to attach new object to
- * @throws IOException
- * @throws SQLException
- * @throws FileNotFoundException
- * @throws AuthorizeException
- * @throws CrosswalkException
- * @throws PackageException
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws FileNotFoundException if file doesn't exist
+ * @throws AuthorizeException if authorization error
+ * @throws CrosswalkException if crosswalk error
+ * @throws PackageException if packaging error
*/
protected void ingest(Context context, PackageIngester sip, PackageParameters pkgParams, String sourceFile, DSpaceObject parentObjs[])
throws IOException, SQLException, FileNotFoundException, AuthorizeException, CrosswalkException, PackageException
@@ -617,12 +617,12 @@ public class Packager
* @param dso DSpace Object to disseminate as a package
* @param pkgParams Parameters to pass to individual packager instances
* @param outputFile File where final package should be saved
- * @throws IOException
- * @throws SQLException
- * @throws FileNotFoundException
- * @throws AuthorizeException
- * @throws CrosswalkException
- * @throws PackageException
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws FileNotFoundException if file doesn't exist
+ * @throws AuthorizeException if authorization error
+ * @throws CrosswalkException if crosswalk error
+ * @throws PackageException if packaging error
*/
protected void disseminate(Context context, PackageDisseminator dip,
DSpaceObject dso, PackageParameters pkgParams,
@@ -699,12 +699,12 @@ public class Packager
* @param pkgParams Parameters to pass to individual packager instances
* @param sourceFile location of the source package to ingest as the replacement
* @param objToReplace DSpace object to replace (may be null if it will be specified in the package itself)
- * @throws IOException
- * @throws SQLException
- * @throws FileNotFoundException
- * @throws AuthorizeException
- * @throws CrosswalkException
- * @throws PackageException
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws FileNotFoundException if file doesn't exist
+ * @throws AuthorizeException if authorization error
+ * @throws CrosswalkException if crosswalk error
+ * @throws PackageException if packaging error
*/
protected void replace(Context context, PackageIngester sip, PackageParameters pkgParams, String sourceFile, DSpaceObject objToReplace)
throws IOException, SQLException, FileNotFoundException, AuthorizeException, CrosswalkException, PackageException
diff --git a/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItem.java b/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItem.java
index 47346eca6c..0a549db077 100644
--- a/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItem.java
+++ b/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItem.java
@@ -10,6 +10,7 @@ package org.dspace.app.requestitem;
import org.dspace.content.Bitstream;
import org.dspace.content.Item;
import org.dspace.core.Context;
+import org.dspace.core.ReloadableEntity;
import javax.persistence.*;
import java.util.Date;
@@ -19,7 +20,7 @@ import java.util.Date;
*/
@Entity
@Table(name="requestitem")
-public class RequestItem {
+public class RequestItem implements ReloadableEntity {
@Id
@@ -76,7 +77,7 @@ public class RequestItem {
{
}
- public int getID() {
+ public Integer getID() {
return requestitem_id;
}
diff --git a/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemHelpdeskStrategy.java b/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemHelpdeskStrategy.java
index cfe2f8cacb..ddd6d50ba5 100644
--- a/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemHelpdeskStrategy.java
+++ b/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemHelpdeskStrategy.java
@@ -9,7 +9,6 @@ package org.dspace.app.requestitem;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
-import org.dspace.authorize.AuthorizeException;
import org.dspace.content.Item;
import org.dspace.core.ConfigurationManager;
import org.dspace.core.Context;
@@ -55,9 +54,10 @@ public class RequestItemHelpdeskStrategy extends RequestItemSubmitterStrategy {
* Return a RequestItemAuthor object for the specified helpdesk email address.
* It makes an attempt to find if there is a matching eperson for the helpdesk address, to use the name,
* Otherwise it falls back to a helpdeskname key in the Messages.props.
- * @param context
- * @param helpDeskEmail
- * @return
+ * @param context context
+ * @param helpDeskEmail email
+ * @return RequestItemAuthor
+ * @throws SQLException if database error
*/
public RequestItemAuthor getHelpDeskPerson(Context context, String helpDeskEmail) throws SQLException{
EPerson helpdeskEPerson = null;
diff --git a/dspace-api/src/main/java/org/dspace/app/requestitem/dao/RequestItemDAO.java b/dspace-api/src/main/java/org/dspace/app/requestitem/dao/RequestItemDAO.java
index de8e87bacc..386ded0bab 100644
--- a/dspace-api/src/main/java/org/dspace/app/requestitem/dao/RequestItemDAO.java
+++ b/dspace-api/src/main/java/org/dspace/app/requestitem/dao/RequestItemDAO.java
@@ -16,7 +16,7 @@ import java.sql.SQLException;
/**
* Database Access Object interface class for the RequestItem object.
* The implementation of this class is responsible for all database calls for the RequestItem object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
diff --git a/dspace-api/src/main/java/org/dspace/app/requestitem/service/RequestItemService.java b/dspace-api/src/main/java/org/dspace/app/requestitem/service/RequestItemService.java
index 7c7518701e..b3ac1b5004 100644
--- a/dspace-api/src/main/java/org/dspace/app/requestitem/service/RequestItemService.java
+++ b/dspace-api/src/main/java/org/dspace/app/requestitem/service/RequestItemService.java
@@ -24,9 +24,15 @@ public interface RequestItemService {
/**
* Generate a request item representing the request and put it into the DB
- * @param context
+ * @param context context
+ * @param bitstream bitstream
+ * @param item item
+ * @param reqMessage message
+ * @param allFiles all files flag
+ * @param reqEmail email
+ * @param reqName name
* @return the token of the request item
- * @throws java.sql.SQLException
+ * @throws SQLException if database error
*/
public String createRequest(Context context, Bitstream bitstream, Item item, boolean allFiles, String reqEmail, String reqName, String reqMessage)
throws SQLException;
@@ -36,6 +42,7 @@ public interface RequestItemService {
/**
* Save updates to the record. Only accept_request, and decision_date are set-able.
* @param context
+ * @param requestItem
*/
public void update(Context context, RequestItem requestItem);
diff --git a/dspace-api/src/main/java/org/dspace/app/sfx/SFXFileReaderServiceImpl.java b/dspace-api/src/main/java/org/dspace/app/sfx/SFXFileReaderServiceImpl.java
index 309ae667ab..2bef54187a 100644
--- a/dspace-api/src/main/java/org/dspace/app/sfx/SFXFileReaderServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/app/sfx/SFXFileReaderServiceImpl.java
@@ -140,7 +140,7 @@ public class SFXFileReaderServiceImpl implements SFXFileReaderService {
* @param e DOM node of the mapping pair in the XML file (field element)
* @param item The item to process, from which metadata values will be taken
* @return assembled OpenURL query.
- * @throws IOException
+ * @throws IOException if IO error
*/
protected String processFields(Node e, Item item) throws IOException {
NodeList cl = e.getChildNodes();
diff --git a/dspace-api/src/main/java/org/dspace/app/sfx/service/SFXFileReaderService.java b/dspace-api/src/main/java/org/dspace/app/sfx/service/SFXFileReaderService.java
index 821870bd59..820abe4a97 100644
--- a/dspace-api/src/main/java/org/dspace/app/sfx/service/SFXFileReaderService.java
+++ b/dspace-api/src/main/java/org/dspace/app/sfx/service/SFXFileReaderService.java
@@ -36,7 +36,7 @@ public interface SFXFileReaderService {
* @param item The item to process, from which metadata values will be taken
*
* @return the SFX string
- * @throws java.io.IOException
+ * @throws IOException if IO error
*/
public String loadSFXFile(String fileName, Item item) throws IOException;
@@ -53,7 +53,7 @@ public interface SFXFileReaderService {
* @param node DOM node of the mapping pair in the XML file (field element)
* @param item The item to process, from which metadata values will be taken
* @return processed fields.
- * @throws IOException
+ * @throws IOException if IO error
*/
public String doNodes(Node node, Item item) throws IOException;
@@ -67,17 +67,24 @@ public interface SFXFileReaderService {
/**
* Is Empty text Node *
+ * @param nd node
+ * @return true or false
*/
public boolean isEmptyTextNode(Node nd);
/**
- * Returns the value of the node's attribute named
+ * Returns the value of the node's attribute named {@code }
+ * @param e node
+ * @param name name
+ * @return value
*/
public String getAttribute(Node e, String name);
/**
* Returns the value found in the Text node (if any) in the
* node list that's passed in.
+ * @param node node
+ * @return value
*/
public String getValue(Node node);
}
\ No newline at end of file
diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/submit/MetadataAuthorityISSNExtractor.java b/dspace-api/src/main/java/org/dspace/app/sherpa/submit/MetadataAuthorityISSNExtractor.java
index 8da1fc017d..f068c36175 100644
--- a/dspace-api/src/main/java/org/dspace/app/sherpa/submit/MetadataAuthorityISSNExtractor.java
+++ b/dspace-api/src/main/java/org/dspace/app/sherpa/submit/MetadataAuthorityISSNExtractor.java
@@ -37,7 +37,10 @@ public class MetadataAuthorityISSNExtractor implements ISSNItemExtractor
List dcvalues = itemService.getMetadataByMetadataString(item, metadata);
for (MetadataValue dcvalue : dcvalues)
{
- values.add(dcvalue.getAuthority());
+ String authority = dcvalue.getAuthority();
+ if(authority !=null){
+ values.add(authority);
+ }
}
}
return values;
diff --git a/dspace-api/src/main/java/org/dspace/app/sitemap/AbstractGenerator.java b/dspace-api/src/main/java/org/dspace/app/sitemap/AbstractGenerator.java
index 5db05f43c6..8891943d08 100644
--- a/dspace-api/src/main/java/org/dspace/app/sitemap/AbstractGenerator.java
+++ b/dspace-api/src/main/java/org/dspace/app/sitemap/AbstractGenerator.java
@@ -74,7 +74,7 @@ public abstract class AbstractGenerator
/**
* Start writing a new sitemap file.
*
- * @throws IOException
+ * @throws IOException if IO error
* if an error occurs creating the file
*/
protected void startNewFile() throws IOException
@@ -102,7 +102,7 @@ public abstract class AbstractGenerator
* Full URL to add
* @param lastMod
* Date URL was last modified, or {@code null}
- * @throws IOException
+ * @throws IOException if IO error
* if an error occurs writing
*/
public void addURL(String url, Date lastMod) throws IOException
@@ -130,7 +130,7 @@ public abstract class AbstractGenerator
/**
* Finish with the current sitemap file.
*
- * @throws IOException
+ * @throws IOException if IO error
* if an error occurs writing
*/
protected void closeCurrentFile() throws IOException
@@ -147,7 +147,7 @@ public abstract class AbstractGenerator
*
* @return number of sitemap files written.
*
- * @throws IOException
+ * @throws IOException if IO error
* if an error occurs writing
*/
public int finish() throws IOException
@@ -246,7 +246,7 @@ public abstract class AbstractGenerator
* stream to write the index to
* @param sitemapCount
* number of sitemaps that were generated
- * @throws IOException
+ * @throws IOException if IO error
* if an IO error occurs
*/
public abstract void writeIndex(PrintStream output, int sitemapCount)
diff --git a/dspace-api/src/main/java/org/dspace/app/sitemap/GenerateSitemaps.java b/dspace-api/src/main/java/org/dspace/app/sitemap/GenerateSitemaps.java
index 6f455d4c7f..652575aa80 100644
--- a/dspace-api/src/main/java/org/dspace/app/sitemap/GenerateSitemaps.java
+++ b/dspace-api/src/main/java/org/dspace/app/sitemap/GenerateSitemaps.java
@@ -152,9 +152,9 @@ public class GenerateSitemaps
* if {@code true}, generate an HTML sitemap.
* @param makeSitemapOrg
* if {@code true}, generate an sitemap.org sitemap.
- * @throws SQLException
+ * @throws SQLException if database error
* if a database error occurs.
- * @throws IOException
+ * @throws IOException if IO error
* if IO error occurs.
*/
public static void generateSitemaps(boolean makeHTMLMap,
diff --git a/dspace-api/src/main/java/org/dspace/app/statistics/CreateStatReport.java b/dspace-api/src/main/java/org/dspace/app/statistics/CreateStatReport.java
index 73e32bd20e..0b836d5b44 100644
--- a/dspace-api/src/main/java/org/dspace/app/statistics/CreateStatReport.java
+++ b/dspace-api/src/main/java/org/dspace/app/statistics/CreateStatReport.java
@@ -25,9 +25,9 @@ import org.dspace.core.ConfigurationManager;
/**
* This class allows the running of the DSpace statistic tools
*
- * Usage: java CreateStatReport -r
- * Available:
- *
+ * Usage: {@code java CreateStatReport -r }
+ * Available: {@code
+ * }
*
* @author Chris Yates
*
@@ -95,7 +95,7 @@ public class CreateStatReport {
context.setIgnoreAuthorization(true);
//get paths to directories
- outputLogDirectory = ConfigurationManager.getProperty("log.dir") + File.separator;
+ outputLogDirectory = ConfigurationManager.getProperty("log.report.dir") + File.separator;
outputReportDirectory = ConfigurationManager.getProperty("report.dir") + File.separator;
//read in command line variable to determine which statistic to run
@@ -145,7 +145,7 @@ public class CreateStatReport {
/**
* This method generates a report from the first of the current month to the end of the current month.
*
- * @throws Exception
+ * @throws Exception if error
*/
private static void statMonthly() throws Exception {
@@ -184,7 +184,7 @@ public class CreateStatReport {
/**
* This method generates a full report based on the full log period
*
- * @throws Exception
+ * @throws Exception if error
*/
private static void statGeneral() throws Exception {
@@ -216,7 +216,7 @@ public class CreateStatReport {
* This script starts from the year and month specified below and loops each month until the current month
* generating a monthly aggregation files for the DStat system.
*
- * @throws Exception
+ * @throws Exception if error
*/
private static void statInitial() throws Exception {
@@ -265,7 +265,7 @@ public class CreateStatReport {
/**
* This method generates a full report based on the full log period
*
- * @throws Exception
+ * @throws Exception if error
*/
private static void statReportGeneral() throws Exception {
@@ -304,7 +304,7 @@ public class CreateStatReport {
* This script starts from the year and month specified below and loops each month until the current month
* generating monthly reports from the DStat aggregation files
*
- * @throws Exception
+ * @throws Exception if error
*/
private static void statReportInitial() throws Exception {
@@ -349,7 +349,7 @@ public class CreateStatReport {
/**
* This method generates a report from the aggregation files which have been run for the most recent month
*
- * @throws Exception
+ * @throws Exception if error
*/
private static void statReportMonthly() throws Exception
{
diff --git a/dspace-api/src/main/java/org/dspace/app/statistics/HTMLReport.java b/dspace-api/src/main/java/org/dspace/app/statistics/HTMLReport.java
index 173b90529e..29d5abc792 100644
--- a/dspace-api/src/main/java/org/dspace/app/statistics/HTMLReport.java
+++ b/dspace-api/src/main/java/org/dspace/app/statistics/HTMLReport.java
@@ -334,7 +334,7 @@ public class HTMLReport implements Report
/**
* output the report block based on the passed mapping, where the mapping
- * sould be "name of report element" => "value", where both sides of the
+ * should be "name of report element" to "value", where both sides of the
* mapping should be Strings. This class also assumes that the reference
* is a linkable URL to the resource
*
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 56ab0256d9..4459b5ace6 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
@@ -9,7 +9,6 @@ package org.dspace.app.statistics;
import org.apache.commons.lang3.StringUtils;
import org.dspace.core.ConfigurationManager;
-import org.dspace.core.Constants;
import org.dspace.core.Context;
import org.dspace.core.LogManager;
import org.dspace.discovery.DiscoverQuery;
@@ -185,8 +184,8 @@ public class LogAnalyser
////////////////////////
/** the log directory to be analysed */
- private static String logDir = ConfigurationManager.getProperty("log.dir");
-
+ private static String logDir = ConfigurationManager.getProperty("log.report.dir");
+
/** the regex to describe the file name format */
private static String fileTemplate = "dspace\\.log.*";
@@ -196,7 +195,7 @@ public class LogAnalyser
"dstat.cfg";
/** the output file to which to write aggregation data */
- private static String outFile = ConfigurationManager.getProperty("log.dir") + File.separator + "dstat.dat";
+ private static String outFile = ConfigurationManager.getProperty("log.report.dir") + File.separator + "dstat.dat";
/** the starting date of the report */
private static Date startDate = null;
@@ -213,6 +212,9 @@ public class LogAnalyser
/**
* main method to be run from command line. See usage information for
* details as to how to use the command line flags (-help)
+ * @param argv arguments
+ * @throws Exception if error
+ * @throws SQLException if database error
*/
public static void main(String [] argv)
throws Exception, SQLException
@@ -294,6 +296,10 @@ public class LogAnalyser
* @param myStartDate the desired start of the analysis. Starts from the beginning otherwise
* @param myEndDate the desired end of the analysis. Goes to the end otherwise
* @param myLookUp force a lookup of the database
+ * @return aggregate output
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws SearchServiceException if search error
*/
public static String processLogs(Context context, String myLogDir,
String myFileTemplate, String myConfigFile,
@@ -555,7 +561,7 @@ public class LogAnalyser
{
logDir = myLogDir;
}
-
+
if (myFileTemplate != null)
{
fileTemplate = myFileTemplate;
@@ -587,6 +593,7 @@ public class LogAnalyser
/**
* generate the analyser's output to the specified out file
+ * @return output
*/
public static String createOutput()
{
@@ -866,6 +873,7 @@ public class LogAnalyser
/**
* Read in the current config file and populate the class globals.
+ * @throws IOException if IO error
*/
public static void readConfig() throws IOException
{
@@ -876,6 +884,7 @@ public class LogAnalyser
* Read in the given config file and populate the class globals.
*
* @param configFile the config file to read in
+ * @throws IOException if IO error
*/
public static void readConfig(String configFile) throws IOException
{
@@ -1166,6 +1175,8 @@ public class LogAnalyser
* @param type value for DC field 'type' (unqualified)
*
* @return an integer containing the relevant count
+ * @throws SQLException if database error
+ * @throws SearchServiceException if search error
*/
public static Integer getNumItems(Context context, String type)
throws SQLException, SearchServiceException {
@@ -1216,6 +1227,8 @@ public class LogAnalyser
*
* @return an Integer containing the number of items in the
* archive
+ * @throws SQLException if database error
+ * @throws SearchServiceException if search error
*/
public static Integer getNumItems(Context context)
throws SQLException, SearchServiceException {
diff --git a/dspace-api/src/main/java/org/dspace/app/statistics/ReportGenerator.java b/dspace-api/src/main/java/org/dspace/app/statistics/ReportGenerator.java
index 3b6ec4b5cb..039b516497 100644
--- a/dspace-api/src/main/java/org/dspace/app/statistics/ReportGenerator.java
+++ b/dspace-api/src/main/java/org/dspace/app/statistics/ReportGenerator.java
@@ -152,6 +152,9 @@ public class ReportGenerator
/**
* main method to be run from command line. See usage information for
* details as to how to use the command line flags
+ * @param argv
+ * @throws java.lang.Exception
+ * @throws java.sql.SQLException
*/
public static void main(String [] argv)
throws Exception, SQLException
@@ -206,10 +209,13 @@ public class ReportGenerator
* this method is retained for backwards compatibility, but delegates the actual
* wprk to a new method
*
- * @param context the DSpace context in which this action is performed
- * @param myFormat the desired output format (currently on HTML supported)
- * @param myInput the aggregation file to be turned into a report
- * @param myOutput the file into which to write the report
+ * @param context the DSpace context in which this action is performed
+ * @param myFormat the desired output format (currently on HTML supported)
+ * @param myInput the aggregation file to be turned into a report
+ * @param myOutput the file into which to write the report
+ * @param myMap the map
+ * @throws Exception if error
+ * @throws SQLException if database error
*/
public static void processReport(Context context, String myFormat,
String myInput, String myOutput,
@@ -242,6 +248,11 @@ public class ReportGenerator
* using the pre-configuration information passed here, read in the
* aggregation data and output a file containing the report in the
* requested format
+ * @param context context
+ * @param report report
+ * @param myInput input
+ * @throws Exception if error
+ * @throws SQLException if database error
*/
public static void processReport(Context context, Report report,
String myInput)
@@ -527,6 +538,7 @@ public class ReportGenerator
* actions which are more understandable to humans
*
* @param map the map file
+ * @throws IOException if IO error
*/
public static void readMap(String map)
throws IOException
@@ -612,6 +624,8 @@ public class ReportGenerator
* The values that come from this file form the basis of the analysis report
*
* @param input the aggregator file
+ * @throws IOException if IO error
+ * @throws ParseException if parse error
*/
public static void readInput(String input)
throws IOException, ParseException
@@ -783,6 +797,7 @@ public class ReportGenerator
*
* @return a string containing a reference (almost citation) to the
* article
+ * @throws SQLException if database error
*/
public static String getItemInfo(Context context, String handle)
throws SQLException
diff --git a/dspace-api/src/main/java/org/dspace/app/statistics/StatisticsLoader.java b/dspace-api/src/main/java/org/dspace/app/statistics/StatisticsLoader.java
index c08cfc03ab..cc125897bb 100644
--- a/dspace-api/src/main/java/org/dspace/app/statistics/StatisticsLoader.java
+++ b/dspace-api/src/main/java/org/dspace/app/statistics/StatisticsLoader.java
@@ -66,6 +66,7 @@ public class StatisticsLoader
/**
* Get an array of the dates of the report files.
+ * @return array of dates
*/
public static Date[] getMonthlyReportDates()
{
@@ -74,6 +75,7 @@ public class StatisticsLoader
/**
* Get an array of the dates of the analysis files.
+ * @return array of dates
*/
public static Date[] getMonthlyAnalysisDates()
{
@@ -82,7 +84,8 @@ public class StatisticsLoader
/**
* Convert the formatted dates that are the keys of the map into a date array.
- * @param monthlyMap
+ * @param monthlyMap map
+ * @return array of dates
*/
protected static Date[] getDatesFromMap(Map monthlyMap)
{
@@ -107,7 +110,7 @@ public class StatisticsLoader
/**
* Sort the date array in descending (reverse chronological) order.
- * @param dates
+ * @param dates array of dates
* @return sorted dates.
*/
protected static Date[] sortDatesDescending(Date[] dates)
@@ -145,7 +148,8 @@ public class StatisticsLoader
/**
* Get the analysis file for a given date.
- * @param date
+ * @param date date
+ * @return File
*/
public static File getAnalysisFor(String date)
{
@@ -156,7 +160,8 @@ public class StatisticsLoader
/**
* Get the report file for a given date.
- * @param date
+ * @param date date
+ * @return File
*/
public static File getReportFor(String date)
{
@@ -167,6 +172,7 @@ public class StatisticsLoader
/**
* Get the current general analysis file.
+ * @return File
*/
public static File getGeneralAnalysis()
{
@@ -176,6 +182,7 @@ public class StatisticsLoader
/**
* Get the current general report file.
+ * @return File
*/
public static File getGeneralReport()
{
@@ -213,7 +220,7 @@ public class StatisticsLoader
/**
* Generate the cached file list from the array of files
- * @param fileList
+ * @param fileList array of files
*/
private static synchronized void loadFileList(File[] fileList)
{
@@ -305,9 +312,10 @@ public class StatisticsLoader
* formatters are used to identify the file as a particular type,
* and extract the relevant information. If the file is not identified
* by the formatter provided, then we return null.
- * @param thisFile
- * @param thisPattern
- * @param sdf
+ * @param thisFile file
+ * @param thisPattern patter
+ * @param sdf date format
+ * @return StatsFile
*/
private static StatsFile makeStatsFile(File thisFile, Pattern thisPattern, DateFormat sdf)
{
@@ -336,10 +344,11 @@ public class StatisticsLoader
/**
* Get an array of all the analysis and report files.
+ * @return array of files
*/
private static File[] getAnalysisAndReportFileList()
{
- File reportDir = new File(ConfigurationManager.getProperty("log.dir"));
+ File reportDir = new File(ConfigurationManager.getProperty("log.report.dir"));
if (reportDir != null)
{
return reportDir.listFiles(new AnalysisAndReportFilter());
diff --git a/dspace-api/src/main/java/org/dspace/app/util/AuthorizeUtil.java b/dspace-api/src/main/java/org/dspace/app/util/AuthorizeUtil.java
index 735602e24b..c18dd0985f 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/AuthorizeUtil.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/AuthorizeUtil.java
@@ -43,10 +43,10 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param bitstream
* the bitstream that the policy refer to
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current context (current user) is not allowed to
* manage the bitstream's policies
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void authorizeManageBitstreamPolicy(Context context,
@@ -64,10 +64,10 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param bundle
* the bundle that the policy refer to
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current context (current user) is not allowed to
* manage the bundle's policies
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void authorizeManageBundlePolicy(Context context,
@@ -85,10 +85,10 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param item
* the item that the policy refer to
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current context (current user) is not allowed to
* manage the item's policies
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void authorizeManageItemPolicy(Context context, Item item)
@@ -124,10 +124,10 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param collection
* the collection that the policy refer to
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current context (current user) is not allowed to
* manage the collection's policies
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void authorizeManageCollectionPolicy(Context context,
@@ -159,10 +159,10 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param community
* the community that the policy refer to
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current context (current user) is not allowed to
* manage the community's policies
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void authorizeManageCommunityPolicy(Context context,
@@ -185,9 +185,9 @@ public class AuthorizeUtil
*
* @param context
* the DSpace Context Object
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current user is not a System Admin
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void requireAdminRole(Context context)
@@ -208,10 +208,10 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param item
* the item that the CC License refer to
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current user is not allowed to
* manage the item's CC License
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void authorizeManageCCLicense(Context context, Item item)
@@ -254,10 +254,10 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param collection
* the collection
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current user is not allowed to manage the collection's
* template item
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void authorizeManageTemplateItem(Context context,
@@ -296,10 +296,10 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param collection
* the collection
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current user is not allowed to manage the collection's
* submitters group
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void authorizeManageSubmittersGroup(Context context,
@@ -331,10 +331,10 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param collection
* the collection
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current user is not allowed to manage the collection's
* workflow groups
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void authorizeManageWorkflowsGroup(Context context,
@@ -368,10 +368,10 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param collection
* the collection
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current user is not allowed to create/edit the
* collection's admins group
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void authorizeManageAdminGroup(Context context,
@@ -405,10 +405,10 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param collection
* the collection
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current user is not allowed to remove the
* collection's admins group
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void authorizeRemoveAdminGroup(Context context,
@@ -439,10 +439,10 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param community
* the community
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current user is not allowed to create/edit the
* community's admins group
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void authorizeManageAdminGroup(Context context,
@@ -470,10 +470,10 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param community
* the community
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current user is not allowed to remove the
* collection's admins group
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void authorizeRemoveAdminGroup(Context context,
@@ -505,10 +505,10 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param rp
* a resource policy
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current context (current user) is not allowed to
* remove/edit the policy
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
*/
public static void authorizeManagePolicy(Context c, ResourcePolicy rp)
@@ -546,9 +546,9 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param item
* the item
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current user is not allowed to perform the item
* withdraw
*/
@@ -589,9 +589,9 @@ public class AuthorizeUtil
* the DSpace Context Object
* @param item
* the item
- * @throws SQLException
+ * @throws SQLException if database error
* if a db error occur
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if the current user is not allowed to perform the item
* reinstatement
*/
diff --git a/dspace-api/src/main/java/org/dspace/app/util/CollectionDropDown.java b/dspace-api/src/main/java/org/dspace/app/util/CollectionDropDown.java
index 0f8056a3ed..823f9390be 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/CollectionDropDown.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/CollectionDropDown.java
@@ -27,6 +27,7 @@ public class CollectionDropDown {
* @param col
* Get full path for this collection
* @return Full path to the collection
+ * @throws SQLException if database error
*/
public static String collectionPath(Collection col) throws SQLException
{
@@ -42,6 +43,7 @@ public class CollectionDropDown {
* @param maxchars
* Truncate the full path to maxchar characters. 0 means do not truncate.
* @return Full path to the collection (truncated)
+ * @throws SQLException if database error
*/
public static String collectionPath(Collection col, int maxchars) throws SQLException
{
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 f0c30ddf8e..f3281d284b 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
@@ -415,12 +415,12 @@ public class DCInput
* The closed attribute of the vocabulary tag for this field as set in
* input-forms.xml
*
- *
+ * {@code
*
* .....
* nsrc
*
- *
+ * }
* @return the closedVocabulary flags: true if the entry should be restricted
* only to vocabulary terms, false otherwise
*/
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 38caadee9a..752fcb1cfe 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
@@ -25,7 +25,11 @@ public class DCInputSet
/** the inputs ordered by page and row position */
private DCInput[][] inputPages = null;
- /** constructor */
+ /** constructor
+ * @param formName form name
+ * @param pages pages
+ * @param listMap map
+ */
public DCInputSet(String formName, List>> pages, Map> listMap)
{
this.formName = formName;
@@ -116,6 +120,7 @@ public class DCInputSet
* Does the current input set define the named field?
* Scan through every field in every page of the input set
*
+ * @param fieldName
* @return true if the current set has the named field
*/
public boolean isFieldPresent(String fieldName)
@@ -141,6 +146,8 @@ public class DCInputSet
* and is valid for the specified document type
* Scan through every field in every page of the input set
*
+ * @param fieldName field name
+ * @param documentType doc type
* @return true if the current set has the named field
*/
public boolean isFieldPresent(String fieldName, String documentType)
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 44c8602338..a9135f43d4 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
@@ -82,6 +82,7 @@ public class DCInputsReader
* level structures: a map between collections and forms, the definition for
* each page of each form, and lists of pairs of values that populate
* selection boxes.
+ * @throws DCInputsReaderException if input reader error
*/
public DCInputsReader()
diff --git a/dspace-api/src/main/java/org/dspace/app/util/DSpaceWebappMXBean.java b/dspace-api/src/main/java/org/dspace/app/util/DSpaceWebappMXBean.java
index 46c50b5744..05edc7b54c 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/DSpaceWebappMXBean.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/DSpaceWebappMXBean.java
@@ -15,15 +15,27 @@ package org.dspace.app.util;
*/
public interface DSpaceWebappMXBean
{
- /** Is this webapp a user interface? False if machine interface such as SWORD. */
+ /**
+ * Is this webapp a user interface? False if machine interface such as SWORD.
+ * @return true/false
+ */
public boolean isUI();
- /** What kind of webapp? XMLUI, OAI, etc. */
+ /**
+ * What kind of webapp? XMLUI, OAI, etc.
+ * @return kind of webapp
+ */
public String getKind();
- /** What is the base URL of this application? */
+ /**
+ * What is the base URL of this application?
+ * @return base url
+ */
public String getURL();
- /** When did this application start? */
+ /**
+ * When did this application start?
+ * @return start time
+ */
public String getStarted();
}
diff --git a/dspace-api/src/main/java/org/dspace/app/util/DailyFileAppender.java b/dspace-api/src/main/java/org/dspace/app/util/DailyFileAppender.java
index ff2a567c23..f4a152b547 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/DailyFileAppender.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/DailyFileAppender.java
@@ -235,7 +235,7 @@ public class DailyFileAppender extends FileAppender
/**
* This function is responsible for performing the actual file rollover.
* @param pstrName The name of the new folder based on current system date.
- * @throws IOException
+ * @throws IOException if IO error
*/
private static boolean deletingFiles = false;
private void cleanupOldFiles()
diff --git a/dspace-api/src/main/java/org/dspace/app/util/GoogleMetadata.java b/dspace-api/src/main/java/org/dspace/app/util/GoogleMetadata.java
index a1ca8612a1..0a05620f4c 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/GoogleMetadata.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/GoogleMetadata.java
@@ -31,10 +31,8 @@ import java.io.File;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashSet;
import java.util.List;
import java.util.Map.Entry;
-import java.util.Set;
import org.dspace.core.Constants;
import org.dspace.core.Context;
@@ -212,8 +210,9 @@ public class GoogleMetadata
* Wrap the item, parse all configured fields and generate metadata field
* values.
*
- * @param item
- * - The item being viewed to extract metadata from
+ * @param context context
+ * @param item The item being viewed to extract metadata from
+ * @throws SQLException if database error
*/
public GoogleMetadata(Context context, Item item) throws SQLException
{
@@ -330,7 +329,7 @@ public class GoogleMetadata
*
* @param configFilter
* @param returnType
- * @return Array of configuration -> item-field matches
+ * @return Array of configuration to item-field matches
*/
protected ArrayList resolveMetadata(String configFilter,
int returnType)
@@ -658,7 +657,7 @@ public class GoogleMetadata
/**
* Using metadata field mappings contained in the loaded configuration,
* parse through configured metadata fields, building valid Google metadata
- * value strings. Field names & values contained in metadataMappings.
+ * value strings. Field names and values contained in metadataMappings.
*
*/
protected void parseItem()
@@ -769,8 +768,8 @@ public class GoogleMetadata
* Fetch retaining the order of the values for any given key in which they
* where added (like authors).
*
- * Usage: GoogleMetadata gmd = new GoogleMetadata(item); for(Entry mapping : googlemd.getMappings()) { ... }
+ * Usage: {@code GoogleMetadata gmd = new GoogleMetadata(item); for(Entry mapping : googlemd.getMappings()) ...}
*
* @return Iterable of metadata fields mapped to Google-formatted values
*/
@@ -781,6 +780,7 @@ public class GoogleMetadata
/**
* Produce meta elements that can easily be put into the head.
+ * @return List of elements
*/
public List disseminateList()
{
@@ -1047,7 +1047,7 @@ public class GoogleMetadata
* Additionally, this bitstream must be publicly viewable.
* @param item
* @return
- * @throws SQLException
+ * @throws SQLException if database error
*/
protected Bitstream findLinkableFulltext(Item item) throws SQLException {
Bitstream bestSoFar = null;
@@ -1089,9 +1089,9 @@ public class GoogleMetadata
/**
*
*
- * @param FIELD
+ * @param field
* to aggregate all values of in a matching option
- * @param delim
+ * @param delimiter
* to delimit field values with
*/
protected void addAggregateValues(String field, String delimiter)
diff --git a/dspace-api/src/main/java/org/dspace/app/util/IndexVersion.java b/dspace-api/src/main/java/org/dspace/app/util/IndexVersion.java
index 81508ed878..3ef44fc11c 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/IndexVersion.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/IndexVersion.java
@@ -21,10 +21,10 @@ import org.apache.lucene.util.Version;
* so that they can be upgraded to the latest version.
*
* You must pass it the full path of the index directory, e.g.
- * [dspace]/solr/statistics/data/index/
+ * {@code [dspace]/solr/statistics/data/index/}
*
* The response is simply a version number (e.g. 4.4), as this is utilized by
- * the "ant update_solr_indexes" target in [src]/dspace/src/main/config/build.xml
+ * the {@code ant update_solr_indexes} target in {@code [src]/dspace/src/main/config/build.xml}
*
* @author tdonohue
*/
@@ -106,7 +106,7 @@ public class IndexVersion
* Full path of the Solr/Lucene index directory
* @return version as a string (e.g. "4.4"), empty string ("") if index directory is empty,
* or null if directory doesn't exist.
- * @throws IOException
+ * @throws IOException if IO error
*/
public static String getIndexVersion(String indexDirPath)
throws IOException
@@ -218,14 +218,14 @@ public class IndexVersion
*
* NOTE: In case it is not obvious, software version numbering does NOT
* behave like normal decimal numbers. For example, in software versions
- * the following statement is TRUE: 4.1 < 4.4 < 4.5 < 4.10 < 4.21 < 4.51
+ * the following statement is TRUE: {@code 4.1 < 4.4 < 4.5 < 4.10 < 4.21 < 4.51}
*
* @param firstVersion
* First version to compare, as a String
* @param secondVersion
* Second version to compare as a String
- * @return -1 if first < second, 1 if first > second, 0 if equal
- * @throws IOException
+ * @return -1 if first less than second, 1 if first greater than second, 0 if equal
+ * @throws IOException if IO error
*/
public static int compareSoftwareVersions(String firstVersion, String secondVersion)
throws IOException
diff --git a/dspace-api/src/main/java/org/dspace/app/util/OpenSearchServiceImpl.java b/dspace-api/src/main/java/org/dspace/app/util/OpenSearchServiceImpl.java
index def596d92c..7dc0695e26 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/OpenSearchServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/OpenSearchServiceImpl.java
@@ -127,7 +127,7 @@ public class OpenSearchServiceImpl implements OpenSearchService, InitializingBea
@Override
public String getResultsString(Context context, String format, String query, int totalResults, int start, int pageSize,
- DSpaceObject scope, DSpaceObject[] results,
+ DSpaceObject scope, List results,
Map labels) throws IOException
{
try
@@ -143,7 +143,7 @@ public class OpenSearchServiceImpl implements OpenSearchService, InitializingBea
@Override
public Document getResultsDoc(Context context, String format, String query, int totalResults, int start, int pageSize,
- DSpaceObject scope, DSpaceObject[] results, Map labels)
+ DSpaceObject scope, List results, Map labels)
throws IOException
{
try
@@ -158,7 +158,7 @@ public class OpenSearchServiceImpl implements OpenSearchService, InitializingBea
}
protected SyndicationFeed getResults(Context context, String format, String query, int totalResults, int start, int pageSize,
- DSpaceObject scope, DSpaceObject[] results, Map labels)
+ DSpaceObject scope, List results, Map labels)
{
// Encode results in requested format
if ("rss".equals(format))
@@ -283,7 +283,7 @@ public class OpenSearchServiceImpl implements OpenSearchService, InitializingBea
* Converts a JDOM document to a W3C one
* @param jdomDoc
* @return W3C Document object
- * @throws IOException
+ * @throws IOException if IO error
*/
protected Document jDomToW3(org.jdom.Document jdomDoc) throws IOException
{
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 9ff36acf3b..e2956b00a7 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
@@ -88,6 +88,7 @@ public class SubmissionConfigReader
/**
* Load Submission Configuration from the
* item-submission.xml configuration file
+ * @throws ServletException if servlet error
*/
public SubmissionConfigReader() throws ServletException
{
@@ -206,7 +207,7 @@ public class SubmissionConfigReader
/**
* Returns a particular global step definition based on its ID.
*
- * Global step definitions are those defined in the
+ * Global step definitions are those defined in the {@code }
* section of the configuration file.
*
* @param stepID
diff --git a/dspace-api/src/main/java/org/dspace/app/util/SubmissionInfo.java b/dspace-api/src/main/java/org/dspace/app/util/SubmissionInfo.java
index 4a34394006..14f0037ed9 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/SubmissionInfo.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/SubmissionInfo.java
@@ -213,7 +213,7 @@ public class SubmissionInfo extends HashMap
/**
* Returns a particular global step definition based on its ID.
*
- * Global step definitions are those defined in the
+ * Global step definitions are those defined in the {@code }
* section of the configuration file.
*
* @param stepID
diff --git a/dspace-api/src/main/java/org/dspace/app/util/SubmissionStepConfig.java b/dspace-api/src/main/java/org/dspace/app/util/SubmissionStepConfig.java
index eb26369983..cb7f97a862 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/SubmissionStepConfig.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/SubmissionStepConfig.java
@@ -100,8 +100,8 @@ public class SubmissionStepConfig implements Serializable
/**
* Get the ID for this step. An ID is only defined if the step exists in the
- * section. This ID field is used to reference special
- * steps (like the required step with id="collection")
+ * {@code } section. This ID field is used to reference special
+ * steps (like the required step with {@code id="collection"})
*
* @return the step ID
*/
diff --git a/dspace-api/src/main/java/org/dspace/app/util/SyndicationFeed.java b/dspace-api/src/main/java/org/dspace/app/util/SyndicationFeed.java
index f2ac96cc5b..b492e1851e 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/SyndicationFeed.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/SyndicationFeed.java
@@ -165,9 +165,14 @@ public class SyndicationFeed
/**
* Fills in the feed and entry-level metadata from DSpace objects.
+ * @param request request
+ * @param context context
+ * @param dso DSpaceObject
+ * @param items array of objects
+ * @param labels label map
*/
public void populate(HttpServletRequest request, Context context, DSpaceObject dso,
- DSpaceObject items[], Map labels)
+ List items, Map labels)
{
String logoURL = null;
String objectURL = null;
@@ -450,6 +455,7 @@ public class SyndicationFeed
* Sets the feed type for XML delivery, e.g. "rss_1.0", "atom_1.0"
* Must match one of ROME's configured generators, see rome.properties
* (currently rss_1.0, rss_2.0, atom_1.0, atom_0.3)
+ * @param feedType feed type
*/
public void setType(String feedType)
{
@@ -463,6 +469,7 @@ public class SyndicationFeed
/**
* @return the feed we built as DOM Document
+ * @throws FeedException if feed error
*/
public Document outputW3CDom()
throws FeedException
@@ -481,6 +488,7 @@ public class SyndicationFeed
/**
* @return the feed we built as serialized XML string
+ * @throws FeedException if feed error
*/
public String outputString()
throws FeedException
@@ -491,6 +499,9 @@ public class SyndicationFeed
/**
* send the output to designated Writer
+ * @param writer Writer
+ * @throws FeedException if feed error
+ * @throws IOException if IO error
*/
public void output(java.io.Writer writer)
throws FeedException, IOException
@@ -501,6 +512,7 @@ public class SyndicationFeed
/**
* Add a ROME plugin module (e.g. for OpenSearch) at the feed level.
+ * @param m module
*/
public void addModule(Module m)
{
@@ -523,17 +535,17 @@ public class SyndicationFeed
logo.getID()+"/"+(name == null?"":name);
}
+ protected String baseURL = null; // cache the result for null
/**
* Return a url to the DSpace object, either use the official
* handle for the item or build a url based upon the current server.
*
* If the dspaceobject is null then a local url to the repository is generated.
*
+ * @param request current servlet request
* @param dso The object to reference, null if to the repository.
- * @return
+ * @return URL
*/
- protected String baseURL = null; // cache the result for null
-
protected String resolveURL(HttpServletRequest request, DSpaceObject dso)
{
// If no object given then just link to the whole repository,
diff --git a/dspace-api/src/main/java/org/dspace/app/util/Util.java b/dspace-api/src/main/java/org/dspace/app/util/Util.java
index 81ce8d9f17..b355e9df93 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/Util.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/Util.java
@@ -89,6 +89,7 @@ public class Util {
* @param encoding
* character encoding, e.g. UTF-8
* @return the encoded string
+ * @throws java.io.UnsupportedEncodingException if encoding error
*/
public static String encodeBitstreamName(String stringIn, String encoding) throws java.io.UnsupportedEncodingException {
// FIXME: This should be moved elsewhere, as it is used outside the UI
@@ -164,6 +165,7 @@ public class Util {
* @param stringIn
* input string to encode
* @return the encoded string
+ * @throws java.io.UnsupportedEncodingException if encoding error
*/
public static String encodeBitstreamName(String stringIn) throws java.io.UnsupportedEncodingException {
return encodeBitstreamName(stringIn, Constants.DEFAULT_ENCODING);
@@ -455,7 +457,10 @@ public class Util {
* A String with the element name of the metadata field
* @param qualifier
* A String with the qualifier name of the metadata field
+ * @param locale locale
* @return A list of the respective "displayed-values"
+ * @throws SQLException if database error
+ * @throws DCInputsReaderException if reader error
*/
public static List getControlledVocabulariesDisplayValueLocalized(
diff --git a/dspace-api/src/main/java/org/dspace/app/util/WebApp.java b/dspace-api/src/main/java/org/dspace/app/util/WebApp.java
index 4c1adbc245..cb1aaf003e 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/WebApp.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/WebApp.java
@@ -8,6 +8,7 @@
package org.dspace.app.util;
import org.dspace.core.Context;
+import org.dspace.core.ReloadableEntity;
import javax.persistence.*;
import java.util.Date;
@@ -19,7 +20,7 @@ import java.util.Date;
*/
@Entity
@Table(name="webapp")
-public class WebApp {
+public class WebApp implements ReloadableEntity {
@Id
@@ -50,7 +51,7 @@ public class WebApp {
}
- public Integer getId() {
+ public Integer getID() {
return id;
}
diff --git a/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java b/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java
index 7089f884ab..b5533767ca 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java
@@ -25,9 +25,9 @@ public class XMLUtils
{
/**
*
- * @param rootElement
+ * @param dataRoot
* the starting node
- * @param subElementName
+ * @param name
* the name of the subelement to find
* @return the list of all DOM Element with the provided name direct child
* of the starting node
diff --git a/dspace-api/src/main/java/org/dspace/app/util/dao/WebAppDAO.java b/dspace-api/src/main/java/org/dspace/app/util/dao/WebAppDAO.java
index 0f2135c18f..671ebc6287 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/dao/WebAppDAO.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/dao/WebAppDAO.java
@@ -13,7 +13,7 @@ import org.dspace.core.GenericDAO;
/**
* Database Access Object interface class for the WebApp object.
* The implementation of this class is responsible for all database calls for the WebApp object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
diff --git a/dspace-api/src/main/java/org/dspace/app/util/service/MetadataExposureService.java b/dspace-api/src/main/java/org/dspace/app/util/service/MetadataExposureService.java
index a7e32f60a6..dfd646ff2c 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/service/MetadataExposureService.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/service/MetadataExposureService.java
@@ -58,7 +58,7 @@ public interface MetadataExposureService {
* @param qualifier metadata field qualifier
*
* @return true (hidden) or false (exposed)
- * @throws java.sql.SQLException
+ * @throws SQLException if database error
*/
public boolean isHidden(Context context, String schema, String element, String qualifier)
throws SQLException;
diff --git a/dspace-api/src/main/java/org/dspace/app/util/service/OpenSearchService.java b/dspace-api/src/main/java/org/dspace/app/util/service/OpenSearchService.java
index 0dee10d574..9b41d9c6f2 100644
--- a/dspace-api/src/main/java/org/dspace/app/util/service/OpenSearchService.java
+++ b/dspace-api/src/main/java/org/dspace/app/util/service/OpenSearchService.java
@@ -55,7 +55,7 @@ public interface OpenSearchService {
*
* @param scope - null for entire repository, or handle or community or collection
* @return document the service document
- * @throws java.io.IOException
+ * @throws IOException if IO error
*/
public Document getDescriptionDoc(String scope) throws IOException;
@@ -71,6 +71,7 @@ public interface OpenSearchService {
/**
* Returns a formatted set of search results as a string
*
+ * @param context DSpace Context
* @param format results format - html, rss or atom
* @param query - the search query
* @param totalResults - the hit count
@@ -80,14 +81,15 @@ public interface OpenSearchService {
* @param results the retreived DSpace objects satisfying search
* @param labels labels to apply - format specific
* @return formatted search results
- * @throws java.io.IOException
+ * @throws IOException if IO error
*/
public String getResultsString(Context context, String format, String query, int totalResults, int start, int pageSize,
- DSpaceObject scope, DSpaceObject[] results,
+ DSpaceObject scope, List results,
Map labels) throws IOException;
/**
* Returns a formatted set of search results as a document
*
+ * @param context DSpace Context
* @param format results format - html, rss or atom
* @param query - the search query
* @param totalResults - the hit count
@@ -97,10 +99,10 @@ public interface OpenSearchService {
* @param results the retreived DSpace objects satisfying search
* @param labels labels to apply - format specific
* @return formatted search results
- * @throws IOException
+ * @throws IOException if IO error
*/
public Document getResultsDoc(Context context, String format, String query, int totalResults, int start, int pageSize,
- DSpaceObject scope, DSpaceObject[] results, Map labels)
+ DSpaceObject scope, List results, Map labels)
throws IOException;
public DSpaceObject resolveScope(Context context, String scope) throws SQLException;
diff --git a/dspace-api/src/main/java/org/dspace/authenticate/AuthenticationMethod.java b/dspace-api/src/main/java/org/dspace/authenticate/AuthenticationMethod.java
index 8efeb4871d..7424a11fe7 100644
--- a/dspace-api/src/main/java/org/dspace/authenticate/AuthenticationMethod.java
+++ b/dspace-api/src/main/java/org/dspace/authenticate/AuthenticationMethod.java
@@ -74,6 +74,7 @@ public interface AuthenticationMethod {
* @param username
* Username, if available. May be null.
* @return true if new ePerson should be created.
+ * @throws SQLException if database error
*/
public boolean canSelfRegister(Context context,
HttpServletRequest request,
@@ -92,6 +93,7 @@ public interface AuthenticationMethod {
* @param eperson
* newly created EPerson record - email + information from the
* registration form will have been filled out.
+ * @throws SQLException if database error
*/
public void initEPerson(Context context,
HttpServletRequest request,
@@ -111,6 +113,7 @@ public interface AuthenticationMethod {
* @param username
* Username, if available. May be null.
* @return true if this method allows user to change ePerson password.
+ * @throws SQLException if database error
*/
public boolean allowSetPassword(Context context,
HttpServletRequest request,
@@ -149,6 +152,7 @@ public interface AuthenticationMethod {
*
* @return array of EPerson-group IDs, possibly 0-length, but never
* null
.
+ * @throws SQLException if database error
*/
public List getSpecialGroups(Context context, HttpServletRequest request)
throws SQLException;
@@ -185,6 +189,7 @@ public interface AuthenticationMethod {
*
CERT_REQUIRED - not allowed to login this way without X.509 cert.
*
NO_SUCH_USER - user not found using this method.
*
BAD_ARGS - user/pw not appropriate for this method
+ * @throws SQLException if database error
*/
public int authenticate(Context context,
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 9057fdb416..984904d35b 100644
--- a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java
+++ b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java
@@ -69,6 +69,7 @@ public class LDAPAuthentication
/**
* Let a real auth method return true if it wants.
+ * @throws SQLException if database error
*/
@Override
public boolean canSelfRegister(Context context,
@@ -81,7 +82,8 @@ public class LDAPAuthentication
}
/**
- * Nothing here, initialization is done when auto-registering.
+ * Nothing here, initialization is done when auto-registering.
+ * @throws SQLException if database error
*/
@Override
public void initEPerson(Context context, HttpServletRequest request,
@@ -94,6 +96,7 @@ public class LDAPAuthentication
/**
* Cannot change LDAP password through dspace, right?
+ * @throws SQLException if database error
*/
@Override
public boolean allowSetPassword(Context context,
diff --git a/dspace-api/src/main/java/org/dspace/authenticate/PasswordAuthentication.java b/dspace-api/src/main/java/org/dspace/authenticate/PasswordAuthentication.java
index cf0214abb3..c2050f1844 100644
--- a/dspace-api/src/main/java/org/dspace/authenticate/PasswordAuthentication.java
+++ b/dspace-api/src/main/java/org/dspace/authenticate/PasswordAuthentication.java
@@ -59,6 +59,8 @@ public class PasswordAuthentication
*
* Example - aber.ac.uk domain : @aber.ac.uk
* Example - MIT domain and all .ac.uk domains: @mit.edu, .ac.uk
+ * @param email email
+ * @throws SQLException if database error
*/
@Override
public boolean canSelfRegister(Context context,
@@ -95,6 +97,7 @@ public class PasswordAuthentication
/**
* Nothing extra to initialize.
+ * @throws SQLException if database error
*/
@Override
public void initEPerson(Context context, HttpServletRequest request,
@@ -105,6 +108,7 @@ public class PasswordAuthentication
/**
* We always allow the user to change their password.
+ * @throws SQLException if database error
*/
@Override
public boolean allowSetPassword(Context context,
@@ -196,6 +200,7 @@ public class PasswordAuthentication
*
CERT_REQUIRED - not allowed to login this way without X.509 cert.
*
NO_SUCH_USER - no EPerson with matching email address.
*
BAD_ARGS - missing username, or user matched but cannot login.
+ * @throws SQLException if database error
*/
@Override
public int authenticate(Context context,
diff --git a/dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java b/dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java
index 31e5793e39..d23c934f3a 100644
--- a/dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java
+++ b/dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java
@@ -159,6 +159,7 @@ public class ShibAuthentication implements AuthenticationMethod
*
* NO_SUCH_USER - user not found using this method.
* BAD_ARGS - user/pw not appropriate for this method
+ * @throws SQLException if database error
*/
@Override
public int authenticate(Context context, String username, String password,
@@ -266,7 +267,7 @@ public class ShibAuthentication implements AuthenticationMethod
*
* The values extracted (a user may have multiple roles) will be used to look
* up which groups to place the user into. The groups are defined as
- * "authentication.shib.role." which is a comma separated list of
+ * {@code authentication.shib.role.} which is a comma separated list of
* DSpace groups.
*
* @param context
@@ -400,6 +401,7 @@ public class ShibAuthentication implements AuthenticationMethod
* HTTP request, in case anything in that is used to decide
* @param email
* e-mail address of user attempting to register
+ * @throws SQLException if database error
*
*/
@Override
@@ -434,6 +436,7 @@ public class ShibAuthentication implements AuthenticationMethod
* HTTP request, in case anything in that is used to decide
* @param username
* e-mail address of user attempting to register
+ * @throws SQLException if database error
*
*/
@Override
@@ -456,6 +459,7 @@ public class ShibAuthentication implements AuthenticationMethod
* @param eperson
* newly created EPerson record - email + information from the
* registration form will have been filled out.
+ * @throws SQLException if database error
*
*/
@Override
@@ -578,6 +582,8 @@ public class ShibAuthentication implements AuthenticationMethod
* @param context The DSpace database context
* @param request The current HTTP Request
* @return The EPerson identified or null.
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
protected EPerson findEPerson(Context context, HttpServletRequest request) throws SQLException, AuthorizeException {
@@ -676,6 +682,8 @@ public class ShibAuthentication implements AuthenticationMethod
* @param context The current DSpace database context
* @param request The current HTTP Request
* @return A new eperson object or null if unable to create a new eperson.
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
protected EPerson registerNewEPerson(Context context, HttpServletRequest request) throws SQLException, AuthorizeException {
@@ -765,6 +773,8 @@ public class ShibAuthentication implements AuthenticationMethod
* @param context The current DSpace database context
* @param request The current HTTP Request
* @param eperson The eperson object to update.
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
protected void updateEPerson(Context context, HttpServletRequest request, EPerson eperson) throws SQLException, AuthorizeException {
@@ -855,6 +865,7 @@ public class ShibAuthentication implements AuthenticationMethod
* @param password The password
* @param request The HTTP Request
* @return A valid DSpace Authentication Method status code.
+ * @throws SQLException if database error
*/
protected int swordCompatibility(Context context, String username, String password, HttpServletRequest request) throws SQLException {
@@ -902,7 +913,8 @@ public class ShibAuthentication implements AuthenticationMethod
* the field will be automatically created.
*
* It is safe to call this methods multiple times.
- * @param context
+ * @param context context
+ * @throws SQLException if database error
*/
protected synchronized void initialize(Context context) throws SQLException {
@@ -964,8 +976,9 @@ public class ShibAuthentication implements AuthenticationMethod
* Check if a MetadataField for an eperson is available.
*
* @param metadataName The name of the metadata field.
- * @param context
+ * @param context context
* @return True if a valid metadata field, otherwise false.
+ * @throws SQLException if database error
*/
protected synchronized boolean checkIfEpersonMetadataFieldExists(Context context, String metadataName) throws SQLException {
@@ -984,10 +997,12 @@ public class ShibAuthentication implements AuthenticationMethod
protected final String COLUMN_NAME_REGEX = "^[_A-Za-z0-9]+$";
/**
- * Automattically create a new metadataField for an eperson
+ * Automatically create a new metadataField for an eperson
*
+ * @param context context
* @param metadataName The name of the new metadata field.
* @return True if successful, otherwise false.
+ * @throws SQLException if database error
*/
protected synchronized boolean autoCreateEpersonMetadataField(Context context, String metadataName) throws SQLException {
diff --git a/dspace-api/src/main/java/org/dspace/authenticate/X509Authentication.java b/dspace-api/src/main/java/org/dspace/authenticate/X509Authentication.java
index 2a99fc8047..dae6f3db71 100644
--- a/dspace-api/src/main/java/org/dspace/authenticate/X509Authentication.java
+++ b/dspace-api/src/main/java/org/dspace/authenticate/X509Authentication.java
@@ -387,6 +387,7 @@ public class X509Authentication implements AuthenticationMethod
* configuration value. You'll probably want this to be true to take
* advantage of a Web certificate infrastructure with many more users than
* are already known by DSpace.
+ * @throws SQLException if database error
*/
@Override
public boolean canSelfRegister(Context context, HttpServletRequest request,
@@ -398,6 +399,7 @@ public class X509Authentication implements AuthenticationMethod
/**
* Nothing extra to initialize.
+ * @throws SQLException if database error
*/
@Override
public void initEPerson(Context context, HttpServletRequest request,
@@ -407,6 +409,7 @@ public class X509Authentication implements AuthenticationMethod
/**
* We don't use EPerson password so there is no reason to change it.
+ * @throws SQLException if database error
*/
@Override
public boolean allowSetPassword(Context context,
@@ -486,11 +489,12 @@ public class X509Authentication implements AuthenticationMethod
* Return special groups configured in dspace.cfg for X509 certificate
* authentication.
*
- * @param context
+ * @param context context
* @param request
* object potentially containing the cert
*
* @return An int array of group IDs
+ * @throws SQLException if database error
*
*/
@Override
@@ -558,6 +562,7 @@ public class X509Authentication implements AuthenticationMethod
*
*
* @return One of: SUCCESS, BAD_CREDENTIALS, NO_SUCH_USER, BAD_ARGS
+ * @throws SQLException if database error
*/
@Override
public int authenticate(Context context, String username, String password,
diff --git a/dspace-api/src/main/java/org/dspace/authenticate/service/AuthenticationService.java b/dspace-api/src/main/java/org/dspace/authenticate/service/AuthenticationService.java
index db4113af90..a402fb26d6 100644
--- a/dspace-api/src/main/java/org/dspace/authenticate/service/AuthenticationService.java
+++ b/dspace-api/src/main/java/org/dspace/authenticate/service/AuthenticationService.java
@@ -128,13 +128,11 @@ public interface AuthenticationService {
* Invokes canSelfRegister()
of every authentication
* method in the stack, and returns true if any of them is true.
*
- * @param context
- * DSpace context
- * @param request
- * HTTP request, in case it's needed. Can be null.
- * @param username
- * Username, if available. Can be null.
+ * @param context DSpace context
+ * @param request HTTP request, in case it's needed. Can be null.
+ * @param username Username, if available. Can be null.
* @return true if new ePerson should be created.
+ * @throws SQLException if database error
*/
public boolean canSelfRegister(Context context,
HttpServletRequest request,
@@ -145,13 +143,11 @@ public interface AuthenticationService {
* Returns true if the allowSetPassword()
method of any
* member of the stack returns true.
*
- * @param context
- * DSpace context
- * @param request
- * HTTP request, in case it's needed. Can be null.
- * @param username
- * Username, if available. Can be null.
+ * @param context DSpace context
+ * @param request HTTP request, in case it's needed. Can be null.
+ * @param username Username, if available. Can be null.
* @return true if this method allows user to change ePerson password.
+ * @throws SQLException if database error
*/
public boolean allowSetPassword(Context context,
HttpServletRequest request,
@@ -168,15 +164,14 @@ public interface AuthenticationService {
* Returns accumulation of groups of all the getSpecialGroups()
* methods in the stack.
*
- * @param context
- * A valid DSpace context.
+ * @param context A valid DSpace context.
*
- * @param request
- * The request that started this operation, or null if not applicable.
+ * @param request The request that started this operation, or null if not applicable.
*
* @return Returns IDs of any groups the user authenticated by this
* request is in implicitly -- checks for e.g. network-address dependent
* groups.
+ * @throws SQLException if database error
*/
public List getSpecialGroups(Context context,
HttpServletRequest request) throws SQLException;
diff --git a/dspace-api/src/main/java/org/dspace/authority/AuthoritySolrServiceImpl.java b/dspace-api/src/main/java/org/dspace/authority/AuthoritySolrServiceImpl.java
index 9e6f58bd0b..84a553ffb1 100644
--- a/dspace-api/src/main/java/org/dspace/authority/AuthoritySolrServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/authority/AuthoritySolrServiceImpl.java
@@ -107,7 +107,7 @@ public class AuthoritySolrServiceImpl implements AuthorityIndexingService, Autho
/**
* Write the document to the solr index
* @param doc the solr document
- * @throws java.io.IOException
+ * @throws IOException if IO error
*/
protected void writeDocument(SolrInputDocument doc) throws IOException {
@@ -131,6 +131,7 @@ public class AuthoritySolrServiceImpl implements AuthorityIndexingService, Autho
/**
* Retrieves all the metadata fields which are indexed in the authority control
* @return a list of metadata fields
+ * @throws Exception if error
*/
@Override
public List getAllIndexedMetadataFields() throws Exception {
diff --git a/dspace-api/src/main/java/org/dspace/authority/AuthorityValue.java b/dspace-api/src/main/java/org/dspace/authority/AuthorityValue.java
index 0a085de0c0..5791fab9d4 100644
--- a/dspace-api/src/main/java/org/dspace/authority/AuthorityValue.java
+++ b/dspace-api/src/main/java/org/dspace/authority/AuthorityValue.java
@@ -148,6 +148,7 @@ public class AuthorityValue {
/**
* Generate a solr record from this instance
+ * @return SolrInputDocument
*/
public SolrInputDocument getSolrInputDocument() {
@@ -164,6 +165,7 @@ public class AuthorityValue {
/**
* Initialize this instance based on a solr record
+ * @param document SolrDocument
*/
public void setValues(SolrDocument document) {
this.id = String.valueOf(document.getFieldValue("id"));
@@ -176,6 +178,11 @@ public class AuthorityValue {
/**
* Replace an item's DCValue with this authority
+ * @param context context
+ * @param value metadata value
+ * @param currentItem item
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
public void updateItem(Context context, Item currentItem, MetadataValue value) throws SQLException, AuthorizeException {
value.setValue(getValue());
@@ -185,6 +192,7 @@ public class AuthorityValue {
/**
* Information that can be used the choice ui
+ * @return map
*/
public Map choiceSelectMap() {
return new HashMap();
@@ -242,6 +250,7 @@ public class AuthorityValue {
/**
* Provides a string that will be allow a this AuthorityType to be recognized and provides information to create a new instance to be created using public AuthorityValue newInstance(String info).
* See the implementation of com.atmire.org.dspace.authority.AuthorityValueGenerator#generateRaw(java.lang.String, java.lang.String) for more precisions.
+ * @return
*/
public String generateString() {
return AuthorityValueServiceImpl.GENERATE;
@@ -249,6 +258,8 @@ public class AuthorityValue {
/**
* Makes an instance of the AuthorityValue with the given information.
+ * @param info string info
+ * @return AuthorityValue
*/
public AuthorityValue newInstance(String info) {
return new AuthorityValue();
@@ -262,6 +273,8 @@ public class AuthorityValue {
* The regular equals() only checks if both AuthorityValues describe the same authority.
* This method checks if the AuthorityValues have different information
* E.g. it is used to decide when lastModified should be updated.
+ * @param o object
+ * @return true or false
*/
public boolean hasTheSameInformationAs(Object o) {
if (this == o) {
diff --git a/dspace-api/src/main/java/org/dspace/authority/AuthorityValueServiceImpl.java b/dspace-api/src/main/java/org/dspace/authority/AuthorityValueServiceImpl.java
index 7a820ec01d..875c3da4b8 100644
--- a/dspace-api/src/main/java/org/dspace/authority/AuthorityValueServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/authority/AuthorityValueServiceImpl.java
@@ -113,6 +113,9 @@ public class AuthorityValueServiceImpl implements AuthorityValueService{
/**
* Item.ANY does not work here.
+ * @param context Context
+ * @param authorityID authority id
+ * @return AuthorityValue
*/
@Override
public AuthorityValue findByUID(Context context, String authorityID) {
diff --git a/dspace-api/src/main/java/org/dspace/authority/indexer/DSpaceAuthorityIndexer.java b/dspace-api/src/main/java/org/dspace/authority/indexer/DSpaceAuthorityIndexer.java
index d0119af125..df8b23654c 100644
--- a/dspace-api/src/main/java/org/dspace/authority/indexer/DSpaceAuthorityIndexer.java
+++ b/dspace-api/src/main/java/org/dspace/authority/indexer/DSpaceAuthorityIndexer.java
@@ -26,15 +26,14 @@ import java.util.*;
/**
* DSpaceAuthorityIndexer is used in IndexClient, which is called by the AuthorityConsumer and the indexing-script.
- *
+ *
* An instance of DSpaceAuthorityIndexer is bound to a list of items.
* This can be one item or all items too depending on the init() method.
- *
+ *
* DSpaceAuthorityIndexer lets you iterate over each metadata value
* for each metadata field defined in dspace.cfg with 'authority.author.indexer.field'
* for each item in the list.
- *
- *
+ *
*
* @author Antoine Snyers (antoine at atmire.com)
* @author Kevin Van de Velde (kevin at atmire dot com)
@@ -170,6 +169,8 @@ public class DSpaceAuthorityIndexer implements AuthorityIndexerInterface, Initia
*
* @param metadataField Is one of the fields defined in dspace.cfg to be indexed.
* @param value Is one of the values of the given metadataField in one of the items being indexed.
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
protected void prepareNextValue(String metadataField, MetadataValue value) throws SQLException, AuthorizeException {
diff --git a/dspace-api/src/main/java/org/dspace/authority/orcid/OrcidAuthorityValue.java b/dspace-api/src/main/java/org/dspace/authority/orcid/OrcidAuthorityValue.java
index 245aec34e3..a36f4f5152 100644
--- a/dspace-api/src/main/java/org/dspace/authority/orcid/OrcidAuthorityValue.java
+++ b/dspace-api/src/main/java/org/dspace/authority/orcid/OrcidAuthorityValue.java
@@ -119,6 +119,8 @@ public class OrcidAuthorityValue extends PersonAuthorityValue {
/**
* Create an authority based on a given orcid bio
+ * @param bio Bio
+ * @return OrcidAuthorityValue
*/
public static OrcidAuthorityValue create(Bio bio) {
OrcidAuthorityValue authority = OrcidAuthorityValue.create();
diff --git a/dspace-api/src/main/java/org/dspace/authority/orcid/xml/Converter.java b/dspace-api/src/main/java/org/dspace/authority/orcid/xml/Converter.java
index b445013bc4..248720d95f 100644
--- a/dspace-api/src/main/java/org/dspace/authority/orcid/xml/Converter.java
+++ b/dspace-api/src/main/java/org/dspace/authority/orcid/xml/Converter.java
@@ -16,6 +16,7 @@ import org.w3c.dom.Document;
* @author Kevin Van de Velde (kevin at atmire dot com)
* @author Ben Bosman (ben at atmire dot com)
* @author Mark Diggory (markd at atmire dot com)
+ * @param type
*/
public abstract class Converter {
diff --git a/dspace-api/src/main/java/org/dspace/authority/rest/RestSource.java b/dspace-api/src/main/java/org/dspace/authority/rest/RestSource.java
index f6d99b4a50..2278ac24b4 100644
--- a/dspace-api/src/main/java/org/dspace/authority/rest/RestSource.java
+++ b/dspace-api/src/main/java/org/dspace/authority/rest/RestSource.java
@@ -26,12 +26,6 @@ public abstract class RestSource {
this.restConnector = new RESTConnector(url);
}
- /**
- * TODO
- * com.atmire.org.dspace.authority.rest.RestSource#queryAuthorities -> add field, so the source can decide whether to query /users or something else.
- * -> implement subclasses
- * -> implement usages
- */
public abstract List queryAuthorities(String text, int max);
public abstract AuthorityValue queryAuthorityID(String id);
diff --git a/dspace-api/src/main/java/org/dspace/authority/util/XMLUtils.java b/dspace-api/src/main/java/org/dspace/authority/util/XMLUtils.java
index 252d90584e..9a2861293d 100644
--- a/dspace-api/src/main/java/org/dspace/authority/util/XMLUtils.java
+++ b/dspace-api/src/main/java/org/dspace/authority/util/XMLUtils.java
@@ -41,8 +41,10 @@ public class XMLUtils {
/**
* @param xml The starting context (a Node or a Document, for example).
+ * @param singleNodeXPath xpath
* @return node.getTextContent() on the node that matches singleNodeXPath
* null if nothing matches the NodeListXPath
+ * @throws XPathExpressionException if xpath error
*/
public static String getTextContent(Node xml, String singleNodeXPath) throws XPathExpressionException {
String text = null;
@@ -56,8 +58,10 @@ public class XMLUtils {
/**
* @param xml The starting context (a Node or a Document, for example).
+ * @param NodeListXPath xpath
* @return A Node matches the NodeListXPath
* null if nothing matches the NodeListXPath
+ * @throws XPathExpressionException if xpath error
*/
public static Node getNode(Node xml, String NodeListXPath) throws XPathExpressionException {
Node result = null;
@@ -71,8 +75,10 @@ public class XMLUtils {
/**
* @param xml The starting context (a Node or a Document, for example).
+ * @param NodeListXPath xpath
* @return A NodeList containing the nodes that match the NodeListXPath
* null if nothing matches the NodeListXPath
+ * @throws XPathExpressionException if xpath error
*/
public static NodeList getNodeList(Node xml, String NodeListXPath) throws XPathExpressionException {
NodeList nodeList = null;
@@ -93,6 +99,8 @@ public class XMLUtils {
* that are element nodes:
* node.getNodeType() == Node.ELEMENT_NODE
* node instanceof Element
+ * @param nodeList NodeList
+ * @return iterator over nodes
*/
public static Iterator getNodeListIterator(final NodeList nodeList) {
return new Iterator() {
diff --git a/dspace-api/src/main/java/org/dspace/authorize/AuthorizeConfiguration.java b/dspace-api/src/main/java/org/dspace/authorize/AuthorizeConfiguration.java
index a879388236..6282a97c9d 100644
--- a/dspace-api/src/main/java/org/dspace/authorize/AuthorizeConfiguration.java
+++ b/dspace-api/src/main/java/org/dspace/authorize/AuthorizeConfiguration.java
@@ -174,6 +174,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to create new, not strictly community
* related, group?
+ * @return true/false
*/
public static boolean canCommunityAdminPerformGroupCreation()
{
@@ -182,6 +183,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to create collections or subcommunities?
+ * @return true/false
*/
public static boolean canCommunityAdminPerformSubelementCreation()
{
@@ -190,6 +192,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to remove collections or subcommunities?
+ * @return true/false
*/
public static boolean canCommunityAdminPerformSubelementDeletion()
{
@@ -199,6 +202,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to manage the community's and
* subcommunities' policies?
+ * @return true/false
*/
public static boolean canCommunityAdminManagePolicies()
{
@@ -208,6 +212,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to create/edit them community's and
* subcommunities' admin groups?
+ * @return true/false
*/
public static boolean canCommunityAdminManageAdminGroup()
{
@@ -217,6 +222,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to create/edit the community's and
* subcommunities' admin group?
+ * @return true/false
*/
public static boolean canCommunityAdminManageCollectionPolicies()
{
@@ -226,6 +232,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to manage the item template of them
* collections?
+ * @return true/false
*/
public static boolean canCommunityAdminManageCollectionTemplateItem()
{
@@ -235,6 +242,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to manage (create/edit/remove) the
* submitters group of them collections?
+ * @return true/false
*/
public static boolean canCommunityAdminManageCollectionSubmitters()
{
@@ -244,6 +252,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to manage (create/edit/remove) the workflows
* group of them collections?
+ * @return true/false
*/
public static boolean canCommunityAdminManageCollectionWorkflows()
{
@@ -253,6 +262,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to manage (create/edit/remove) the admin
* group of them collections?
+ * @return true/false
*/
public static boolean canCommunityAdminManageCollectionAdminGroup()
{
@@ -261,6 +271,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to remove an item from them collections?
+ * @return true/false
*/
public static boolean canCommunityAdminPerformItemDeletion()
{
@@ -269,6 +280,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to withdrawn an item from them collections?
+ * @return true/false
*/
public static boolean canCommunityAdminPerformItemWithdrawn()
{
@@ -278,6 +290,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to reinstate an item from them
* collections?
+ * @return true/false
*/
public static boolean canCommunityAdminPerformItemReinstatiate()
{
@@ -287,6 +300,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to manage the policies of an item owned by
* one of them collections?
+ * @return true/false
*/
public static boolean canCommunityAdminManageItemPolicies()
{
@@ -296,6 +310,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to add a bitstream to an item owned by one
* of them collections?
+ * @return true/false
*/
public static boolean canCommunityAdminPerformBitstreamCreation()
{
@@ -305,6 +320,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to remove a bitstream from an item owned by
* one of them collections?
+ * @return true/false
*/
public static boolean canCommunityAdminPerformBitstreamDeletion()
{
@@ -314,6 +330,7 @@ public class AuthorizeConfiguration
/**
* Are community admins allowed to perform CC License replace or addition to
* an item owned by one of them collections?
+ * @return true/false
*/
public static boolean canCommunityAdminManageCCLicense()
{
@@ -322,6 +339,7 @@ public class AuthorizeConfiguration
/**
* Are collection admins allowed to manage the collection's policies?
+ * @return true/false
*/
public static boolean canCollectionAdminManagePolicies()
{
@@ -331,6 +349,7 @@ public class AuthorizeConfiguration
/**
* Are collection admins allowed to manage (create/edit/delete) the
* collection's item template?
+ * @return true/false
*/
public static boolean canCollectionAdminManageTemplateItem()
{
@@ -340,6 +359,7 @@ public class AuthorizeConfiguration
/**
* Are collection admins allowed to manage (create/edit/delete) the
* collection's submitters group?
+ * @return true/false
*/
public static boolean canCollectionAdminManageSubmitters()
{
@@ -349,6 +369,7 @@ public class AuthorizeConfiguration
/**
* Are collection admins allowed to manage (create/edit/delete) the
* collection's workflows group?
+ * @return true/false
*/
public static boolean canCollectionAdminManageWorkflows()
{
@@ -358,6 +379,7 @@ public class AuthorizeConfiguration
/**
* Are collection admins allowed to manage (create/edit) the collection's
* admins group?
+ * @return true/false
*/
public static boolean canCollectionAdminManageAdminGroup()
{
@@ -366,6 +388,7 @@ public class AuthorizeConfiguration
/**
* Are collection admins allowed to remove an item from the collection?
+ * @return true/false
*/
public static boolean canCollectionAdminPerformItemDeletion()
{
@@ -374,6 +397,7 @@ public class AuthorizeConfiguration
/**
* Are collection admins allowed to withdrawn an item from the collection?
+ * @return true/false
*/
public static boolean canCollectionAdminPerformItemWithdrawn()
{
@@ -383,6 +407,7 @@ public class AuthorizeConfiguration
/**
* Are collection admins allowed to reinstate an item from the
* collection?
+ * @return true/false
*/
public static boolean canCollectionAdminPerformItemReinstatiate()
{
@@ -392,6 +417,7 @@ public class AuthorizeConfiguration
/**
* Are collection admins allowed to manage the policies of item owned by the
* collection?
+ * @return true/false
*/
public static boolean canCollectionAdminManageItemPolicies()
{
@@ -401,6 +427,7 @@ public class AuthorizeConfiguration
/**
* Are collection admins allowed to add a bitstream to an item owned by the
* collections?
+ * @return true/false
*/
public static boolean canCollectionAdminPerformBitstreamCreation()
{
@@ -410,6 +437,7 @@ public class AuthorizeConfiguration
/**
* Are collection admins allowed to remove a bitstream from an item owned by
* the collections?
+ * @return true/false
*/
public static boolean canCollectionAdminPerformBitstreamDeletion()
{
@@ -419,6 +447,7 @@ public class AuthorizeConfiguration
/**
* Are collection admins allowed to replace or adding a CC License to an
* item owned by the collections?
+ * @return true/false
*/
public static boolean canCollectionAdminManageCCLicense()
{
@@ -427,6 +456,7 @@ public class AuthorizeConfiguration
/**
* Are item admins allowed to manage the item's policies?
+ * @return true/false
*/
public static boolean canItemAdminManagePolicies()
{
@@ -435,6 +465,7 @@ public class AuthorizeConfiguration
/**
* Are item admins allowed to add bitstreams to the item?
+ * @return true/false
*/
public static boolean canItemAdminPerformBitstreamCreation()
{
@@ -443,6 +474,7 @@ public class AuthorizeConfiguration
/**
* Are item admins allowed to remove bitstreams from the item?
+ * @return true/false
*/
public static boolean canItemAdminPerformBitstreamDeletion()
{
@@ -451,6 +483,7 @@ public class AuthorizeConfiguration
/**
* Are item admins allowed to replace or adding CC License to the item?
+ * @return true/false
*/
public static boolean canItemAdminManageCCLicense()
{
diff --git a/dspace-api/src/main/java/org/dspace/authorize/AuthorizeException.java b/dspace-api/src/main/java/org/dspace/authorize/AuthorizeException.java
index c6179d41d7..6aec1199df 100644
--- a/dspace-api/src/main/java/org/dspace/authorize/AuthorizeException.java
+++ b/dspace-api/src/main/java/org/dspace/authorize/AuthorizeException.java
@@ -59,6 +59,8 @@ public class AuthorizeException extends Exception
*
* @param message
* the message
+ * @param o object
+ * @param a actionID
*/
public AuthorizeException(String message, DSpaceObject o, int a)
{
diff --git a/dspace-api/src/main/java/org/dspace/authorize/AuthorizeServiceImpl.java b/dspace-api/src/main/java/org/dspace/authorize/AuthorizeServiceImpl.java
index a33f5e9033..81343b6074 100644
--- a/dspace-api/src/main/java/org/dspace/authorize/AuthorizeServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/authorize/AuthorizeServiceImpl.java
@@ -228,7 +228,7 @@ public class AuthorizeServiceImpl implements AuthorizeService
* object can be used
* @return true
if user is authorized to perform the given
* action, false
otherwise
- * @throws SQLException
+ * @throws SQLException if database error
*/
protected boolean authorize(Context c, DSpaceObject o, int action, EPerson e, boolean useInheritance) throws SQLException
{
@@ -503,6 +503,8 @@ public class AuthorizeServiceImpl implements AuthorizeService
throws SQLException, AuthorizeException
{
// now add them to the destination object
+ List newPolicies = new LinkedList<>();
+
for (ResourcePolicy srp : policies)
{
ResourcePolicy rp = resourcePolicyService.create(c);
@@ -517,21 +519,17 @@ public class AuthorizeServiceImpl implements AuthorizeService
rp.setRpName(srp.getRpName());
rp.setRpDescription(srp.getRpDescription());
rp.setRpType(srp.getRpType());
- // and write out new policy
- resourcePolicyService.update(c, rp);
+
+ // and add policy to list of new policies
+ newPolicies.add(rp);
}
- serviceFactory.getDSpaceObjectService(dest).updateLastModified(c, dest);
+ resourcePolicyService.update(c, newPolicies);
}
@Override
public void removeAllPolicies(Context c, DSpaceObject o) throws SQLException, AuthorizeException {
- resourcePolicyService.removeAllPolicies(c, o, true);
- }
-
- @Override
- public void removeAllPolicies(Context c, DSpaceObject o, boolean updateLastModified) throws SQLException, AuthorizeException {
- resourcePolicyService.removeAllPolicies(c, o, updateLastModified);
+ resourcePolicyService.removeAllPolicies(c, o);
}
@Override
@@ -623,8 +621,8 @@ public class AuthorizeServiceImpl implements AuthorizeService
* @param reason
* @param dso
* @param owningCollection
- * @throws SQLException
- * @throws AuthorizeException
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public void generateAutomaticPolicies(Context context, Date embargoDate,
@@ -681,7 +679,6 @@ public class AuthorizeServiceImpl implements AuthorizeService
myPolicy.setEPerson(eperson);
myPolicy.setRpType(rpType);
resourcePolicyService.update(context, myPolicy);
- serviceFactory.getDSpaceObjectService(dso).updateLastModified(context, dso);
return myPolicy;
}
diff --git a/dspace-api/src/main/java/org/dspace/authorize/FixDefaultPolicies.java b/dspace-api/src/main/java/org/dspace/authorize/FixDefaultPolicies.java
index 5dd1232676..3862727c50 100644
--- a/dspace-api/src/main/java/org/dspace/authorize/FixDefaultPolicies.java
+++ b/dspace-api/src/main/java/org/dspace/authorize/FixDefaultPolicies.java
@@ -34,6 +34,8 @@ public class FixDefaultPolicies
{
/**
* Command line interface to setPolicies - run to see arguments
+ * @param argv arguments
+ * @throws Exception if error
*/
public static void main(String[] argv) throws Exception
{
diff --git a/dspace-api/src/main/java/org/dspace/authorize/PolicySet.java b/dspace-api/src/main/java/org/dspace/authorize/PolicySet.java
index 88a93c2f3f..6dbdcbeba4 100644
--- a/dspace-api/src/main/java/org/dspace/authorize/PolicySet.java
+++ b/dspace-api/src/main/java/org/dspace/authorize/PolicySet.java
@@ -43,6 +43,8 @@ public class PolicySet
/**
* Command line interface to setPolicies - run to see arguments
+ * @param argv arguments
+ * @throws Exception if error
*/
public static void main(String[] argv) throws Exception
{
@@ -111,9 +113,9 @@ public class PolicySet
* @param clearOnly
* if true
, just delete policies for matching
* objects
- * @throws SQLException
+ * @throws SQLException if database error
* if database problem
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if current user is not authorized to change these policies
*/
public static void setPolicies(Context c, int containerType,
@@ -139,8 +141,8 @@ public class PolicySet
* @param description
* @param startDate
* @param endDate
- * @throws SQLException
- * @throws AuthorizeException
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
public static void setPolicies(Context c, int containerType,
UUID containerID, int contentType, int actionID, UUID groupID,
@@ -175,9 +177,9 @@ public class PolicySet
* objects
* @param filter
* if non-null, only process bitstreams whose names contain filter
- * @throws SQLException
+ * @throws SQLException if database error
* if database problem
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if current user is not authorized to change these policies
*/
public static void setPoliciesFilter(Context c, int containerType,
@@ -215,9 +217,9 @@ public class PolicySet
* @param description
* @param startDate
* @param endDate
- * @throws SQLException
+ * @throws SQLException if database error
* if database problem
- * @throws AuthorizeException
+ * @throws AuthorizeException if authorization error
* if current user is not authorized to change these policies
*/
public static void setPoliciesFilter(Context c, int containerType,
diff --git a/dspace-api/src/main/java/org/dspace/authorize/ResourcePolicy.java b/dspace-api/src/main/java/org/dspace/authorize/ResourcePolicy.java
index eb6d8f8809..4a11838d7b 100644
--- a/dspace-api/src/main/java/org/dspace/authorize/ResourcePolicy.java
+++ b/dspace-api/src/main/java/org/dspace/authorize/ResourcePolicy.java
@@ -10,6 +10,7 @@ package org.dspace.authorize;
import org.apache.commons.lang.ObjectUtils;
import org.dspace.content.DSpaceObject;
import org.dspace.core.Context;
+import org.dspace.core.ReloadableEntity;
import org.dspace.eperson.EPerson;
import org.dspace.eperson.Group;
import org.hibernate.annotations.Type;
@@ -25,7 +26,7 @@ import java.util.Date;
*/
@Entity
@Table(name="resourcepolicy")
-public class ResourcePolicy{
+public class ResourcePolicy implements ReloadableEntity {
public static String TYPE_SUBMISSION = "TYPE_SUBMISSION";
public static String TYPE_WORKFLOW = "TYPE_WORKFLOW";
public static String TYPE_CUSTOM= "TYPE_CUSTOM";
@@ -203,6 +204,7 @@ public class ResourcePolicy{
/**
* assign an EPerson to this policy
+ * @param eperson Eperson
*/
public void setEPerson(EPerson eperson)
{
@@ -221,6 +223,7 @@ public class ResourcePolicy{
/**
* sets ID for Group referred to by this policy
+ * @param epersonGroup Group
*/
public void setGroup(Group epersonGroup)
{
diff --git a/dspace-api/src/main/java/org/dspace/authorize/ResourcePolicyServiceImpl.java b/dspace-api/src/main/java/org/dspace/authorize/ResourcePolicyServiceImpl.java
index 8c9feafa00..0277902368 100644
--- a/dspace-api/src/main/java/org/dspace/authorize/ResourcePolicyServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/authorize/ResourcePolicyServiceImpl.java
@@ -7,13 +7,9 @@
*/
package org.dspace.authorize;
-import java.sql.SQLException;
-import java.util.Date;
-import java.util.List;
-
+import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.ObjectUtils;
import org.apache.log4j.Logger;
-
import org.dspace.authorize.dao.ResourcePolicyDAO;
import org.dspace.authorize.service.ResourcePolicyService;
import org.dspace.content.DSpaceObject;
@@ -24,6 +20,9 @@ import org.dspace.eperson.EPerson;
import org.dspace.eperson.Group;
import org.springframework.beans.factory.annotation.Autowired;
+import java.sql.SQLException;
+import java.util.*;
+
/**
* Service implementation for the ResourcePolicy object.
* This class is responsible for all business logic calls for the ResourcePolicy object and is autowired by spring.
@@ -55,6 +54,7 @@ public class ResourcePolicyServiceImpl implements ResourcePolicyService
* ID of the ResourcePolicy
*
* @return the ResourcePolicy format, or null if the ID is invalid.
+ * @throws SQLException if database error
*/
@Override
public ResourcePolicy find(Context context, int id) throws SQLException
@@ -67,6 +67,8 @@ public class ResourcePolicyServiceImpl implements ResourcePolicyService
*
* @param context
* DSpace context object
+ * @return ResourcePolicy
+ * @throws SQLException if database error
*/
@Override
public ResourcePolicy create(Context context) throws SQLException
@@ -109,6 +111,10 @@ public class ResourcePolicyServiceImpl implements ResourcePolicyService
/**
* Delete an ResourcePolicy
*
+ * @param context context
+ * @param resourcePolicy resource policy
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public void delete(Context context, ResourcePolicy resourcePolicy) throws SQLException, AuthorizeException {
@@ -125,6 +131,7 @@ public class ResourcePolicyServiceImpl implements ResourcePolicyService
/**
+ * @param resourcePolicy resource policy
* @return action text or 'null' if action row empty
*/
@Override
@@ -144,6 +151,7 @@ public class ResourcePolicyServiceImpl implements ResourcePolicyService
/**
* figures out if the date is valid for the policy
*
+ * @param resourcePolicy resource policy
* @return true if policy has begun and hasn't expired yet (or no dates are
* set)
*/
@@ -195,17 +203,7 @@ public class ResourcePolicyServiceImpl implements ResourcePolicyService
@Override
public void removeAllPolicies(Context c, DSpaceObject o) throws SQLException, AuthorizeException {
- // FIXME: authorization check?
- removeAllPolicies(c, o, true);
- }
-
- @Override
- public void removeAllPolicies(Context c, DSpaceObject o, boolean updateLastModified) throws SQLException, AuthorizeException {
- // FIXME: authorization check?
- if(updateLastModified)
- {
- contentServiceFactory.getDSpaceObjectService(o).updateLastModified(c, o);
- }
+ contentServiceFactory.getDSpaceObjectService(o).updateLastModified(c, o);
resourcePolicyDAO.deleteByDso(c, o);
}
@@ -253,15 +251,38 @@ public class ResourcePolicyServiceImpl implements ResourcePolicyService
/**
* Update the ResourcePolicy
+ * @param context context
+ * @param resourcePolicy resource policy
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public void update(Context context, ResourcePolicy resourcePolicy) throws SQLException, AuthorizeException {
- if(resourcePolicy.getdSpaceObject() != null){
- //A policy for a DSpace Object has been modified, fire a modify event on the DSpace object
- contentServiceFactory.getDSpaceObjectService(resourcePolicy.getdSpaceObject()).updateLastModified(context, resourcePolicy.getdSpaceObject());
- }
+ update(context, Collections.singletonList(resourcePolicy));
+ }
- // FIXME: Check authorisation
- resourcePolicyDAO.save(context, resourcePolicy);
+ /**
+ * Update the ResourcePolicies
+ */
+ @Override
+ public void update(Context context, List resourcePolicies) throws SQLException, AuthorizeException {
+ if(CollectionUtils.isNotEmpty(resourcePolicies)) {
+ Set relatedDSpaceObjects = new HashSet<>();
+
+ for (ResourcePolicy resourcePolicy : resourcePolicies) {
+ if (resourcePolicy.getdSpaceObject() != null) {
+ relatedDSpaceObjects.add(resourcePolicy.getdSpaceObject());
+ }
+
+ // FIXME: Check authorisation
+ resourcePolicyDAO.save(context, resourcePolicy);
+ }
+
+ //Update the last modified timestamp of all related DSpace Objects
+ for (DSpaceObject dSpaceObject : relatedDSpaceObjects) {
+ //A policy for a DSpace Object has been modified, fire a modify event on the DSpace object
+ contentServiceFactory.getDSpaceObjectService(dSpaceObject).updateLastModified(context, dSpaceObject);
+ }
+ }
}
}
diff --git a/dspace-api/src/main/java/org/dspace/authorize/dao/ResourcePolicyDAO.java b/dspace-api/src/main/java/org/dspace/authorize/dao/ResourcePolicyDAO.java
index 6c7fe656f9..a75628a5c3 100644
--- a/dspace-api/src/main/java/org/dspace/authorize/dao/ResourcePolicyDAO.java
+++ b/dspace-api/src/main/java/org/dspace/authorize/dao/ResourcePolicyDAO.java
@@ -20,7 +20,7 @@ import java.util.List;
/**
* Database Access Object interface class for the ResourcePolicy object.
* The implementation of this class is responsible for all database calls for the ResourcePolicy object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
diff --git a/dspace-api/src/main/java/org/dspace/authorize/dao/impl/ResourcePolicyDAOImpl.java b/dspace-api/src/main/java/org/dspace/authorize/dao/impl/ResourcePolicyDAOImpl.java
index 8cf3805a2b..bdb67edf07 100644
--- a/dspace-api/src/main/java/org/dspace/authorize/dao/impl/ResourcePolicyDAOImpl.java
+++ b/dspace-api/src/main/java/org/dspace/authorize/dao/impl/ResourcePolicyDAOImpl.java
@@ -113,9 +113,9 @@ public class ResourcePolicyDAOImpl extends AbstractHibernateDAO
@Override
public void deleteByDsoAndType(Context context, DSpaceObject dso, String type) throws SQLException {
- String queryString = "delete from ResourcePolicy where dSpaceObject= :dso AND rptype = :rptype";
+ String queryString = "delete from ResourcePolicy where dSpaceObject.id = :dsoId AND rptype = :rptype";
Query query = createQuery(context, queryString);
- query.setParameter("dso", dso);
+ query.setParameter("dsoId", dso.getID());
query.setString("rptype", type);
query.executeUpdate();
}
diff --git a/dspace-api/src/main/java/org/dspace/authorize/service/AuthorizeService.java b/dspace-api/src/main/java/org/dspace/authorize/service/AuthorizeService.java
index fd780c9e17..e6d4d02616 100644
--- a/dspace-api/src/main/java/org/dspace/authorize/service/AuthorizeService.java
+++ b/dspace-api/src/main/java/org/dspace/authorize/service/AuthorizeService.java
@@ -7,10 +7,6 @@
*/
package org.dspace.authorize.service;
-import java.sql.SQLException;
-import java.util.Date;
-import java.util.List;
-
import org.dspace.authorize.AuthorizeException;
import org.dspace.authorize.ResourcePolicy;
import org.dspace.content.Collection;
@@ -19,6 +15,10 @@ import org.dspace.core.Context;
import org.dspace.eperson.EPerson;
import org.dspace.eperson.Group;
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.List;
+
/**
* AuthorizeManager handles all authorization checks for DSpace. For better
* security, DSpace assumes that you do not have the right to do something
@@ -41,16 +41,13 @@ public interface AuthorizeService {
* perform all of the specified actions on the given object. An
* AuthorizeException
if all the authorizations fail.
*
- * @param c
- * context with the current user
- * @param o
- * DSpace object user is attempting to perform action on
- * @param actions
- * array of action IDs from
+ * @param c context with the current user
+ * @param o DSpace object user is attempting to perform action on
+ * @param actions array of action IDs from
* org.dspace.core.Constants
- * @throws AuthorizeException
- * if any one of the specified actions cannot be performed by
- * the current user on the given object.
+ * @throws AuthorizeException if any one of the specified actions cannot be
+ * performed by the current user on the given object.
+ * @throws SQLException if database error
*/
public void authorizeAnyOf(Context c, DSpaceObject o, int[] actions) throws AuthorizeException, SQLException;
@@ -59,14 +56,11 @@ public interface AuthorizeService {
* the given object. Throws an exception if the user is not authorized,
* otherwise the method call does nothing.
*
- * @param c
- * context
- * @param o
- * a DSpaceObject
- * @param action
- * action to perform from org.dspace.core.Constants
- * @throws AuthorizeException
- * if the user is denied
+ * @param c context
+ * @param o a DSpaceObject
+ * @param action action to perform from org.dspace.core.Constants
+ * @throws AuthorizeException if the user is denied
+ * @throws SQLException if database error
*/
public void authorizeAction(Context c, DSpaceObject o, int action) throws AuthorizeException, SQLException;
@@ -75,17 +69,14 @@ public interface AuthorizeService {
* the given object. Throws an exception if the user is not authorized,
* otherwise the method call does nothing.
*
- * @param c
- * context
- * @param o
- * a DSpaceObject
+ * @param c context
+ * @param o a DSpaceObject
* @param useInheritance
* flag to say if ADMIN action on the current object or parent
* object can be used
- * @param action
- * action to perform from org.dspace.core.Constants
- * @throws AuthorizeException
- * if the user is denied
+ * @param action action to perform from org.dspace.core.Constants
+ * @throws AuthorizeException if the user is denied
+ * @throws SQLException if database error
*/
public void authorizeAction(Context c, DSpaceObject o, int action, boolean useInheritance)
throws AuthorizeException, SQLException;
@@ -95,19 +86,15 @@ public interface AuthorizeService {
* the given object. Throws an exception if the user is not authorized,
* otherwise the method call does nothing.
*
- * @param c
- * context
- * @param e
- * the eperson to use for the authorization check
- * @param o
- * a DSpaceObject
+ * @param c context
+ * @param e the eperson to use for the authorization check
+ * @param o a DSpaceObject
* @param useInheritance
* flag to say if ADMIN action on the current object or parent
* object can be used
- * @param action
- * action to perform from org.dspace.core.Constants
- * @throws AuthorizeException
- * if the user is denied
+ * @param action action to perform from org.dspace.core.Constants
+ * @throws AuthorizeException if the user is denied
+ * @throws SQLException if database error
*/
public void authorizeAction(Context c, EPerson e, DSpaceObject o, int action, boolean useInheritance)
throws AuthorizeException, SQLException;
@@ -116,15 +103,13 @@ public interface AuthorizeService {
* same authorize, returns boolean for those who don't want to deal with
* catching exceptions.
*
- * @param c
- * DSpace context, containing current user
- * @param o
- * DSpaceObject
- * @param a
- * action being attempted, from
+ * @param c DSpace context, containing current user
+ * @param o DSpaceObject
+ * @param a action being attempted, from
* org.dspace.core.Constants
* @return true
if the current user in the context is
* authorized to perform the given action on the given object
+ * @throws SQLException if database error
*/
public boolean authorizeActionBoolean(Context c, DSpaceObject o, int a) throws SQLException;
@@ -132,18 +117,16 @@ public interface AuthorizeService {
* same authorize, returns boolean for those who don't want to deal with
* catching exceptions.
*
- * @param c
- * DSpace context, containing current user
- * @param o
- * DSpaceObject
- * @param a
- * action being attempted, from
+ * @param c DSpace context, containing current user
+ * @param o DSpaceObject
+ * @param a action being attempted, from
* org.dspace.core.Constants
* @param useInheritance
* flag to say if ADMIN action on the current object or parent
* object can be used
* @return true
if the current user in the context is
* authorized to perform the given action on the given object
+ * @throws SQLException if database error
*/
public boolean authorizeActionBoolean(Context c, DSpaceObject o, int a, boolean useInheritance) throws SQLException;
@@ -151,20 +134,17 @@ public interface AuthorizeService {
* same authorize with a specif eperson (not the current user), returns boolean for those who don't want to deal with
* catching exceptions.
*
- * @param c
- * DSpace context
- * @param e
- * EPerson to use in the check
- * @param o
- * DSpaceObject
- * @param a
- * action being attempted, from
+ * @param c DSpace context
+ * @param e EPerson to use in the check
+ * @param o DSpaceObject
+ * @param a action being attempted, from
* org.dspace.core.Constants
* @param useInheritance
* flag to say if ADMIN action on the current object or parent
* object can be used
* @return true
if the requested user is
* authorized to perform the given action on the given object
+ * @throws SQLException if database error
*/
public boolean authorizeActionBoolean(Context c, EPerson e, DSpaceObject o, int a, boolean useInheritance) throws SQLException;
@@ -177,14 +157,13 @@ public interface AuthorizeService {
* within DSpace. Always return true
if the user is a System
* Admin
*
- * @param c
- * current context
- * @param o
- * current DSpace Object, if null
the call will be
+ * @param c current context
+ * @param o current DSpace Object, if null
the call will be
* equivalent to a call to the isAdmin(Context c)
* method
* @return true
if user has administrative privileges on the
* given DSpace object
+ * @throws SQLException if database error
*/
public boolean isAdmin(Context c, DSpaceObject o) throws SQLException;
@@ -194,10 +173,10 @@ public interface AuthorizeService {
* true
if c.ignoreAuthorization is set. Anonymous users
* can't be Admins (EPerson set to NULL)
*
- * @param c
- * current context
+ * @param c current context
* @return true
if user is an admin or ignore authorization
* flag set
+ * @throws SQLException if database error
*/
public boolean isAdmin(Context c) throws SQLException;
@@ -208,16 +187,12 @@ public interface AuthorizeService {
/**
* Add a policy for an individual eperson
*
- * @param c
- * context. Current user irrelevant
- * @param o
- * DSpaceObject to add policy to
- * @param actionID
- * ID of action from org.dspace.core.Constants
- * @param e
- * eperson who can perform the action
- * @throws AuthorizeException
- * if current user in context is not authorized to add policies
+ * @param c context. Current user irrelevant
+ * @param o DSpaceObject to add policy to
+ * @param actionID ID of action from org.dspace.core.Constants
+ * @param e eperson who can perform the action
+ * @throws SQLException if database error
+ * @throws AuthorizeException if current user in context is not authorized to add policies
*/
public void addPolicy(Context c, DSpaceObject o, int actionID, EPerson e) throws SQLException, AuthorizeException;
@@ -225,175 +200,134 @@ public interface AuthorizeService {
/**
* Add a policy for an individual eperson
*
- * @param c
- * context. Current user irrelevant
- * @param o
- * DSpaceObject to add policy to
- * @param actionID
- * ID of action from org.dspace.core.Constants
- * @param e
- * eperson who can perform the action
- * @param type
- * policy type, deafult types are declared in the ResourcePolicy class
- * @throws AuthorizeException
- * if current user in context is not authorized to add policies
+ * @param c context. Current user irrelevant
+ * @param o DSpaceObject to add policy to
+ * @param actionID ID of action from org.dspace.core.Constants
+ * @param e eperson who can perform the action
+ * @param type policy type, deafult types are declared in the ResourcePolicy class
+ * @throws SQLException if database error
+ * @throws AuthorizeException if current user in context is not authorized to add policies
*/
public void addPolicy(Context c, DSpaceObject o, int actionID, EPerson e, String type) throws SQLException, AuthorizeException;
/**
* Add a policy for a group
*
- * @param c
- * current context
- * @param o
- * object to add policy for
- * @param actionID
- * ID of action from org.dspace.core.Constants
- * @param g
- * group to add policy for
- * @throws SQLException
- * if there's a database problem
- * @throws AuthorizeException
- * if the current user is not authorized to add this policy
+ * @param c current context
+ * @param o object to add policy for
+ * @param actionID ID of action from org.dspace.core.Constants
+ * @param g group to add policy for
+ * @throws SQLException if there's a database problem
+ * @throws AuthorizeException if the current user is not authorized to add this policy
*/
public void addPolicy(Context c, DSpaceObject o, int actionID, Group g) throws SQLException, AuthorizeException;
/**
* Add a policy for a group
*
- * @param c
- * current context
- * @param o
- * object to add policy for
- * @param actionID
- * ID of action from org.dspace.core.Constants
- * @param g
- * group to add policy for
- * @param type
- * policy type, deafult types are declared in the ResourcePolicy class
- * @throws SQLException
- * if there's a database problem
- * @throws AuthorizeException
- * if the current user is not authorized to add this policy
+ * @param c current context
+ * @param o object to add policy for
+ * @param actionID ID of action from org.dspace.core.Constants
+ * @param g group to add policy for
+ * @param type policy type, deafult types are declared in the ResourcePolicy class
+ * @throws SQLException if there's a database problem
+ * @throws AuthorizeException if the current user is not authorized to add this policy
*/
public void addPolicy(Context c, DSpaceObject o, int actionID, Group g, String type) throws SQLException, AuthorizeException;
/**
* Return a List of the policies for an object
*
- * @param c
- * current context
- * @param o
- * object to retrieve policies for
+ * @param c current context
+ * @param o object to retrieve policies for
* @return List of ResourcePolicy
objects
+ * @throws SQLException if database error
*/
public List getPolicies(Context c, DSpaceObject o) throws SQLException;
/**
* Return a List of the policies for an object
*
- * @param c
- * current context
- * @param o
- * object to retrieve policies for
+ * @param c current context
+ * @param o object to retrieve policies for
+ * @param type type
* @return List of ResourcePolicy
objects
+ * @throws SQLException if database error
*/
public List findPoliciesByDSOAndType(Context c, DSpaceObject o, String type) throws SQLException;
/**
* Return a List of the policies for a group
*
- * @param c
- * current context
- * @param g
- * group to retrieve policies for
+ * @param c current context
+ * @param g group to retrieve policies for
* @return List of ResourcePolicy
objects
+ * @@throws SQLException if database error
*/
public List getPoliciesForGroup(Context c, Group g) throws SQLException;
/**
* Return a list of policies for an object that match the action
*
- * @param c
- * context
- * @param o
- * DSpaceObject policies relate to
- * @param actionID
- * action (defined in class Constants)
- * @throws SQLException
- * if there's a database problem
+ * @param c context
+ * @param o DSpaceObject policies relate to
+ * @param actionID action (defined in class Constants)
+ * @return list of resource policies
+ * @throws SQLException if there's a database problem
*/
public List getPoliciesActionFilter(Context c, DSpaceObject o, int actionID) throws SQLException;
/**
* Add policies to an object to match those from a previous object
*
- * @param c
- * context
- * @param src
- * source of policies
- * @param dest
- * destination of inherited policies
- * @throws SQLException
- * if there's a database problem
- * @throws AuthorizeException
- * if the current user is not authorized to add these policies
+ * @param c context
+ * @param src source of policies
+ * @param dest destination of inherited policies
+ * @throws SQLException if there's a database problem
+ * @throws AuthorizeException if the current user is not authorized to add these policies
*/
public void inheritPolicies(Context c, DSpaceObject src, DSpaceObject dest) throws SQLException, AuthorizeException;
/**
* Copies policies from a list of resource policies to a given DSpaceObject
*
- * @param c
- * DSpace context
- * @param policies
- * List of ResourcePolicy objects
- * @param dest
- * object to have policies added
- * @throws SQLException
- * if there's a database problem
- * @throws AuthorizeException
- * if the current user is not authorized to add these policies
+ * @param c DSpace context
+ * @param policies List of ResourcePolicy objects
+ * @param dest object to have policies added
+ * @throws SQLException if there's a database problem
+ * @throws AuthorizeException if the current user is not authorized to add these policies
*/
public void addPolicies(Context c, List policies, DSpaceObject dest) throws SQLException, AuthorizeException;
/**
* removes ALL policies for an object. FIXME doesn't check authorization
*
- * @param c
- * DSpace context
- * @param o
- * object to remove policies for
- * @throws SQLException
- * if there's a database problem
+ * @param c DSpace context
+ * @param o object to remove policies for
+ * @throws SQLException if there's a database problem
+ * @throws AuthorizeException if authorization error
*/
public void removeAllPolicies(Context c, DSpaceObject o) throws SQLException, AuthorizeException;
- public void removeAllPolicies(Context c, DSpaceObject o, boolean updateLastModified) throws SQLException, AuthorizeException;
-
/**
* removes ALL policies for an object that are not of the input type.
*
- * @param c
- * DSpace context
- * @param o
- * object to remove policies for
- * @throws SQLException
- * if there's a database problem
+ * @param c DSpace context
+ * @param o object to remove policies for
+ * @param type type
+ * @throws SQLException if there's a database problem
+ * @throws AuthorizeException if authorization error
*/
public void removeAllPoliciesByDSOAndTypeNotEqualsTo(Context c, DSpaceObject o, String type) throws SQLException, AuthorizeException;
/**
* removes policies
*
- * @param c
- * DSpace context
- * @param o
- * object to remove policies for
- * @param type
- * policy type
- * @throws SQLException
- * if there's a database problem
+ * @param c DSpace context
+ * @param o object to remove policies for
+ * @param type policy type
+ * @throws SQLException if there's a database problem
+ * @throws AuthorizeException if authorization error
*/
public void removeAllPoliciesByDSOAndType(Context c, DSpaceObject o, String type) throws SQLException, AuthorizeException;
@@ -401,15 +335,12 @@ public interface AuthorizeService {
* Remove all policies from an object that match a given action. FIXME
* doesn't check authorization
*
- * @param context
- * current context
- * @param dso
- * object to remove policies from
- * @param actionID
- * ID of action to match from
+ * @param context current context
+ * @param dso object to remove policies from
+ * @param actionID ID of action to match from
* org.dspace.core.Constants
, or -1=all
- * @throws SQLException
- * if there's a database problem
+ * @throws SQLException if there's a database problem
+ * @throws AuthorizeException if authorization error
*/
public void removePoliciesActionFilter(Context context, DSpaceObject dso, int actionID) throws SQLException, AuthorizeException;
@@ -417,12 +348,9 @@ public interface AuthorizeService {
* Removes all policies relating to a particular group. FIXME doesn't check
* authorization
*
- * @param c
- * current context
- * @param group
- * the group
- * @throws SQLException
- * if there's a database problem
+ * @param c current context
+ * @param group the group
+ * @throws SQLException if there's a database problem
*/
public void removeGroupPolicies(Context c, Group group) throws SQLException;
@@ -430,14 +358,11 @@ public interface AuthorizeService {
* Removes all policies from a group for a particular object that belong to
* a Group. FIXME doesn't check authorization
*
- * @param c
- * current context
- * @param o
- * the object
- * @param g
- * the group
- * @throws SQLException
- * if there's a database problem
+ * @param c current context
+ * @param o the object
+ * @param g the group
+ * @throws SQLException if there's a database problem
+ * @throws AuthorizeException if authorization error
*/
public void removeGroupPolicies(Context c, DSpaceObject o, Group g) throws SQLException, AuthorizeException;
@@ -445,14 +370,11 @@ public interface AuthorizeService {
* Removes all policies from an eperson for a particular object that belong to
* an EPerson. FIXME doesn't check authorization
*
- * @param c
- * current context
- * @param o
- * the object
- * @param e
- * the eperson
- * @throws java.sql.SQLException
- * if there's a database problem
+ * @param c current context
+ * @param o the object
+ * @param e the eperson
+ * @throws SQLException if there's a database problem
+ * @throws AuthorizeException if authorization error
*/
public void removeEPersonPolicies(Context c, DSpaceObject o, EPerson e) throws SQLException, AuthorizeException;
@@ -460,16 +382,12 @@ public interface AuthorizeService {
* Returns all groups authorized to perform an action on an object. Returns
* empty array if no matches.
*
- * @param c
- * current context
- * @param o
- * object
- * @param actionID
- * ID of action from org.dspace.core.Constants
+ * @param c current context
+ * @param o object
+ * @param actionID ID of action from org.dspace.core.Constants
* @return array of Group
s that can perform the specified
* action on the specified object
- * @throws java.sql.SQLException
- * if there's a database problem
+ * @throws SQLException if there's a database problem
*/
public List getAuthorizedGroups(Context c, DSpaceObject o, int actionID) throws java.sql.SQLException;
@@ -479,17 +397,13 @@ public interface AuthorizeService {
/**
* Is a policy with the specified parameters already in place?
*
- * @param c
- * current context
- * @param o
- * object
- * @param actionID
- * ID of action from org.dspace.core.Constants
- * @param policyID
- * ID of an existing policy. If -1 is specified, this parameter will be ignored
+ * @param c current context
+ * @param o object
+ * @param group group
+ * @param actionID ID of action from org.dspace.core.Constants
+ * @param policyID ID of an existing policy. If -1 is specified, this parameter will be ignored
* @return true if such a policy exists, false otherwise
- * @throws java.sql.SQLException
- * if there's a database problem
+ * @throws SQLException if there's a database problem
*/
public boolean isAnIdenticalPolicyAlreadyInPlace(Context c, DSpaceObject o, Group group, int actionID, int policyID) throws SQLException;
@@ -501,12 +415,12 @@ public interface AuthorizeService {
* have right on the collection. E.g., if the anonymous can access the collection policies are assigned to anonymous.
*
* @param context current context
- * @param embargoDate
- * @param reason
- * @param dso
- * @param owningCollection
- * @throws SQLException
- * @throws AuthorizeException
+ * @param embargoDate date
+ * @param reason reason
+ * @param dso DSpaceObject
+ * @param owningCollection collection
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
public void generateAutomaticPolicies(Context context, Date embargoDate, String reason, DSpaceObject dso, Collection owningCollection) throws SQLException, AuthorizeException;
diff --git a/dspace-api/src/main/java/org/dspace/authorize/service/ResourcePolicyService.java b/dspace-api/src/main/java/org/dspace/authorize/service/ResourcePolicyService.java
index 71c0261fcb..15bb640ed7 100644
--- a/dspace-api/src/main/java/org/dspace/authorize/service/ResourcePolicyService.java
+++ b/dspace-api/src/main/java/org/dspace/authorize/service/ResourcePolicyService.java
@@ -45,8 +45,6 @@ public interface ResourcePolicyService extends DSpaceCRUDService
public void removeAllPolicies(Context c, DSpaceObject o) throws SQLException, AuthorizeException;
- public void removeAllPolicies(Context c, DSpaceObject o, boolean updateLastModified) throws SQLException, AuthorizeException;
-
public void removePolicies(Context c, DSpaceObject o, int actionId) throws SQLException, AuthorizeException;
public void removePolicies(Context c, DSpaceObject o, String type) throws SQLException, AuthorizeException;
diff --git a/dspace-api/src/main/java/org/dspace/browse/BrowseDAO.java b/dspace-api/src/main/java/org/dspace/browse/BrowseDAO.java
index 4e41ae2920..55051ca47a 100644
--- a/dspace-api/src/main/java/org/dspace/browse/BrowseDAO.java
+++ b/dspace-api/src/main/java/org/dspace/browse/BrowseDAO.java
@@ -44,7 +44,7 @@ public interface BrowseDAO
* parameters you set.
*
* @return the integer value of the number of results found
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public int doCountQuery() throws BrowseException;
@@ -55,7 +55,7 @@ public interface BrowseDAO
* commonly used with a Distinct browse type.
*
* @return List of Strings representing the single value query results
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public List doValueQuery() throws BrowseException;
@@ -64,7 +64,7 @@ public interface BrowseDAO
* representing the results of a full item browse.
*
* @return List of BrowseItem objects
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public List- doQuery() throws BrowseException;
@@ -76,7 +76,7 @@ public interface BrowseDAO
* @param table the table to query
* @param itemID the item id
* @return String representing the max value in the given column
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public String doMaxQuery(String column, String table, int itemID) throws BrowseException;
@@ -88,7 +88,7 @@ public interface BrowseDAO
* @param value the item id
* @param isAscending browsing in ascending or descending order
* @return the offset into the table
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public int doOffsetQuery(String column, String value, boolean isAscending) throws BrowseException;
@@ -100,7 +100,7 @@ public interface BrowseDAO
* @param value the item id
* @param isAscending browsing in ascending or descending order
* @return the offset into the table
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public int doDistinctOffsetQuery(String column, String value, boolean isAscending) throws BrowseException;
@@ -117,8 +117,8 @@ public interface BrowseDAO
/**
* Set whether the query should use an equals comparator when doing less than or
* greater than comparisons. That is, if true then comparisons will be made
- * using the equivalent of "<=" and ">=", while if false it will use the
- * equivalent of "<" and ">"
+ * using the equivalent of {@code <=} and {@code >=}, while if false it will use the
+ * equivalent of {@code <} and {@code >}
*
* @param equalsComparator true to use, false to not.
*/
@@ -189,7 +189,7 @@ public interface BrowseDAO
* the browse. This will either be the "sort_value" field or one of the
* additional sort fields defined by configuration
*
- * param focusField the name of the focus field
+ * @param focusField the name of the focus field
*/
public void setJumpToField(String focusField);
diff --git a/dspace-api/src/main/java/org/dspace/browse/BrowseDAOFactory.java b/dspace-api/src/main/java/org/dspace/browse/BrowseDAOFactory.java
index 540a4db5bd..994404e55a 100644
--- a/dspace-api/src/main/java/org/dspace/browse/BrowseDAOFactory.java
+++ b/dspace-api/src/main/java/org/dspace/browse/BrowseDAOFactory.java
@@ -24,7 +24,7 @@ public class BrowseDAOFactory
*
* @param context the DSpace context
* @return the relevant DAO
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public static BrowseDAO getInstance(Context context)
throws BrowseException
diff --git a/dspace-api/src/main/java/org/dspace/browse/BrowseEngine.java b/dspace-api/src/main/java/org/dspace/browse/BrowseEngine.java
index 4d070c0ea7..6eb3096678 100644
--- a/dspace-api/src/main/java/org/dspace/browse/BrowseEngine.java
+++ b/dspace-api/src/main/java/org/dspace/browse/BrowseEngine.java
@@ -53,7 +53,7 @@ public class BrowseEngine
* for the Browse Engine, based on the brand of the provided DBMS.
*
* @param context the DSpace context
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public BrowseEngine(Context context)
throws BrowseException
@@ -73,7 +73,7 @@ public class BrowseEngine
*
* @param bs the scope of the browse
* @return the results of the browse
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public BrowseInfo browse(BrowserScope bs)
throws BrowseException
@@ -111,6 +111,7 @@ public class BrowseEngine
*
* @param bs the scope of the browse
* @return the results of the browse
+ * @throws BrowseException if browse error
*/
public BrowseInfo browseMini(BrowserScope bs)
throws BrowseException
@@ -196,7 +197,7 @@ public class BrowseEngine
*
* @param bs the scope of the browse
* @return the results of the browse
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
private BrowseInfo browseByItem(BrowserScope bs)
throws BrowseException
@@ -395,7 +396,7 @@ public class BrowseEngine
*
* @param bs the scope of the browse
* @return the results of the browse
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
private BrowseInfo browseByValue(BrowserScope bs)
throws BrowseException
@@ -562,7 +563,7 @@ public class BrowseEngine
* Return the focus value.
*
* @return the focus value to use
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
private String getJumpToValue()
throws BrowseException
@@ -627,8 +628,9 @@ public class BrowseEngine
/**
* Convert the value into an offset into the table for this browse
*
+ * @param value value
* @return the focus value to use
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
private int getOffsetForValue(String value)
throws BrowseException
@@ -662,8 +664,9 @@ public class BrowseEngine
/**
* Convert the value into an offset into the table for this browse
*
+ * @param value value
* @return the focus value to use
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
private int getOffsetForDistinctValue(String value)
throws BrowseException
@@ -685,7 +688,7 @@ public class BrowseEngine
*
* @param value a focus value to normalize
* @return the normalized focus value
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
private String normalizeJumpToValue(String value)
throws BrowseException
@@ -712,9 +715,9 @@ public class BrowseEngine
* Get the total number of results for the browse. This is the same as
* calling getTotalResults(false)
*
- * @return
- * @throws SQLException
- * @throws BrowseException
+ * @return total
+ * @throws SQLException if database error
+ * @throws BrowseException if browse error
*/
private int getTotalResults()
throws SQLException, BrowseException
@@ -728,8 +731,8 @@ public class BrowseEngine
*
* @param distinct is this a distinct browse or not
* @return the total number of results available in this type of browse
- * @throws SQLException
- * @throws BrowseException
+ * @throws SQLException if database error
+ * @throws BrowseException if browse error
*/
private int getTotalResults(boolean distinct)
throws SQLException, BrowseException
diff --git a/dspace-api/src/main/java/org/dspace/browse/BrowseIndex.java b/dspace-api/src/main/java/org/dspace/browse/BrowseIndex.java
index 9e6dcd8f8b..0a39b9b748 100644
--- a/dspace-api/src/main/java/org/dspace/browse/BrowseIndex.java
+++ b/dspace-api/src/main/java/org/dspace/browse/BrowseIndex.java
@@ -12,7 +12,6 @@ import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.commons.lang.StringUtils;
import org.dspace.core.ConfigurationManager;
import org.dspace.sort.SortOption;
@@ -123,7 +122,7 @@ public final class BrowseIndex
*
* @param definition the configuration definition of this index
* @param number the configuration number of this index
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
private BrowseIndex(String definition, int number)
throws BrowseException
@@ -295,6 +294,7 @@ public final class BrowseIndex
}
/**
+ * @param idx index
* @return Returns the mdBits.
*/
public String[] getMdBits(int idx)
@@ -315,6 +315,11 @@ public final class BrowseIndex
return metadataAll;
}
+ /**
+ *
+ * @param idx index
+ * @return metadata
+ */
public String getMetadata(int idx)
{
return metadata[idx];
@@ -338,12 +343,17 @@ public final class BrowseIndex
/**
* Get the SortOption associated with this index.
+ * @return SortOption
*/
public SortOption getSortOption()
{
return sortOption;
}
+ /**
+ *
+ * @return true or false
+ */
public boolean isDisplayFrequencies() {
return displayFrequencies;
}
@@ -445,12 +455,12 @@ public final class BrowseIndex
/**
* Generate a table name from the given base
- * @param baseName
- * @param isCommunity
- * @param isCollection
- * @param isDistinct
- * @param isMap
- * @return
+ * @param baseName base name
+ * @param isCommunity whether this is a community constrained index (view)
+ * @param isCollection whether this is a collection constrained index (view)
+ * @param isDistinct whether this is a distinct table
+ * @param isMap whether this is a distinct map table
+ * @return table name
*/
private static String getTableName(String baseName, boolean isCommunity, boolean isCollection, boolean isDistinct, boolean isMap)
{
@@ -523,6 +533,8 @@ public final class BrowseIndex
*
* getTableName(false, false, false, false);
*
+ *
+ * @return table name
*/
public String getTableName()
{
@@ -538,10 +550,11 @@ public final class BrowseIndex
* getTableName(isCommunity, isCollection, isDistinct, false);
*
*
- * @param isDistinct is this a distinct table
- * @param isCommunity
- * @param isCollection
+ * @param isCommunity whether this is a community constrained index (view)
+ * @param isCollection whether this is a collection constrained index (view)
+ * @param isDistinct whether this is a distinct table
* @deprecated 1.5
+ * @return table name
*/
public String getTableName(boolean isDistinct, boolean isCommunity, boolean isCollection)
{
@@ -554,6 +567,7 @@ public final class BrowseIndex
*
* getTableName(false, false, false, true);
*
+ * @return table name
*/
public String getMapTableName()
{
@@ -566,6 +580,7 @@ public final class BrowseIndex
*
* getTableName(false, false, true, false);
*
+ * @return table name
*/
public String getDistinctTableName()
{
@@ -661,7 +676,9 @@ public final class BrowseIndex
/**
* Get the field for sorting associated with this index.
- * @throws BrowseException
+ * @param isSecondLevel whether second level browse
+ * @return sort field
+ * @throws BrowseException if browse error
*/
public String getSortField(boolean isSecondLevel) throws BrowseException
{
@@ -686,8 +703,9 @@ public final class BrowseIndex
}
/**
+ * @return array of tables
* @deprecated
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public static String[] tables()
throws BrowseException
@@ -706,7 +724,7 @@ public final class BrowseIndex
* Get an array of all the browse indices for the current configuration
*
* @return an array of all the current browse indices
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public static BrowseIndex[] getBrowseIndices()
throws BrowseException
@@ -738,7 +756,7 @@ public final class BrowseIndex
*
* @param name the name to retrieve
* @return the specified browse index
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public static BrowseIndex getBrowseIndex(String name)
throws BrowseException
@@ -757,8 +775,9 @@ public final class BrowseIndex
/**
* Get the configured browse index that is defined to use this sort option.
*
- * @param so
- * @throws BrowseException
+ * @param so sort option
+ * @return browse index
+ * @throws BrowseException if browse error
*/
public static BrowseIndex getBrowseIndex(SortOption so) throws BrowseException
{
@@ -775,6 +794,7 @@ public final class BrowseIndex
/**
* Get the internally defined browse index for archived items.
+ * @return browse index
*/
public static BrowseIndex getItemBrowseIndex()
{
@@ -783,13 +803,16 @@ public final class BrowseIndex
/**
* Get the internally defined browse index for withdrawn items.
+ * @return browse index
*/
public static BrowseIndex getWithdrawnBrowseIndex()
{
return BrowseIndex.withdrawnIndex;
}
-
+ /**
+ * @return browse index
+ */
public static BrowseIndex getPrivateBrowseIndex()
{
return BrowseIndex.privateIndex;
@@ -804,6 +827,7 @@ public final class BrowseIndex
* @param mfield the string representation of the metadata
* @param init the default value of the array elements
* @return a three element array with schema, element and qualifier respectively
+ * @throws IOException if IO error
*/
public String[] interpretField(String mfield, String init)
throws IOException
@@ -829,6 +853,7 @@ public final class BrowseIndex
/**
* Does this browse index represent one of the internal item indexes?
+ * @return true or false
*/
public boolean isInternalIndex()
{
@@ -837,13 +862,18 @@ public final class BrowseIndex
/**
* Generate a base table name.
- * @param number
+ * @param number index number
+ * @return table name
*/
private static String makeTableBaseName(int number)
{
return "bi_" + Integer.toString(number);
}
+ /**
+ * Is tag cloud enabled
+ * @return true or false
+ */
public boolean isTagCloudEnabled() {
return ConfigurationManager.getBooleanProperty("webui.browse.index.tagcloud." + number);
diff --git a/dspace-api/src/main/java/org/dspace/browse/BrowseInfo.java b/dspace-api/src/main/java/org/dspace/browse/BrowseInfo.java
index 719d1667ce..4d5f32948c 100644
--- a/dspace-api/src/main/java/org/dspace/browse/BrowseInfo.java
+++ b/dspace-api/src/main/java/org/dspace/browse/BrowseInfo.java
@@ -256,7 +256,7 @@ public class BrowseInfo
* exception
*
* @param dso the container object; a Community or Collection
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public void setBrowseContainer(DSpaceObject dso)
throws BrowseException
@@ -575,6 +575,7 @@ public class BrowseInfo
/**
* True if this browse was cached.
+ * @return true/false
*/
public boolean wasCached()
{
@@ -684,6 +685,7 @@ public class BrowseInfo
/**
* Utility method for obtaining a string representation of the browse. This is
* useful only for debug
+ * @return String representation
*/
public String toString()
{
@@ -836,7 +838,7 @@ public class BrowseInfo
*
* @param config
* @return
- * @throws SQLException
+ * @throws SQLException if database error
*/
private String fullListingString(ItemListConfig config)
throws SQLException
diff --git a/dspace-api/src/main/java/org/dspace/browse/BrowseOutput.java b/dspace-api/src/main/java/org/dspace/browse/BrowseOutput.java
index 4120fb5d2c..4a1bebd525 100644
--- a/dspace-api/src/main/java/org/dspace/browse/BrowseOutput.java
+++ b/dspace-api/src/main/java/org/dspace/browse/BrowseOutput.java
@@ -160,8 +160,8 @@ public class BrowseOutput
* Pass in some SQL. If print is set to true this will output to the
* screen. If file is set to true, this will write to the file specified.
*
- * @param sql
- * @throws BrowseException
+ * @param sql SQL string
+ * @throws BrowseException if browse error
*/
public void sql(String sql) throws BrowseException
{
diff --git a/dspace-api/src/main/java/org/dspace/browse/BrowserScope.java b/dspace-api/src/main/java/org/dspace/browse/BrowserScope.java
index 0ef1a8c486..3f7606cfde 100644
--- a/dspace-api/src/main/java/org/dspace/browse/BrowserScope.java
+++ b/dspace-api/src/main/java/org/dspace/browse/BrowserScope.java
@@ -96,7 +96,7 @@ public class BrowserScope
* exception
*
* @param dso the container object; a Community or Collection
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public void setBrowseContainer(DSpaceObject dso)
throws BrowseException
@@ -184,6 +184,7 @@ public class BrowserScope
/**
* @param browseIndex The browseIndex to set.
+ * @throws BrowseException if error
*/
public void setBrowseIndex(BrowseIndex browseIndex)
throws BrowseException
@@ -370,6 +371,7 @@ public class BrowserScope
/**
* @param sortBy The sortBy to set.
+ * @throws BrowseException if error
*/
public void setSortBy(int sortBy)
throws BrowseException
@@ -397,7 +399,7 @@ public class BrowserScope
* Obtain the sort option
*
* @return the sort option
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public SortOption getSortOption()
throws BrowseException
diff --git a/dspace-api/src/main/java/org/dspace/browse/CrossLinks.java b/dspace-api/src/main/java/org/dspace/browse/CrossLinks.java
index 369b764464..1694d0324c 100644
--- a/dspace-api/src/main/java/org/dspace/browse/CrossLinks.java
+++ b/dspace-api/src/main/java/org/dspace/browse/CrossLinks.java
@@ -28,7 +28,7 @@ public class CrossLinks
/**
* Construct a new object which will obtain the configuration for itself.
*
- * @throws BrowseException
+ * @throws BrowseException if browse error
*/
public CrossLinks()
throws BrowseException
@@ -57,6 +57,7 @@ public class CrossLinks
* Is there a link for the given canonical form of metadata (i.e. schema.element.qualifier)?
*
* @param metadata the metadata to check for a link on
+ * @return true/false
*/
public boolean hasLink(String metadata)
{
@@ -67,6 +68,7 @@ public class CrossLinks
* Get the type of link that the bit of metadata has.
*
* @param metadata the metadata to get the link type for
+ * @return type
*/
public String getLinkType(String metadata)
{
diff --git a/dspace-api/src/main/java/org/dspace/browse/ItemCountDAO.java b/dspace-api/src/main/java/org/dspace/browse/ItemCountDAO.java
index c3c1ec5990..ef3b329540 100644
--- a/dspace-api/src/main/java/org/dspace/browse/ItemCountDAO.java
+++ b/dspace-api/src/main/java/org/dspace/browse/ItemCountDAO.java
@@ -22,8 +22,8 @@ public interface ItemCountDAO
/**
* Set the DSpace Context to use during data access
*
- * @param context
- * @throws ItemCountException
+ * @param context DSpace Context
+ * @throws ItemCountException if count error
*/
public void setContext(Context context) throws ItemCountException;
@@ -32,8 +32,9 @@ public interface ItemCountDAO
* only succeed if the DSpaceObject is an instance of either a Community or a
* Collection. Otherwise it will throw an exception.
*
- * @param dso
- * @throws ItemCountException
+ * @param dso Dspace Object
+ * @return count
+ * @throws ItemCountException if count error
*/
public int getCount(DSpaceObject dso) throws ItemCountException;
}
diff --git a/dspace-api/src/main/java/org/dspace/browse/ItemCountDAOFactory.java b/dspace-api/src/main/java/org/dspace/browse/ItemCountDAOFactory.java
index 20131bbd39..5da1649802 100644
--- a/dspace-api/src/main/java/org/dspace/browse/ItemCountDAOFactory.java
+++ b/dspace-api/src/main/java/org/dspace/browse/ItemCountDAOFactory.java
@@ -24,8 +24,9 @@ public class ItemCountDAOFactory
* Get an instance of ItemCountDAO which supports the correct storage backend
* for the specific DSpace instance.
*
- * @param context
- * @throws ItemCountException
+ * @param context DSpace Context
+ * @return DAO
+ * @throws ItemCountException if count error
*/
public static ItemCountDAO getInstance(Context context)
throws ItemCountException
diff --git a/dspace-api/src/main/java/org/dspace/browse/ItemCountDAOSolr.java b/dspace-api/src/main/java/org/dspace/browse/ItemCountDAOSolr.java
index ef3ec38d62..e71e7e779a 100644
--- a/dspace-api/src/main/java/org/dspace/browse/ItemCountDAOSolr.java
+++ b/dspace-api/src/main/java/org/dspace/browse/ItemCountDAOSolr.java
@@ -59,8 +59,8 @@ public class ItemCountDAOSolr implements ItemCountDAO
/**
* Set the dspace context to use
*
- * @param context
- * @throws ItemCountException
+ * @param context DSpace Context
+ * @throws ItemCountException if count error
*/
@Override
public void setContext(Context context) throws ItemCountException
@@ -71,8 +71,9 @@ public class ItemCountDAOSolr implements ItemCountDAO
/**
* Get the count of the items in the given container.
*
- * @param dso
- * @throws ItemCountException
+ * @param dso Dspace Context
+ * @return count
+ * @throws ItemCountException if count error
*/
@Override
public int getCount(DSpaceObject dso) throws ItemCountException
@@ -106,7 +107,7 @@ public class ItemCountDAOSolr implements ItemCountDAO
* make sure that the counts are actually fetched from Solr (if haven't been
* cached in a Map yet)
*
- * @throws ItemCountException
+ * @throws ItemCountException if count error
*/
private void loadCount() throws ItemCountException
{
diff --git a/dspace-api/src/main/java/org/dspace/browse/ItemCounter.java b/dspace-api/src/main/java/org/dspace/browse/ItemCounter.java
index c80395f27d..e40a814e41 100644
--- a/dspace-api/src/main/java/org/dspace/browse/ItemCounter.java
+++ b/dspace-api/src/main/java/org/dspace/browse/ItemCounter.java
@@ -51,8 +51,8 @@ public class ItemCounter
/**
* Construct a new item counter which will use the give DSpace Context
*
- * @param context
- * @throws ItemCountException
+ * @param context current context
+ * @throws ItemCountException if count error
*/
public ItemCounter(Context context)
throws ItemCountException
@@ -70,9 +70,9 @@ public class ItemCounter
* cached value if it exists. If it is equal to 'false' it will count
* the number of items in the container in real time.
*
- * @param dso
- * @throws ItemCountException
- * @throws SQLException
+ * @param dso DSpaceObject
+ * @return count
+ * @throws ItemCountException when error occurs
*/
public int getCount(DSpaceObject dso)
throws ItemCountException
diff --git a/dspace-api/src/main/java/org/dspace/browse/ItemListConfig.java b/dspace-api/src/main/java/org/dspace/browse/ItemListConfig.java
index b7c0a64b00..7ad053f203 100644
--- a/dspace-api/src/main/java/org/dspace/browse/ItemListConfig.java
+++ b/dspace-api/src/main/java/org/dspace/browse/ItemListConfig.java
@@ -38,7 +38,7 @@ public class ItemListConfig
* Create a new instance of the Item list configuration. This loads
* all the required information from configuration
*
- * @throws BrowseException
+ * @throws BrowseException if count error
*/
public ItemListConfig()
throws BrowseException
@@ -97,7 +97,8 @@ public class ItemListConfig
/**
* What metadata is to go in the given column number?
*
- * @param col
+ * @param col column
+ * @return array of metadata
*/
public String[] getMetadata(int col)
{
@@ -113,6 +114,7 @@ public class ItemListConfig
* @param mfield the string representation of the metadata
* @param init the default value of the array elements
* @return a three element array with schema, element and qualifier respectively
+ * @throws IOException if IO error
*/
public final String[] interpretField(String mfield, String init)
throws IOException
diff --git a/dspace-api/src/main/java/org/dspace/browse/LocaleOrderingFilter.java b/dspace-api/src/main/java/org/dspace/browse/LocaleOrderingFilter.java
index 0f8788f4de..8024f3071b 100644
--- a/dspace-api/src/main/java/org/dspace/browse/LocaleOrderingFilter.java
+++ b/dspace-api/src/main/java/org/dspace/browse/LocaleOrderingFilter.java
@@ -72,6 +72,9 @@ public class LocaleOrderingFilter implements TextFilter
/**
* We don't need to use the language parameter, so map this to
* the standard sort string filter
+ * @param str string
+ * @param lang language
+ * @return string
*/
@Override
public String filter(String str, String lang)
diff --git a/dspace-api/src/main/java/org/dspace/checker/BitstreamDispatcher.java b/dspace-api/src/main/java/org/dspace/checker/BitstreamDispatcher.java
index 77dd31a02e..721ce04bfb 100644
--- a/dspace-api/src/main/java/org/dspace/checker/BitstreamDispatcher.java
+++ b/dspace-api/src/main/java/org/dspace/checker/BitstreamDispatcher.java
@@ -50,6 +50,7 @@ public interface BitstreamDispatcher
*
* @return the next bitstream id, or BitstreamDispatcher.SENTINEL if there
* isn't another value
+ * @throws SQLException if database error
*
*/
public Bitstream next() throws SQLException;
diff --git a/dspace-api/src/main/java/org/dspace/checker/CheckerCommand.java b/dspace-api/src/main/java/org/dspace/checker/CheckerCommand.java
index 417d5ebc0d..3309acab61 100644
--- a/dspace-api/src/main/java/org/dspace/checker/CheckerCommand.java
+++ b/dspace-api/src/main/java/org/dspace/checker/CheckerCommand.java
@@ -35,8 +35,8 @@ import org.dspace.storage.bitstore.service.BitstreamStorageService;
* @author Nathan Sarr
*
*
- * @todo the accessor methods are currently unused - are they useful?
- * @todo check for any existing resource problems
+ * TODO the accessor methods are currently unused - are they useful?
+ * TODO check for any existing resource problems
*/
public final class CheckerCommand
{
@@ -73,6 +73,7 @@ public final class CheckerCommand
/**
* Default constructor uses DSpace plugin manager to construct dependencies.
+ * @param context Context
*/
public CheckerCommand(Context context)
{
@@ -94,6 +95,7 @@ public final class CheckerCommand
* N.B. a valid BitstreamDispatcher must be provided using
* setBitstreamDispatcher before calling this method
*
+ * @throws SQLException if database error
*/
public void process() throws SQLException {
LOG.debug("Begin Checker Processing");
@@ -136,6 +138,7 @@ public final class CheckerCommand
* the bitstream
*
* @return the information about the bitstream and its checksum data
+ * @throws SQLException if database error
*/
protected MostRecentChecksum checkBitstream(final Bitstream bitstream) throws SQLException {
// get bitstream info from bitstream table
@@ -181,6 +184,7 @@ public final class CheckerCommand
* the second checksum
*
* @return a result code (constants defined in Util)
+ * @throws SQLException if database error
*/
protected ChecksumResult compareChecksums(String checksumA, String checksumB) throws SQLException {
ChecksumResult result = getChecksumResultByCode(ChecksumResultCode.CHECKSUM_NO_MATCH);
@@ -205,6 +209,7 @@ public final class CheckerCommand
*
* @param info
* a deleted bitstream.
+ * @throws SQLException if database error
*/
protected void processDeletedBitstream(MostRecentChecksum info) throws SQLException {
info.setProcessStartDate(new Date());
@@ -222,7 +227,8 @@ public final class CheckerCommand
*
* @param info
* A not found BitStreamInfo
- * @todo is this method required?
+ * TODO is this method required?
+ * @throws SQLException if database error
*/
protected void processNullInfoBitstream(MostRecentChecksum info) throws SQLException {
info.setInfoFound(false);
@@ -241,11 +247,12 @@ public final class CheckerCommand
* actual checksumming never took place.
*
*
- * @todo Why does bitstream have a timestamp indicating it's checked if
+ * TODO Why does bitstream have a timestamp indicating it's checked if
* checksumming doesn't occur?
*
* @param info
* BitstreamInfo to handle
+ * @throws SQLException if database error
*/
protected void processBitstream(MostRecentChecksum info) throws SQLException {
info.setProcessStartDate(new Date());
diff --git a/dspace-api/src/main/java/org/dspace/checker/CheckerConsumer.java b/dspace-api/src/main/java/org/dspace/checker/CheckerConsumer.java
index e7b5acb818..93eb7aa260 100644
--- a/dspace-api/src/main/java/org/dspace/checker/CheckerConsumer.java
+++ b/dspace-api/src/main/java/org/dspace/checker/CheckerConsumer.java
@@ -33,6 +33,7 @@ public class CheckerConsumer implements Consumer
/**
* Initialize - allocate any resources required to operate.
* Called at the start of ANY sequence of event consume() calls.
+ * @throws Exception if error
*/
@Override
public void initialize() throws Exception
@@ -46,6 +47,7 @@ public class CheckerConsumer implements Consumer
* @param ctx the execution context object
*
* @param event the content event
+ * @throws Exception if error
*/
@Override
public void consume(Context ctx, Event event) throws Exception
@@ -63,6 +65,8 @@ public class CheckerConsumer implements Consumer
/**
* Signal that there are no more events queued in this
* event stream.
+ * @param ctx Context
+ * @throws Exception if error
*/
@Override
public void end(Context ctx) throws Exception
@@ -73,6 +77,8 @@ public class CheckerConsumer implements Consumer
/**
* Finish - free any allocated resources.
* Called when consumer is being released
+ * @param ctx Context
+ * @throws Exception if error
*/
@Override
public void finish(Context ctx) throws Exception
diff --git a/dspace-api/src/main/java/org/dspace/checker/ChecksumHistory.java b/dspace-api/src/main/java/org/dspace/checker/ChecksumHistory.java
index 5885250c12..10422c26bf 100644
--- a/dspace-api/src/main/java/org/dspace/checker/ChecksumHistory.java
+++ b/dspace-api/src/main/java/org/dspace/checker/ChecksumHistory.java
@@ -9,10 +9,10 @@ package org.dspace.checker;
import org.dspace.core.Context;
import org.dspace.content.Bitstream;
+import org.dspace.core.ReloadableEntity;
import javax.persistence.*;
import java.util.Date;
-import java.util.UUID;
/**
*
@@ -26,7 +26,7 @@ import java.util.UUID;
*/
@Entity
@Table(name="checksum_history")
-public class ChecksumHistory
+public class ChecksumHistory implements ReloadableEntity
{
@@ -34,7 +34,7 @@ public class ChecksumHistory
@Column(name="check_id")
@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="checksum_history_check_id_seq")
@SequenceGenerator(name="checksum_history_check_id_seq", sequenceName="checksum_history_check_id_seq", allocationSize = 1)
- private long id;
+ private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "bitstream_id")
@@ -67,7 +67,7 @@ public class ChecksumHistory
{
}
- public long getId() {
+ public Long getID() {
return id;
}
@@ -169,6 +169,7 @@ public class ChecksumHistory
/**
* Return the processing result.
+ * @return result
*/
public ChecksumResult getResult()
{
diff --git a/dspace-api/src/main/java/org/dspace/checker/ChecksumHistoryServiceImpl.java b/dspace-api/src/main/java/org/dspace/checker/ChecksumHistoryServiceImpl.java
index fec1a5841b..ec8e602ae7 100644
--- a/dspace-api/src/main/java/org/dspace/checker/ChecksumHistoryServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/checker/ChecksumHistoryServiceImpl.java
@@ -88,13 +88,13 @@ public class ChecksumHistoryServiceImpl implements ChecksumHistoryService {
/**
* Delete the history records from the database.
*
+ * @param context Context
* @param retentionDate
* any records older than this data are deleted.
* @param checksumResultCode
* result code records must have for them to be deleted.
* @return number of records deleted.
- * @throws java.sql.SQLException
- * if database error occurs.
+ * @throws SQLException if database error occurs.
*/
@Override
public int deleteByDateAndCode(Context context, Date retentionDate, ChecksumResultCode checksumResultCode) throws SQLException
diff --git a/dspace-api/src/main/java/org/dspace/checker/ChecksumResultServiceImpl.java b/dspace-api/src/main/java/org/dspace/checker/ChecksumResultServiceImpl.java
index b671e77a2e..3335ceafd0 100644
--- a/dspace-api/src/main/java/org/dspace/checker/ChecksumResultServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/checker/ChecksumResultServiceImpl.java
@@ -35,9 +35,11 @@ public class ChecksumResultServiceImpl implements ChecksumResultService {
/**
* Get the result description for the given result code
*
+ * @param context Context
* @param code
* to get the description for.
* @return the found description.
+ * @throws SQLException if database error
*/
@Override
public ChecksumResult findByCode(Context context, ChecksumResultCode code) throws SQLException
@@ -48,7 +50,9 @@ public class ChecksumResultServiceImpl implements ChecksumResultService {
/**
* Get a list of all the possible result codes.
*
+ * @param context Context
* @return a list of all the result codes
+ * @throws SQLException if database error
*/
@Override
public List findAll(Context context) throws SQLException {
diff --git a/dspace-api/src/main/java/org/dspace/checker/ChecksumResultsCollector.java b/dspace-api/src/main/java/org/dspace/checker/ChecksumResultsCollector.java
index 8821c29da1..615e30b28d 100644
--- a/dspace-api/src/main/java/org/dspace/checker/ChecksumResultsCollector.java
+++ b/dspace-api/src/main/java/org/dspace/checker/ChecksumResultsCollector.java
@@ -24,8 +24,10 @@ public interface ChecksumResultsCollector
/**
* Collects results.
*
+ * @param context Context
* @param info
* BitstreamInfo representing the check results.
+ * @throws SQLException if database error
*/
void collect(Context context, MostRecentChecksum info) throws SQLException;
}
diff --git a/dspace-api/src/main/java/org/dspace/checker/DailyReportEmailer.java b/dspace-api/src/main/java/org/dspace/checker/DailyReportEmailer.java
index 126527ac31..6de0051651 100644
--- a/dspace-api/src/main/java/org/dspace/checker/DailyReportEmailer.java
+++ b/dspace-api/src/main/java/org/dspace/checker/DailyReportEmailer.java
@@ -61,10 +61,8 @@ public class DailyReportEmailer
* @param numberOfBitstreams
* the number of bitstreams reported
*
- * @throws IOException
- * if IO exception occurs
- * @throws javax.mail.MessagingException
- * if message cannot be sent.
+ * @throws IOException if IO exception occurs
+ * @throws MessagingException if message cannot be sent.
*/
public void sendReport(File attachment, int numberOfBitstreams)
throws IOException, javax.mail.MessagingException
@@ -192,7 +190,7 @@ public class DailyReportEmailer
int numBitstreams = 0;
// create a temporary file in the log directory
- String dirLocation = ConfigurationManager.getProperty("log.dir");
+ String dirLocation = ConfigurationManager.getProperty("log.report.dir");
File directory = new File(dirLocation);
if (directory.exists() && directory.isDirectory())
diff --git a/dspace-api/src/main/java/org/dspace/checker/HandleDispatcher.java b/dspace-api/src/main/java/org/dspace/checker/HandleDispatcher.java
index f1897e1883..84e1f8c631 100644
--- a/dspace-api/src/main/java/org/dspace/checker/HandleDispatcher.java
+++ b/dspace-api/src/main/java/org/dspace/checker/HandleDispatcher.java
@@ -61,6 +61,7 @@ public class HandleDispatcher implements BitstreamDispatcher
/**
* Main constructor.
*
+ * @param context Context
* @param hdl
* the handle to get bitstreams from.
*/
@@ -73,7 +74,7 @@ public class HandleDispatcher implements BitstreamDispatcher
/**
* Private initialization routine.
*
- * @throws SQLException
+ * @throws SQLException if database error
* if database access fails.
*/
protected synchronized void init() throws SQLException {
@@ -110,6 +111,7 @@ public class HandleDispatcher implements BitstreamDispatcher
/**
* Initializes this dispatcher on first execution.
*
+ * @throws SQLException if database error
* @see org.dspace.checker.BitstreamDispatcher#next()
*/
@Override
diff --git a/dspace-api/src/main/java/org/dspace/checker/IteratorDispatcher.java b/dspace-api/src/main/java/org/dspace/checker/IteratorDispatcher.java
index a5e6b2a67b..6d12ac922f 100644
--- a/dspace-api/src/main/java/org/dspace/checker/IteratorDispatcher.java
+++ b/dspace-api/src/main/java/org/dspace/checker/IteratorDispatcher.java
@@ -36,7 +36,7 @@ public class IteratorDispatcher implements BitstreamDispatcher
/**
* Main constructor.
*
- * @param bitstreamIds
+ * @param bitstreams bitstream iterator
*/
public IteratorDispatcher(Iterator bitstreams)
{
diff --git a/dspace-api/src/main/java/org/dspace/checker/LimitedCountDispatcher.java b/dspace-api/src/main/java/org/dspace/checker/LimitedCountDispatcher.java
index 49e6021be8..9e18570890 100644
--- a/dspace-api/src/main/java/org/dspace/checker/LimitedCountDispatcher.java
+++ b/dspace-api/src/main/java/org/dspace/checker/LimitedCountDispatcher.java
@@ -67,6 +67,7 @@ public class LimitedCountDispatcher implements BitstreamDispatcher
* Retreives the next bitstream to be checked.
*
* @return the bitstream
+ * @throws SQLException if database error
*/
@Override
public Bitstream next() throws SQLException {
diff --git a/dspace-api/src/main/java/org/dspace/checker/LimitedDurationDispatcher.java b/dspace-api/src/main/java/org/dspace/checker/LimitedDurationDispatcher.java
index 763ae5a7d3..21547d280d 100644
--- a/dspace-api/src/main/java/org/dspace/checker/LimitedDurationDispatcher.java
+++ b/dspace-api/src/main/java/org/dspace/checker/LimitedDurationDispatcher.java
@@ -67,6 +67,7 @@ public class LimitedDurationDispatcher implements BitstreamDispatcher
}
/**
+ * @throws SQLException if database error
* @see org.dspace.checker.BitstreamDispatcher#next()
*/
@Override
diff --git a/dspace-api/src/main/java/org/dspace/checker/MostRecentChecksumServiceImpl.java b/dspace-api/src/main/java/org/dspace/checker/MostRecentChecksumServiceImpl.java
index c5015a110c..efe9298168 100644
--- a/dspace-api/src/main/java/org/dspace/checker/MostRecentChecksumServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/checker/MostRecentChecksumServiceImpl.java
@@ -60,11 +60,13 @@ public class MostRecentChecksumServiceImpl implements MostRecentChecksumService
* Find all bitstreams that were set to not be processed for the specified
* date range.
*
+ * @param context Context
* @param startDate
* the start of the date range
* @param endDate
* the end of the date range
* @return a list of BitstreamHistoryInfo objects
+ * @throws SQLException if database error
*/
@Override
public List findNotProcessedBitstreamsReport(Context context, Date startDate, Date endDate) throws SQLException
@@ -76,6 +78,7 @@ public class MostRecentChecksumServiceImpl implements MostRecentChecksumService
* Select the most recent bitstream for a given date range with the
* specified status.
*
+ * @param context Context
* @param startDate
* the start date range
* @param endDate
@@ -84,6 +87,7 @@ public class MostRecentChecksumServiceImpl implements MostRecentChecksumService
* the result code
*
* @return a list of BitstreamHistoryInfo objects
+ * @throws SQLException if database error
*/
@Override
public List findBitstreamResultTypeReport(Context context, Date startDate, Date endDate, ChecksumResultCode resultCode) throws SQLException {
@@ -94,6 +98,8 @@ public class MostRecentChecksumServiceImpl implements MostRecentChecksumService
* Queries the bitstream table for bitstream IDs that are not yet in the
* most_recent_checksum table, and inserts them into the
* most_recent_checksum and checksum_history tables.
+ * @param context Context
+ * @throws SQLException if database error
*/
@Override
public void updateMissingBitstreams(Context context) throws SQLException {
@@ -161,7 +167,9 @@ public class MostRecentChecksumServiceImpl implements MostRecentChecksumService
* Get the oldest most recent checksum record. If more than
* one found the first one in the result set is returned.
*
+ * @param context COntext
* @return the oldest MostRecentChecksum or NULL if the table is empty
+ * @throws SQLException if database error
*
*/
@Override
@@ -174,8 +182,10 @@ public class MostRecentChecksumServiceImpl implements MostRecentChecksumService
* Returns the oldest bitstream that in the set of bitstreams that are less
* than the specified date. If no bitstreams are found -1 is returned.
*
- * @param lessThanDate
+ * @param context context
+ * @param lessThanDate date
* @return id of olded bitstream or -1 if not bitstreams are found
+ * @throws SQLException if database error
*/
@Override
public MostRecentChecksum findOldestRecord(Context context, Date lessThanDate) throws SQLException
diff --git a/dspace-api/src/main/java/org/dspace/checker/ResultsLogger.java b/dspace-api/src/main/java/org/dspace/checker/ResultsLogger.java
index 78a4b14374..8ae5364efe 100644
--- a/dspace-api/src/main/java/org/dspace/checker/ResultsLogger.java
+++ b/dspace-api/src/main/java/org/dspace/checker/ResultsLogger.java
@@ -83,9 +83,11 @@ public class ResultsLogger implements ChecksumResultsCollector
/**
* Collect a result for logging.
*
+ * @param context Context
* @param info
* the BitstreamInfo representing the result.
- * @see org.dspace.checker.ChecksumResultsCollector#collect(org.dspace.checker.MostRecentChecksum)
+ * @throws SQLException if database error
+ * @see org.dspace.checker.ChecksumResultsCollector#collect(org.dspace.core.Context, org.dspace.checker.MostRecentChecksum)
*/
@Override
public void collect(Context context, MostRecentChecksum info) throws SQLException {
diff --git a/dspace-api/src/main/java/org/dspace/checker/ResultsPruner.java b/dspace-api/src/main/java/org/dspace/checker/ResultsPruner.java
index 92c216cdca..292728a668 100644
--- a/dspace-api/src/main/java/org/dspace/checker/ResultsPruner.java
+++ b/dspace-api/src/main/java/org/dspace/checker/ResultsPruner.java
@@ -49,6 +49,7 @@ public final class ResultsPruner
* Factory method for the default results pruner configuration using
* dspace.cfg
*
+ * @param context Context
* @return a ResultsPruner that represent the default retention policy
*/
public static ResultsPruner getDefaultPruner(Context context)
@@ -69,10 +70,11 @@ public final class ResultsPruner
/**
* Factory method for ResultsPruners
*
+ * @param context Context
* @param propsFile
* to configure the results pruner.
* @return the configured results pruner.
- * @throws FileNotFoundException
+ * @throws FileNotFoundException if file doesn't exist
* it the configuration file cannot be found.
*/
public static ResultsPruner getPruner(Context context, String propsFile)
@@ -112,8 +114,10 @@ public final class ResultsPruner
* Factory method for ResultsPruners (used to load ConfigurationManager
* properties.
*
- * @param props
- * @throws FileNotFoundException
+ * @param context Context
+ * @param props Properties
+ * @return pruner
+ * @throws FileNotFoundException if file doesn't exist
*/
public static ResultsPruner getPruner(Context context, Properties props)
throws FileNotFoundException
@@ -177,6 +181,7 @@ public final class ResultsPruner
/**
* Default Constructor
+ * @param context Context
*/
public ResultsPruner(Context context)
{
@@ -211,8 +216,7 @@ public final class ResultsPruner
* before bitstreams with the specified result type in the
* checksum history is removed.
*
- * @throws ParseException
- * if the duration cannot be parsed into a long value.
+ * @throws ParseException if the duration cannot be parsed into a long value.
*/
public void addInterested(ChecksumResultCode result, String duration)
throws ParseException
@@ -235,6 +239,7 @@ public final class ResultsPruner
* registered with this object.
*
* @return number of results removed.
+ * @throws SQLException if database error
*/
public int prune() throws SQLException {
ChecksumResultCode[] codes = ChecksumResultCode.values();
diff --git a/dspace-api/src/main/java/org/dspace/checker/SimpleDispatcher.java b/dspace-api/src/main/java/org/dspace/checker/SimpleDispatcher.java
index ab8b7c0aec..9b3ea00a22 100644
--- a/dspace-api/src/main/java/org/dspace/checker/SimpleDispatcher.java
+++ b/dspace-api/src/main/java/org/dspace/checker/SimpleDispatcher.java
@@ -47,6 +47,7 @@ public class SimpleDispatcher implements BitstreamDispatcher
/**
* Creates a new SimpleDispatcher.
*
+ * @param context Context
* @param startTime
* timestamp for beginning of checker process
* @param looping
@@ -71,6 +72,7 @@ public class SimpleDispatcher implements BitstreamDispatcher
/**
* Selects the next candidate bitstream.
*
+ * @throws SQLException if database error
* @see org.dspace.checker.BitstreamDispatcher#next()
*/
@Override
diff --git a/dspace-api/src/main/java/org/dspace/checker/SimpleReporterServiceImpl.java b/dspace-api/src/main/java/org/dspace/checker/SimpleReporterServiceImpl.java
index f11fa28a5f..daeba9c0f1 100644
--- a/dspace-api/src/main/java/org/dspace/checker/SimpleReporterServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/checker/SimpleReporterServiceImpl.java
@@ -30,7 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
* @author Grace Carpenter
* @author Nathan Sarr
*
- * @todo estimate string buffer sizes.
+ * TODO estimate string buffer sizes.
*/
public class SimpleReporterServiceImpl implements SimpleReporterService
{
@@ -55,6 +55,7 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
* Sends the Deleted bitstream report to an administrator. for the
* specified date range.
*
+ * @param context context
* @param startDate
* the start date for the range
* @param endDate
@@ -64,8 +65,9 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
*
* @return number of bitstreams found
*
- * @throws IOException
+ * @throws IOException if IO error
* if io error occurs
+ * @throws SQLException if database error
*/
@Override
public int getDeletedBitstreamReport(Context context, Date startDate, Date endDate,
@@ -100,6 +102,7 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
/**
* Send the checksum changed report for the specified date range.
*
+ * @param context context
* @param startDate
* the start date for the range
* @param endDate
@@ -109,8 +112,9 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
*
* @return number of bitstreams found
*
- * @throws IOException
+ * @throws IOException if IO error
* if io error occurs
+ * @throws SQLException if database error
*/
@Override
public int getChangedChecksumReport(Context context, Date startDate, Date endDate,
@@ -147,6 +151,7 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
/**
* Send the bitstream not found report for the specified date range.
*
+ * @param context context
* @param startDate
* the start date for the range.
* @param endDate
@@ -156,8 +161,9 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
*
* @return number of bitstreams found
*
- * @throws IOException
+ * @throws IOException if IO error
* if io error occurs
+ * @throws SQLException if database error
*/
@Override
public int getBitstreamNotFoundReport(Context context, Date startDate, Date endDate,
@@ -193,6 +199,7 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
* Send the bitstreams that were set to not be processed report for the
* specified date range.
*
+ * @param context context
* @param startDate
* the start date for the range
* @param endDate
@@ -202,8 +209,9 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
*
* @return number of bitstreams found
*
- * @throws IOException
+ * @throws IOException if IO error
* if io error occurs
+ * @throws SQLException if database error
*/
@Override
public int getNotToBeProcessedReport(Context context, Date startDate, Date endDate,
@@ -239,13 +247,15 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
/**
* Get any bitstreams that are not checked by the checksum checker.
*
+ * @param context context
* @param osw
* the OutputStreamWriter to write to
*
* @return the number of unchecked bitstreams
*
- * @throws IOException
+ * @throws IOException if IO error
* if io error occurs
+ * @throws SQLException if database error
*/
@Override
public int getUncheckedBitstreamsReport(Context context, OutputStreamWriter osw)
@@ -282,7 +292,7 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
* @param osw
* the output stream writer to write to.
*
- * @throws IOException
+ * @throws IOException if IO error
* if io error occurs
*/
protected void printHistoryRecords(List mostRecentChecksums, OutputStreamWriter osw)
@@ -313,13 +323,15 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
/**
* Create a list of the found history records.
*
+ * @param context context
* @param bitstreams
* the list of history records to be iterated over.
* @param osw
* the output stream to write to.
*
- * @throws IOException
+ * @throws IOException if IO error
* if io error occurs
+ * @throws SQLException if database error
*/
protected void printDSpaceInfoRecords(Context context, List bitstreams, OutputStreamWriter osw)
throws IOException, SQLException {
diff --git a/dspace-api/src/main/java/org/dspace/checker/dao/ChecksumHistoryDAO.java b/dspace-api/src/main/java/org/dspace/checker/dao/ChecksumHistoryDAO.java
index b513cd45ca..0aea30166e 100644
--- a/dspace-api/src/main/java/org/dspace/checker/dao/ChecksumHistoryDAO.java
+++ b/dspace-api/src/main/java/org/dspace/checker/dao/ChecksumHistoryDAO.java
@@ -19,7 +19,7 @@ import java.util.Date;
/**
* Database Access Object interface class for the ChecksumHistory object.
* The implementation of this class is responsible for all database calls for the ChecksumHistory object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
@@ -33,7 +33,7 @@ public interface ChecksumHistoryDAO extends GenericDAO {
* @param retentionDate row must be older than this to be deleted.
* @param checksumResultCode row must have this result to be deleted.
* @return number of rows deleted.
- * @throws SQLException
+ * @throws SQLException if database error
*/
public int deleteByDateAndCode(Context context, Date retentionDate, ChecksumResultCode checksumResultCode) throws SQLException;
@@ -42,7 +42,7 @@ public interface ChecksumHistoryDAO extends GenericDAO {
*
* @param context
* @param bitstream
- * @throws SQLException
+ * @throws SQLException if database error
*/
public void deleteByBitstream(Context context, Bitstream bitstream) throws SQLException;
}
diff --git a/dspace-api/src/main/java/org/dspace/checker/dao/ChecksumResultDAO.java b/dspace-api/src/main/java/org/dspace/checker/dao/ChecksumResultDAO.java
index 0cb5795ec8..6f688ec10b 100644
--- a/dspace-api/src/main/java/org/dspace/checker/dao/ChecksumResultDAO.java
+++ b/dspace-api/src/main/java/org/dspace/checker/dao/ChecksumResultDAO.java
@@ -17,7 +17,7 @@ import java.sql.SQLException;
/**
* Database Access Object interface class for the ChecksumResult object.
* The implementation of this class is responsible for all database calls for the ChecksumResult object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
diff --git a/dspace-api/src/main/java/org/dspace/checker/dao/MostRecentChecksumDAO.java b/dspace-api/src/main/java/org/dspace/checker/dao/MostRecentChecksumDAO.java
index bcd78a745c..578abce624 100644
--- a/dspace-api/src/main/java/org/dspace/checker/dao/MostRecentChecksumDAO.java
+++ b/dspace-api/src/main/java/org/dspace/checker/dao/MostRecentChecksumDAO.java
@@ -20,7 +20,7 @@ import java.util.List;
/**
* Database Access Object interface class for the MostRecentChecksum object.
* The implementation of this class is responsible for all database calls for the MostRecentChecksum object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
diff --git a/dspace-api/src/main/java/org/dspace/checker/service/ChecksumHistoryService.java b/dspace-api/src/main/java/org/dspace/checker/service/ChecksumHistoryService.java
index fabfbc884c..578214ac1d 100644
--- a/dspace-api/src/main/java/org/dspace/checker/service/ChecksumHistoryService.java
+++ b/dspace-api/src/main/java/org/dspace/checker/service/ChecksumHistoryService.java
@@ -35,11 +35,13 @@ public interface ChecksumHistoryService {
/**
* Prune the history records from the database.
*
+ * @param context context
* @param interests
* set of results and the duration of time before they are
* removed from the database
*
* @return number of bitstreams deleted
+ * @throws SQLException if database error
*/
public int prune(Context context, Map interests) throws SQLException;
}
diff --git a/dspace-api/src/main/java/org/dspace/checker/service/SimpleReporterService.java b/dspace-api/src/main/java/org/dspace/checker/service/SimpleReporterService.java
index 6f1fb1ab50..b4b159890e 100644
--- a/dspace-api/src/main/java/org/dspace/checker/service/SimpleReporterService.java
+++ b/dspace-api/src/main/java/org/dspace/checker/service/SimpleReporterService.java
@@ -29,6 +29,7 @@ public interface SimpleReporterService
* Returns the bitstreams set found to be deleted for the specified date
* range.
*
+ * @param context context
* @param startDate
* the start date range
* @param endDate
@@ -38,8 +39,9 @@ public interface SimpleReporterService
*
* @return number of bitstreams found
*
- * @throws IOException
+ * @throws IOException if IO error
* if io error occurs
+ * @throws SQLException if database error
*/
public int getDeletedBitstreamReport(Context context, Date startDate, Date endDate,
OutputStreamWriter osw) throws IOException, SQLException;
@@ -48,6 +50,7 @@ public interface SimpleReporterService
* The a report of bitstreams found where the checksum has been changed
* since the last check for the specified date range.
*
+ * @param context context
* @param startDate
* the start date range.
* @param endDate
@@ -57,8 +60,9 @@ public interface SimpleReporterService
*
* @return number of bitstreams found
*
- * @throws IOException
+ * @throws IOException if IO error
* if io error occurs
+ * @throws SQLException if database error
*/
public int getChangedChecksumReport(Context context, Date startDate, Date endDate,
OutputStreamWriter osw) throws IOException, SQLException;
@@ -67,6 +71,7 @@ public interface SimpleReporterService
* The report of bitstreams for the specified date range where it was
* determined the bitstreams can no longer be found.
*
+ * @param context context
* @param startDate
* the start date range.
* @param endDate
@@ -76,8 +81,9 @@ public interface SimpleReporterService
*
* @return number of bitstreams found
*
- * @throws IOException
+ * @throws IOException if IO error
* if io error occurs
+ * @throws SQLException if database error
*/
public int getBitstreamNotFoundReport(Context context, Date startDate, Date endDate,
OutputStreamWriter osw) throws IOException, SQLException;
@@ -86,15 +92,18 @@ public interface SimpleReporterService
* The bitstreams that were set to not be processed report for the specified
* date range.
*
+ * @param context context
* @param startDate
* the start date range.
* @param endDate
* the end date range.
* @param osw
* the output stream writer to write to
+ * @return number of bitstreams found
*
- * @throws IOException
+ * @throws IOException if IO error
* if io error occurs
+ * @throws SQLException if database error
*
*/
public int getNotToBeProcessedReport(Context context, Date startDate, Date endDate,
@@ -104,13 +113,15 @@ public interface SimpleReporterService
* The bitstreams that are not known to the checksum checker. This means
* they are in the bitstream table but not in the most recent checksum table
*
+ * @param context context
* @param osw
* the output stream writer to write to
*
* @return number of bitstreams found
*
- * @throws IOException
+ * @throws IOException if IO error
* if io error occurs
+ * @throws SQLException if database error
*
*/
public int getUncheckedBitstreamsReport(Context context, OutputStreamWriter osw)
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 56ea77ea4d..8632cd23c3 100644
--- a/dspace-api/src/main/java/org/dspace/content/Bitstream.java
+++ b/dspace-api/src/main/java/org/dspace/content/Bitstream.java
@@ -127,8 +127,10 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
/**
* Set the name of the bitstream
*
+ * @param context context
* @param n
* the new name of the bitstream
+ * @throws SQLException if database error
*/
public void setName(Context context, String n) throws SQLException {
getBitstreamService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "title", null, null, n);
@@ -149,8 +151,10 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
/**
* Set the source of the bitstream
*
+ * @param context context
* @param n
* the new source of the bitstream
+ * @throws SQLException if database error
*/
public void setSource(Context context, String n) throws SQLException {
getBitstreamService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "source", null, null, n);
@@ -170,8 +174,10 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
/**
* Set the description of the bitstream
*
+ * @param context context
* @param n
* the new description of the bitstream
+ * @throws SQLException if database error
*/
public void setDescription(Context context, String n) throws SQLException {
getBitstreamService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "description", null, null, n);
@@ -238,7 +244,9 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
/**
* Get the format of the bitstream
*
+ * @param context context
* @return the format of this bitstream
+ * @throws SQLException if database error
*/
public BitstreamFormat getFormat(Context context) throws SQLException
{
@@ -255,6 +263,7 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* This method allows us to verify is the bitstream is still valid
*
* @return true if the bitstream has been deleted
+ * @throws SQLException if database error
*/
public boolean isDeleted() throws SQLException
{
@@ -269,7 +278,7 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* Get the bundles this bitstream appears in
*
* @return array of Bundle
s this bitstream appears in
- * @throws SQLException
+ * @throws SQLException if database error
*/
public List getBundles() throws SQLException
{
@@ -312,7 +321,7 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
/**
* Set the asset store number where this bitstream is stored
*
- * @return the asset store number of the bitstream
+ * @param storeNumber asset store number of the bitstream
*/
public void setStoreNumber(int storeNumber) {
this.storeNumber = storeNumber;
@@ -335,9 +344,10 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* Set the user's format description. This implies that the format of the
* bitstream is uncertain, and the format is set to "unknown."
*
+ * @param context
* @param desc
* the user's description of the format
- * @throws SQLException
+ * @throws SQLException if database error
*/
public void setUserFormatDescription(Context context, String desc) throws SQLException
{
@@ -348,7 +358,9 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* Get the description of the format - either the user's or the description
* of the format defined by the system.
*
+ * @param context context
* @return a description of the format.
+ * @throws SQLException if database error
*/
public String getFormatDescription(Context context) throws SQLException
{
@@ -360,10 +372,11 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* description, it is cleared. Passing in null
sets the type
* of this bitstream to "unknown".
*
+ * @param context context
* @param f
* the format of this bitstream, or null
for
* unknown
- * @throws SQLException
+ * @throws SQLException if database error
*/
public void setFormat(Context context, BitstreamFormat f) throws SQLException
{
diff --git a/dspace-api/src/main/java/org/dspace/content/BitstreamFormat.java b/dspace-api/src/main/java/org/dspace/content/BitstreamFormat.java
index 4561b037ca..7ed93abeaa 100644
--- a/dspace-api/src/main/java/org/dspace/content/BitstreamFormat.java
+++ b/dspace-api/src/main/java/org/dspace/content/BitstreamFormat.java
@@ -9,17 +9,22 @@ package org.dspace.content;
import java.io.Serializable;
import java.sql.SQLException;
+import java.util.LinkedList;
import java.util.List;
import org.dspace.content.factory.ContentServiceFactory;
import org.dspace.content.service.BitstreamFormatService;
import org.dspace.core.Context;
+import org.dspace.core.ReloadableEntity;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CollectionId;
import org.hibernate.annotations.Type;
import org.hibernate.proxy.HibernateProxyHelper;
import javax.persistence.*;
+import java.io.Serializable;
+import java.sql.SQLException;
+import java.util.List;
/**
* Class representing a particular bitstream format.
@@ -32,14 +37,14 @@ import javax.persistence.*;
*/
@Entity
@Table(name="bitstreamformatregistry")
-public class BitstreamFormat implements Serializable
+public class BitstreamFormat implements Serializable, ReloadableEntity
{
@Id
@Column(name="bitstream_format_id", nullable = false, unique = true)
@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="bitstreamformatregistry_seq")
@SequenceGenerator(name="bitstreamformatregistry_seq", sequenceName="bitstreamformatregistry_seq", allocationSize = 1, initialValue = 1)
- private int id;
+ private Integer id;
@Column(name="short_description", length = 128, unique = true)
private String shortDescription;
@@ -102,7 +107,7 @@ public class BitstreamFormat implements Serializable
*/
protected BitstreamFormat()
{
-
+ fileExtensions = new LinkedList<>();
}
/**
@@ -110,7 +115,7 @@ public class BitstreamFormat implements Serializable
*
* @return the internal identifier
*/
- public final int getID()
+ public final Integer getID()
{
return id;
}
diff --git a/dspace-api/src/main/java/org/dspace/content/BitstreamFormatServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/BitstreamFormatServiceImpl.java
index 1adc5054c4..1c300f7ab2 100644
--- a/dspace-api/src/main/java/org/dspace/content/BitstreamFormatServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/BitstreamFormatServiceImpl.java
@@ -18,6 +18,7 @@ import org.dspace.core.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import java.sql.SQLException;
+import java.util.Collections;
import java.util.List;
/**
@@ -59,7 +60,7 @@ public class BitstreamFormatServiceImpl implements BitstreamFormatService {
* ID of the bitstream format
*
* @return the bitstream format, or null if the ID is invalid.
- * @throws SQLException
+ * @throws SQLException if database error
*/
@Override
public BitstreamFormat find(Context context, int id)
@@ -181,17 +182,25 @@ public class BitstreamFormatServiceImpl implements BitstreamFormatService {
@Override
public void update(Context context, BitstreamFormat bitstreamFormat) throws SQLException, AuthorizeException {
- // Check authorisation - only administrators can change formats
- if (!authorizeService.isAdmin(context))
- {
- throw new AuthorizeException(
- "Only administrators can modify bitstream formats");
+ update(context, Collections.singletonList(bitstreamFormat));
+ }
+
+ @Override
+ public void update(Context context, List bitstreamFormats) throws SQLException, AuthorizeException {
+ if(CollectionUtils.isNotEmpty(bitstreamFormats)) {
+ // Check authorisation - only administrators can change formats
+ if (!authorizeService.isAdmin(context)) {
+ throw new AuthorizeException(
+ "Only administrators can modify bitstream formats");
+ }
+
+ for (BitstreamFormat bitstreamFormat : bitstreamFormats) {
+ log.info(LogManager.getHeader(context, "update_bitstream_format",
+ "bitstream_format_id=" + bitstreamFormat.getID()));
+
+ bitstreamFormatDAO.save(context, bitstreamFormat);
+ }
}
-
- log.info(LogManager.getHeader(context, "update_bitstream_format",
- "bitstream_format_id=" + bitstreamFormat.getID()));
-
- bitstreamFormatDAO.save(context, bitstreamFormat);
}
@Override
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 5689530579..5dff3287ac 100644
--- a/dspace-api/src/main/java/org/dspace/content/BitstreamServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/BitstreamServiceImpl.java
@@ -144,8 +144,9 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl imp
* @param assetstore corresponds to an assetstore in dspace.cfg
* @param bitstreamPath the path and filename relative to the assetstore
* @return the newly registered bitstream
- * @throws IOException
- * @throws SQLException
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public Bitstream register(Context context,
@@ -255,7 +256,9 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl imp
//Remove all bundles from the bitstream object, clearing the connection in 2 ways
bundles.clear();
- deleteMetadata(context, bitstream);
+
+ // Remove policies
+ authorizeService.removeAllPolicies(context, bitstream);
// Remove bitstream itself
bitstream.setDeleted(true);
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 9bf2111ad4..ef2f7173ce 100644
--- a/dspace-api/src/main/java/org/dspace/content/Bundle.java
+++ b/dspace-api/src/main/java/org/dspace/content/Bundle.java
@@ -88,9 +88,11 @@ public class Bundle extends DSpaceObject implements DSpaceObjectLegacySupport
/**
* Set the name of the bundle
*
+ * @param context context
* @param name
* string name of the bundle (ORIGINAL, TEXT, THUMBNAIL) are the
* values currently used
+ * @throws SQLException if database error
*/
public void setName(Context context, String name) throws SQLException
{
@@ -197,6 +199,7 @@ public class Bundle extends DSpaceObject implements DSpaceObjectLegacySupport
/**
* return type found in Constants
+ * @return bundle type
*/
@Override
public int getType()
diff --git a/dspace-api/src/main/java/org/dspace/content/BundleServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/BundleServiceImpl.java
index 4402c9d6b2..73043d6451 100644
--- a/dspace-api/src/main/java/org/dspace/content/BundleServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/BundleServiceImpl.java
@@ -416,8 +416,6 @@ public class BundleServiceImpl extends DSpaceObjectServiceImpl implement
// remove our authorization policies
authorizeService.removeAllPolicies(context, bundle);
- deleteMetadata(context, bundle);
-
// Remove ourself
bundleDAO.delete(context, bundle);
}
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 9bc9058bff..43a145842c 100644
--- a/dspace-api/src/main/java/org/dspace/content/Collection.java
+++ b/dspace-api/src/main/java/org/dspace/content/Collection.java
@@ -228,8 +228,9 @@ public class Collection extends DSpaceObject implements DSpaceObjectLegacySuppor
* Set the license for this collection. Passing in null
means
* that the site-wide default will be used.
*
- * @param license
- * the license, or null
+ * @param context context
+ * @param license the license, or null
+ * @throws SQLException if database error
*/
public void setLicense(Context context, String license) throws SQLException {
getCollectionService().setMetadata(context, this, "license", license);
@@ -242,6 +243,7 @@ public class Collection extends DSpaceObject implements DSpaceObjectLegacySuppor
* for a submission.
*
* @return the item template, or null
+ * @throws SQLException if database error
*/
public Item getTemplateItem() throws SQLException
{
@@ -257,7 +259,7 @@ public class Collection extends DSpaceObject implements DSpaceObjectLegacySuppor
* Get the communities this collection appears in
*
* @return array of Community
objects
- * @throws SQLException
+ * @throws SQLException if database error
*/
public List getCommunities() throws SQLException
{
diff --git a/dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
index 5b46309e4b..28e35b0531 100644
--- a/dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java
@@ -23,6 +23,8 @@ import org.dspace.eperson.Group;
import org.dspace.eperson.service.GroupService;
import org.dspace.eperson.service.SubscribeService;
import org.dspace.event.Event;
+import org.dspace.harvest.HarvestedCollection;
+import org.dspace.harvest.service.HarvestedCollectionService;
import org.dspace.workflow.factory.WorkflowServiceFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -63,6 +65,8 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl i
protected SubscribeService subscribeService;
@Autowired(required = true)
protected WorkspaceItemService workspaceItemService;
+ @Autowired(required=true)
+ protected HarvestedCollectionService harvestedCollectionService;
protected CollectionServiceImpl()
@@ -635,6 +639,13 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl i
log.info(LogManager.getHeader(context, "delete_collection",
"collection_id=" + collection.getID()));
+ // remove harvested collections.
+ HarvestedCollection hc = harvestedCollectionService.find(context,collection);
+ if(hc!=null)
+ {
+ harvestedCollectionService.delete(context, hc);
+ }
+
context.addEvent(new Event(Event.DELETE, Constants.COLLECTION,
collection.getID(), collection.getHandle(), getIdentifiers(context, collection)));
@@ -725,8 +736,6 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl i
groupService.delete(context, g);
}
-
- deleteMetadata(context, collection);
Iterator owningCommunities = collection.getCommunities().iterator();
while (owningCommunities.hasNext())
{
diff --git a/dspace-api/src/main/java/org/dspace/content/Community.java b/dspace-api/src/main/java/org/dspace/content/Community.java
index e998db44e4..8e0897208e 100644
--- a/dspace-api/src/main/java/org/dspace/content/Community.java
+++ b/dspace-api/src/main/java/org/dspace/content/Community.java
@@ -224,6 +224,7 @@ public class Community extends DSpaceObject implements DSpaceObjectLegacySupport
/**
* return type found in Constants
+ * @return Community type
*/
@Override
public int getType()
diff --git a/dspace-api/src/main/java/org/dspace/content/CommunityServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/CommunityServiceImpl.java
index d56d91ee89..baefeaab3e 100644
--- a/dspace-api/src/main/java/org/dspace/content/CommunityServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/CommunityServiceImpl.java
@@ -328,6 +328,9 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl imp
/**
* Internal method to process subcommunities recursively
+ * @param community community
+ * @param collectionList list of collections
+ * @throws SQLException if database error
*/
protected void addCollectionList(Community community, List collectionList) throws SQLException
{
@@ -489,9 +492,11 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl imp
* Internal method to remove the community and all its children from the
* database, and perform any pre/post-cleanup
*
- * @throws SQLException
- * @throws AuthorizeException
- * @throws IOException
+ * @param context context
+ * @param community community
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
+ * @throws IOException if IO error
*/
protected void rawDelete(Context context, Community community) throws SQLException, AuthorizeException, IOException
{
@@ -528,9 +533,6 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl imp
// Remove any Handle
handleService.unbindHandle(context, community);
- deleteMetadata(context, community);
-
-
Group g = community.getAdministrators();
// Delete community row
diff --git a/dspace-api/src/main/java/org/dspace/content/DCSeriesNumber.java b/dspace-api/src/main/java/org/dspace/content/DCSeriesNumber.java
index 93e79b138e..9820687d49 100644
--- a/dspace-api/src/main/java/org/dspace/content/DCSeriesNumber.java
+++ b/dspace-api/src/main/java/org/dspace/content/DCSeriesNumber.java
@@ -93,6 +93,7 @@ public class DCSeriesNumber
/**
* Get the series name - guaranteed non-null
+ * @return name
*/
public String getSeries()
{
@@ -101,6 +102,7 @@ public class DCSeriesNumber
/**
* Get the number - guaranteed non-null
+ * @return number
*/
public String getNumber()
{
diff --git a/dspace-api/src/main/java/org/dspace/content/DSpaceObject.java b/dspace-api/src/main/java/org/dspace/content/DSpaceObject.java
index 61013746bc..280e10e274 100644
--- a/dspace-api/src/main/java/org/dspace/content/DSpaceObject.java
+++ b/dspace-api/src/main/java/org/dspace/content/DSpaceObject.java
@@ -8,7 +8,10 @@
package org.dspace.content;
import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.dspace.authorize.ResourcePolicy;
+import org.dspace.core.ReloadableEntity;
import org.dspace.handle.Handle;
import org.hibernate.annotations.GenericGenerator;
@@ -23,7 +26,7 @@ import javax.persistence.*;
@Entity
@Inheritance(strategy= InheritanceType.JOINED)
@Table(name = "dspaceobject")
-public abstract class DSpaceObject implements Serializable
+public abstract class DSpaceObject implements Serializable, ReloadableEntity
{
@Id
@GeneratedValue(generator = "system-uuid")
@@ -36,18 +39,18 @@ public abstract class DSpaceObject implements Serializable
@Transient
private StringBuffer eventDetails = null;
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "dSpaceObject", cascade={CascadeType.PERSIST}, orphanRemoval = true)
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "dSpaceObject", cascade = CascadeType.ALL, orphanRemoval = true)
@OrderBy("metadataField, place")
private List metadata = new ArrayList<>();
@OneToMany(fetch = FetchType.LAZY, mappedBy = "dso")
// Order by is here to ensure that the oldest handle is retrieved first,
// multiple handles are assigned to the latest version of an item the original handle will have the lowest identifier
- // This handle is the prefered handle.
- @OrderBy("handle_id ASC")
+ // This handle is the preferred handle.
+ @OrderBy("id ASC")
private List handles = new ArrayList<>();
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "dSpaceObject", cascade={CascadeType.PERSIST}, orphanRemoval = false)
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "dSpaceObject", cascade = CascadeType.ALL)
private List resourcePolicies = new ArrayList<>();
/**
@@ -192,4 +195,5 @@ public abstract class DSpaceObject implements Serializable
protected void setModified() {
this.modified = true;
}
+
}
\ No newline at end of file
diff --git a/dspace-api/src/main/java/org/dspace/content/DSpaceObjectServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/DSpaceObjectServiceImpl.java
index 14c3dd9114..91f1b7a833 100644
--- a/dspace-api/src/main/java/org/dspace/content/DSpaceObjectServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/DSpaceObjectServiceImpl.java
@@ -34,6 +34,7 @@ import java.util.*;
* are required to have.
*
* @author kevinvandevelde at atmire.com
+ * @param class type
*/
public abstract class DSpaceObjectServiceImpl implements DSpaceObjectService {
@@ -204,31 +205,16 @@ public abstract class DSpaceObjectServiceImpl implements
@Override
public void addMetadata(Context context, T dso, String schema, String element, String qualifier, String lang, List values) throws SQLException {
- String fieldKey = metadataAuthorityService.makeFieldKey(schema, element, qualifier);
- if (metadataAuthorityService.isAuthorityControlled(fieldKey))
- {
- List authorities = new ArrayList();
- List confidences = new ArrayList();
- for (int i = 0; i < values.size(); ++i)
- {
- if(dso instanceof Item)
- {
- getAuthoritiesAndConfidences(fieldKey, ((Item) dso).getOwningCollection(), values, authorities, confidences, i);
- }else{
- getAuthoritiesAndConfidences(fieldKey, null, values, authorities, confidences, i);
- }
- }
- addMetadata(context, dso, schema, element, qualifier, lang, values, authorities, confidences);
- }
- else
- {
- addMetadata(context, dso, schema, element, qualifier, lang, values, null, null);
+ MetadataField metadataField = metadataFieldService.findByElement(context, schema, element, qualifier);
+ if (metadataField == null) {
+ throw new SQLException("bad_dublin_core schema=" + schema + "." + element + "." + qualifier);
}
+
+ addMetadata(context, dso, metadataField, lang, values);
}
@Override
public void addMetadata(Context context, T dso, String schema, String element, String qualifier, String lang, List values, List authorities, List confidences) throws SQLException {
-
// We will not verify that they are valid entries in the registry
// until update() is called.
MetadataField metadataField = metadataFieldService.findByElement(context, schema, element, qualifier);
@@ -315,8 +301,28 @@ public abstract class DSpaceObjectServiceImpl implements
@Override
public void addMetadata(Context context, T dso, MetadataField metadataField, String language, String value) throws SQLException {
- addMetadata(context, dso, metadataField, language, Arrays.asList(value), null, null);
+ addMetadata(context, dso, metadataField, language, Arrays.asList(value));
+ }
+ @Override
+ public void addMetadata(Context context, T dso, MetadataField metadataField, String language, List values) throws SQLException {
+ if(metadataField != null) {
+ String fieldKey = metadataAuthorityService.makeFieldKey(metadataField.getMetadataSchema().getName(), metadataField.getElement(), metadataField.getQualifier());
+ if (metadataAuthorityService.isAuthorityControlled(fieldKey)) {
+ List authorities = new ArrayList();
+ List confidences = new ArrayList();
+ for (int i = 0; i < values.size(); ++i) {
+ if (dso instanceof Item) {
+ getAuthoritiesAndConfidences(fieldKey, ((Item) dso).getOwningCollection(), values, authorities, confidences, i);
+ } else {
+ getAuthoritiesAndConfidences(fieldKey, null, values, authorities, confidences, i);
+ }
+ }
+ addMetadata(context, dso, metadataField, language, values, authorities, confidences);
+ } else {
+ addMetadata(context, dso, metadataField, language, values, null, null);
+ }
+ }
}
@Override
@@ -357,6 +363,12 @@ public abstract class DSpaceObjectServiceImpl implements
/**
* Retrieve first metadata field value
+ * @param dso
+ * @param language
+ * @param element
+ * @param schema
+ * @param qualifier
+ * @return
*/
@Override
public String getMetadataFirstValue(T dso, String schema, String element, String qualifier, String language){
@@ -369,6 +381,7 @@ public abstract class DSpaceObjectServiceImpl implements
/**
* Set first metadata field value
+ * @throws SQLException if database error
*/
@Override
public void setMetadataSingleValue(Context context, T dso, String schema, String element, String qualifier, String language, String value) throws SQLException {
@@ -380,21 +393,6 @@ public abstract class DSpaceObjectServiceImpl implements
}
}
- /**
- * Protected method that deletes all metadata values from the database, should only be called when deleting the item.
- * @param context the dspaceObject
- * @param dso the dspaceObject who's metadata we are to delete
- */
- protected void deleteMetadata(Context context, T dso) throws SQLException {
-
- Iterator metadataValueIterator = dso.getMetadata().iterator();
- while (metadataValueIterator.hasNext()) {
- MetadataValue metadataValue = metadataValueIterator.next();
- metadataValueIterator.remove();
- metadataValueService.delete(context, metadataValue);
- }
- }
-
/**
* Utility method for pattern-matching metadata elements. This
* method will return true
if the given schema,
@@ -487,10 +485,12 @@ public abstract class DSpaceObjectServiceImpl implements
/**
* Splits "schema.element.qualifier.language" into an array.
- *
- * The returned array will always have length >= 4
- *
+ *
+ * The returned array will always have length greater than or equal to 4
+ *
* Values in the returned array can be empty or null.
+ * @param fieldName field name
+ * @return array
*/
protected String[] getElements(String fieldName) {
String[] tokens = StringUtils.split(fieldName, ".");
@@ -505,10 +505,12 @@ public abstract class DSpaceObjectServiceImpl implements
/**
* Splits "schema.element.qualifier.language" into an array.
- *
- * The returned array will always have length >= 4
- *
+ *
+ * The returned array will always have length greater than or equal to 4
+ *
* When @param fill is true, elements that would be empty or null are replaced by Item.ANY
+ * @param fieldName field name
+ * @return array
*/
protected String[] getElementsFilled(String fieldName) {
String[] elements = getElements(fieldName);
diff --git a/dspace-api/src/main/java/org/dspace/content/InProgressSubmission.java b/dspace-api/src/main/java/org/dspace/content/InProgressSubmission.java
index 7979034982..7af3b1d108 100644
--- a/dspace-api/src/main/java/org/dspace/content/InProgressSubmission.java
+++ b/dspace-api/src/main/java/org/dspace/content/InProgressSubmission.java
@@ -7,10 +7,10 @@
*/
package org.dspace.content;
-import java.sql.SQLException;
-
import org.dspace.eperson.EPerson;
+import java.sql.SQLException;
+
/**
* Interface for manipulating in-progress submissions, without having to know at
* which stage of submission they are (in workspace or workflow system)
@@ -25,7 +25,7 @@ public interface InProgressSubmission
*
* @return the internal identifier
*/
- int getID();
+ Integer getID();
/**
* Get the incomplete item object
@@ -45,6 +45,7 @@ public interface InProgressSubmission
* Get the submitter
*
* @return the submitting e-person
+ * @throws SQLException if database error
*/
EPerson getSubmitter() throws SQLException;
diff --git a/dspace-api/src/main/java/org/dspace/content/Item.java b/dspace-api/src/main/java/org/dspace/content/Item.java
index a9046b27bf..3322ac5627 100644
--- a/dspace-api/src/main/java/org/dspace/content/Item.java
+++ b/dspace-api/src/main/java/org/dspace/content/Item.java
@@ -15,7 +15,6 @@ import org.dspace.eperson.EPerson;
import org.hibernate.proxy.HibernateProxyHelper;
import javax.persistence.*;
-import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -193,7 +192,6 @@ public class Item extends DSpaceObject implements DSpaceObjectLegacySupport
* Get the owning Collection for the item
*
* @return Collection that is the owner of the item
- * @throws SQLException
*/
public Collection getOwningCollection()
{
@@ -229,7 +227,6 @@ public class Item extends DSpaceObject implements DSpaceObjectLegacySupport
* Get the collections this item is in. The order is indeterminate.
*
* @return the collections this item is in, if any.
- * @throws SQLException
*/
public List getCollections()
{
diff --git a/dspace-api/src/main/java/org/dspace/content/ItemComparator.java b/dspace-api/src/main/java/org/dspace/content/ItemComparator.java
index 401fd5d8fa..f7d3900445 100644
--- a/dspace-api/src/main/java/org/dspace/content/ItemComparator.java
+++ b/dspace-api/src/main/java/org/dspace/content/ItemComparator.java
@@ -71,8 +71,8 @@ public class ItemComparator implements Comparator, Serializable
* language.
*
*
- * Return >= 1 if the first is lexicographically greater than the second; <=
- * -1 if the second is lexicographically greater than the first, and 0
+ * Return greater than or equal to 1 if the first is lexicographically greater than the second;
+ * less than or equal to -1 if the second is lexicographically greater than the first, and 0
* otherwise.
*
*
@@ -82,8 +82,8 @@ public class ItemComparator implements Comparator, Serializable
* @param second
* The second object to compare. Must be an object of type
* org.dspace.content.Item.
- * @return >= 1 if the first is lexicographically greater than the second; <=
- * -1 if the second is lexicographically greater than the first, and
+ * @return greater than or equal 1 if the first is lexicographically greater than the second;
+ * less than or equal -1 if the second is lexicographically greater than the first, and
* 0 otherwise.
*/
@Override
diff --git a/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java
index ac12adb60f..0d19c8bd2b 100644
--- a/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java
@@ -25,6 +25,8 @@ import org.dspace.core.LogManager;
import org.dspace.eperson.EPerson;
import org.dspace.eperson.Group;
import org.dspace.event.Event;
+import org.dspace.harvest.HarvestedItem;
+import org.dspace.harvest.service.HarvestedItemService;
import org.dspace.identifier.IdentifierException;
import org.dspace.identifier.service.IdentifierService;
import org.dspace.versioning.service.VersioningService;
@@ -74,6 +76,8 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl- implements It
protected IdentifierService identifierService;
@Autowired(required = true)
protected VersioningService versioningService;
+ @Autowired(required=true)
+ protected HarvestedItemService harvestedItemService;
protected ItemServiceImpl()
{
@@ -596,14 +600,20 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl
- implements It
log.info(LogManager.getHeader(context, "delete_item", "item_id="
+ item.getID()));
- deleteMetadata(context, item);
-
// Remove bundles
removeAllBundles(context, item);
// remove version attached to the item
removeVersion(context, item);
+ // Also delete the item if it appears in a harvested collection.
+ HarvestedItem hi = harvestedItemService.find(context, item);
+
+ if(hi!=null)
+ {
+ harvestedItemService.delete(context, hi);
+ }
+
//Only clear collections after we have removed everything else from the item
item.getCollections().clear();
item.setOwningCollection(null);
@@ -917,7 +927,9 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl
- implements It
* @param qualifier metadata field qualifier
* @param value field value or Item.ANY to match any value
* @return an iterator over the items matching that authority value
- * @throws SQLException, AuthorizeException, IOException
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
+ * @throws IOException if IO error
*
*/
@Override
diff --git a/dspace-api/src/main/java/org/dspace/content/LicenseUtils.java b/dspace-api/src/main/java/org/dspace/content/LicenseUtils.java
index 90f2639f76..9effd3cab9 100644
--- a/dspace-api/src/main/java/org/dspace/content/LicenseUtils.java
+++ b/dspace-api/src/main/java/org/dspace/content/LicenseUtils.java
@@ -56,7 +56,6 @@ public class LicenseUtils
* {x} any addition argument supplied wrapped in the
* LicenseArgumentFormatter based on his type (map key)
*
- * @see license.LicenseArgumentFormatter
* @param locale
* @param collection
* @param item
@@ -125,9 +124,9 @@ public class LicenseUtils
* the item object of the license
* @param licenseText
* the license the user granted
- * @throws SQLException
- * @throws IOException
- * @throws AuthorizeException
+ * @throws SQLException if database error
+ * @throws IOException if IO error
+ * @throws AuthorizeException if authorization error
*/
public static void grantLicense(Context context, Item item,
String licenseText) throws SQLException, IOException,
diff --git a/dspace-api/src/main/java/org/dspace/content/MetadataField.java b/dspace-api/src/main/java/org/dspace/content/MetadataField.java
index 267c1fa2c5..329537f31e 100644
--- a/dspace-api/src/main/java/org/dspace/content/MetadataField.java
+++ b/dspace-api/src/main/java/org/dspace/content/MetadataField.java
@@ -8,10 +8,14 @@
package org.dspace.content;
import org.dspace.core.Context;
+import org.dspace.core.ReloadableEntity;
+import org.hibernate.annotations.Cache;
+import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.proxy.HibernateProxyHelper;
import javax.persistence.*;
+
/**
* DSpace object that represents a metadata field, which is
* defined by a combination of schema, element, and qualifier. Every
@@ -23,16 +27,18 @@ import javax.persistence.*;
* @see org.dspace.content.MetadataSchema
*/
@Entity
+@Cacheable
+@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Table(name="metadatafieldregistry")
-public class MetadataField {
+public class MetadataField implements ReloadableEntity {
@Id
@Column(name="metadata_field_id", nullable = false, unique = true)
@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="metadatafieldregistry_seq")
@SequenceGenerator(name="metadatafieldregistry_seq", sequenceName="metadatafieldregistry_seq", allocationSize = 1, initialValue = 1)
- private int id;
+ private Integer id;
- @ManyToOne(fetch = FetchType.LAZY)
+ @ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "metadata_schema_id",nullable = false)
private MetadataSchema metadataSchema;
@@ -62,7 +68,7 @@ public class MetadataField {
*
* @return metadata field id
*/
- public int getFieldID()
+ public Integer getID()
{
return id;
}
@@ -170,7 +176,7 @@ public class MetadataField {
return false;
}
final MetadataField other = (MetadataField) obj;
- if (this.getFieldID() != other.getFieldID())
+ if (this.getID() != other.getID())
{
return false;
}
@@ -185,8 +191,8 @@ public class MetadataField {
public int hashCode()
{
int hash = 7;
- hash = 47 * hash + getFieldID();
- hash = 47 * hash + getMetadataSchema().getSchemaID();
+ hash = 47 * hash + getID();
+ hash = 47 * hash + getMetadataSchema().getID();
return hash;
}
diff --git a/dspace-api/src/main/java/org/dspace/content/MetadataFieldServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/MetadataFieldServiceImpl.java
index acf0449317..805a5a8c70 100644
--- a/dspace-api/src/main/java/org/dspace/content/MetadataFieldServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/MetadataFieldServiceImpl.java
@@ -58,7 +58,7 @@ public class MetadataFieldServiceImpl implements MetadataFieldService {
if (hasElement(context, -1, metadataSchema, element, qualifier))
{
throw new NonUniqueMetadataException("Please make " + element + "."
- + qualifier + " unique within schema #" + metadataSchema.getSchemaID());
+ + qualifier + " unique within schema #" + metadataSchema.getID());
}
// Create a table row and update it with the values
@@ -71,7 +71,7 @@ public class MetadataFieldServiceImpl implements MetadataFieldService {
metadataFieldDAO.save(context, metadataField);
log.info(LogManager.getHeader(context, "create_metadata_field",
- "metadata_field_id=" + metadataField.getFieldID()));
+ "metadata_field_id=" + metadataField.getID()));
return metadataField;
}
@@ -118,7 +118,7 @@ public class MetadataFieldServiceImpl implements MetadataFieldService {
}
// Ensure the element and qualifier are unique within a given schema.
- if (hasElement(context, metadataField.getFieldID(), metadataField.getMetadataSchema(), metadataField.getElement(), metadataField.getQualifier()))
+ if (hasElement(context, metadataField.getID(), metadataField.getMetadataSchema(), metadataField.getElement(), metadataField.getQualifier()))
{
throw new NonUniqueMetadataException("Please make " + metadataField.getMetadataSchema().getName() + "." + metadataField.getElement() + "."
+ metadataField.getQualifier());
@@ -127,7 +127,7 @@ public class MetadataFieldServiceImpl implements MetadataFieldService {
metadataFieldDAO.save(context, metadataField);
log.info(LogManager.getHeader(context, "update_metadatafieldregistry",
- "metadata_field_id=" + metadataField.getFieldID() + "element=" + metadataField.getElement()
+ "metadata_field_id=" + metadataField.getID() + "element=" + metadataField.getElement()
+ "qualifier=" + metadataField.getQualifier()));
}
@@ -141,7 +141,7 @@ public class MetadataFieldServiceImpl implements MetadataFieldService {
}
log.info(LogManager.getHeader(context, "delete_metadata_field",
- "metadata_field_id=" + metadataField.getFieldID()));
+ "metadata_field_id=" + metadataField.getID()));
metadataValueService.deleteByMetadataField(context, metadataField);
metadataFieldDAO.delete(context, metadataField);
@@ -153,11 +153,12 @@ public class MetadataFieldServiceImpl implements MetadataFieldService {
* database constraint.
*
* @param context dspace context
+ * @param fieldId field id
* @param metadataSchema metadataSchema
- * @param element
- * @param qualifier
+ * @param element element
+ * @param qualifier qualifier
* @return true if unique
- * @throws SQLException
+ * @throws SQLException if database error
*/
protected boolean hasElement(Context context, int fieldId, MetadataSchema metadataSchema, String element, String qualifier) throws SQLException
{
diff --git a/dspace-api/src/main/java/org/dspace/content/MetadataSchema.java b/dspace-api/src/main/java/org/dspace/content/MetadataSchema.java
index 4558cd7013..e877261c15 100644
--- a/dspace-api/src/main/java/org/dspace/content/MetadataSchema.java
+++ b/dspace-api/src/main/java/org/dspace/content/MetadataSchema.java
@@ -8,6 +8,8 @@
package org.dspace.content;
import org.dspace.core.Context;
+import org.dspace.core.ReloadableEntity;
+import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.proxy.HibernateProxyHelper;
import javax.persistence.*;
@@ -26,8 +28,10 @@ import javax.persistence.*;
* @see org.dspace.content.MetadataField
*/
@Entity
+@Cacheable
+@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Table(name="metadataschemaregistry")
-public class MetadataSchema
+public class MetadataSchema implements ReloadableEntity
{
/** Short Name of built-in Dublin Core schema. */
public static final String DC_SCHEMA = "dc";
@@ -36,7 +40,7 @@ public class MetadataSchema
@Column(name="metadata_schema_id")
@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="metadataschemaregistry_seq")
@SequenceGenerator(name="metadataschemaregistry_seq", sequenceName="metadataschemaregistry_seq", allocationSize = 1)
- private int id;
+ private Integer id;
@Column(name = "namespace", unique = true, length = 256)
private String namespace;
@@ -132,7 +136,7 @@ public class MetadataSchema
*
* @return schema record key
*/
- public int getSchemaID()
+ public Integer getID()
{
return id;
}
diff --git a/dspace-api/src/main/java/org/dspace/content/MetadataSchemaServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/MetadataSchemaServiceImpl.java
index c56b2dfeb3..601a90a976 100644
--- a/dspace-api/src/main/java/org/dspace/content/MetadataSchemaServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/MetadataSchemaServiceImpl.java
@@ -73,7 +73,7 @@ public class MetadataSchemaServiceImpl implements MetadataSchemaService {
metadataSchemaDAO.save(context, metadataSchema);
log.info(LogManager.getHeader(context, "create_metadata_schema",
"metadata_schema_id="
- + metadataSchema.getSchemaID()));
+ + metadataSchema.getID()));
return metadataSchema;
}
@@ -92,21 +92,21 @@ public class MetadataSchemaServiceImpl implements MetadataSchemaService {
}
// Ensure the schema name is unique
- if (!uniqueShortName(context, metadataSchema.getSchemaID(), metadataSchema.getName()))
+ if (!uniqueShortName(context, metadataSchema.getID(), metadataSchema.getName()))
{
throw new NonUniqueMetadataException("Please make the name " + metadataSchema.getName()
+ " unique");
}
// Ensure the schema namespace is unique
- if (!uniqueNamespace(context, metadataSchema.getSchemaID(), metadataSchema.getNamespace()))
+ if (!uniqueNamespace(context, metadataSchema.getID(), metadataSchema.getNamespace()))
{
throw new NonUniqueMetadataException("Please make the namespace " + metadataSchema.getNamespace()
+ " unique");
}
metadataSchemaDAO.save(context, metadataSchema);
log.info(LogManager.getHeader(context, "update_metadata_schema",
- "metadata_schema_id=" + metadataSchema.getSchemaID() + "namespace="
+ "metadata_schema_id=" + metadataSchema.getID() + "namespace="
+ metadataSchema.getNamespace() + "name=" + metadataSchema.getName()));
}
@@ -120,7 +120,7 @@ public class MetadataSchemaServiceImpl implements MetadataSchemaService {
}
log.info(LogManager.getHeader(context, "delete_metadata_schema",
- "metadata_schema_id=" + metadataSchema.getSchemaID()));
+ "metadata_schema_id=" + metadataSchema.getID()));
metadataSchemaDAO.delete(context, metadataSchema);
}
@@ -151,9 +151,10 @@ public class MetadataSchemaServiceImpl implements MetadataSchemaService {
* number of times in the current schema.
*
* @param context DSpace context
+ * @param metadataSchemaId metadata schema id
* @param namespace namespace URI to match
* @return true of false
- * @throws SQLException
+ * @throws SQLException if database error
*/
protected boolean uniqueNamespace(Context context, int metadataSchemaId, String namespace)
throws SQLException
@@ -165,9 +166,10 @@ public class MetadataSchemaServiceImpl implements MetadataSchemaService {
* Return true if and only if the passed name is unique.
*
* @param context DSpace context
+ * @param metadataSchemaId metadata schema id
* @param name short name of schema
* @return true of false
- * @throws SQLException
+ * @throws SQLException if database error
*/
protected boolean uniqueShortName(Context context, int metadataSchemaId, String name)
throws SQLException
diff --git a/dspace-api/src/main/java/org/dspace/content/MetadataValue.java b/dspace-api/src/main/java/org/dspace/content/MetadataValue.java
index 97214bd5fb..8a0344e01b 100644
--- a/dspace-api/src/main/java/org/dspace/content/MetadataValue.java
+++ b/dspace-api/src/main/java/org/dspace/content/MetadataValue.java
@@ -8,6 +8,7 @@
package org.dspace.content;
import org.dspace.core.Context;
+import org.dspace.core.ReloadableEntity;
import org.hibernate.annotations.Type;
import org.hibernate.proxy.HibernateProxyHelper;
@@ -26,17 +27,17 @@ import javax.persistence.*;
*/
@Entity
@Table(name="metadatavalue")
-public class MetadataValue
+public class MetadataValue implements ReloadableEntity
{
/** The reference to the metadata field */
@Id
@Column(name="metadata_value_id")
@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="metadatavalue_seq")
@SequenceGenerator(name="metadatavalue_seq", sequenceName="metadatavalue_seq", allocationSize = 1)
- private int valueId;
+ private Integer id;
/** The primary key for the metadata value */
- @ManyToOne
+ @ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "metadata_field_id")
private MetadataField metadataField = null;
@@ -62,7 +63,7 @@ public class MetadataValue
@Column(name = "confidence")
private int confidence = -1;
- @ManyToOne(fetch = FetchType.EAGER, cascade={CascadeType.PERSIST})
+ @ManyToOne(fetch = FetchType.LAZY, cascade={CascadeType.PERSIST})
@JoinColumn(name="dspace_object_id")
protected DSpaceObject dSpaceObject;
@@ -73,7 +74,7 @@ public class MetadataValue
*/
protected MetadataValue()
{
-
+ id = 0;
}
/**
@@ -81,9 +82,9 @@ public class MetadataValue
*
* @return metadata value ID
*/
- public int getValueId()
+ public Integer getID()
{
- return valueId;
+ return id;
}
/**
@@ -238,11 +239,11 @@ public class MetadataValue
return false;
}
final MetadataValue other = (MetadataValue) obj;
- if (this.valueId != other.valueId)
+ if (this.id != other.id)
{
return false;
}
- if (this.getValueId() != other.getValueId())
+ if (this.getID() != other.getID())
{
return false;
}
@@ -257,8 +258,8 @@ public class MetadataValue
public int hashCode()
{
int hash = 7;
- hash = 47 * hash + this.valueId;
- hash = 47 * hash + this.getValueId();
+ hash = 47 * hash + this.id;
+ hash = 47 * hash + this.getID();
hash = 47 * hash + this.getDSpaceObject().getID().hashCode();
return hash;
}
diff --git a/dspace-api/src/main/java/org/dspace/content/MetadataValueServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/MetadataValueServiceImpl.java
index 297e0b9cce..53ba317298 100644
--- a/dspace-api/src/main/java/org/dspace/content/MetadataValueServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/MetadataValueServiceImpl.java
@@ -72,7 +72,7 @@ public class MetadataValueServiceImpl implements MetadataValueService {
public void update(Context context, MetadataValue metadataValue) throws SQLException {
metadataValueDAO.save(context, metadataValue);
log.info(LogManager.getHeader(context, "update_metadatavalue",
- "metadata_value_id=" + metadataValue.getValueId()));
+ "metadata_value_id=" + metadataValue.getID()));
}
@@ -89,7 +89,7 @@ public class MetadataValueServiceImpl implements MetadataValueService {
@Override
public void delete(Context context, MetadataValue metadataValue) throws SQLException {
log.info(LogManager.getHeader(context, "delete_metadata_value",
- " metadata_value_id=" + metadataValue.getValueId()));
+ " metadata_value_id=" + metadataValue.getID()));
metadataValueDAO.delete(context, metadataValue);
}
diff --git a/dspace-api/src/main/java/org/dspace/content/WorkspaceItem.java b/dspace-api/src/main/java/org/dspace/content/WorkspaceItem.java
index a902bb5096..367d99e9ca 100644
--- a/dspace-api/src/main/java/org/dspace/content/WorkspaceItem.java
+++ b/dspace-api/src/main/java/org/dspace/content/WorkspaceItem.java
@@ -7,19 +7,19 @@
*/
package org.dspace.content;
-import java.io.Serializable;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.dspace.core.Context;
+import org.dspace.core.ReloadableEntity;
import org.dspace.eperson.EPerson;
import org.dspace.eperson.Group;
import org.dspace.workflow.WorkflowItem;
import org.hibernate.proxy.HibernateProxyHelper;
import javax.persistence.*;
+import java.io.Serializable;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
/**
* Class representing an item in the process of being submitted by a user
@@ -29,14 +29,14 @@ import javax.persistence.*;
*/
@Entity
@Table(name = "workspaceitem")
-public class WorkspaceItem implements InProgressSubmission, Serializable
+public class WorkspaceItem implements InProgressSubmission, Serializable, ReloadableEntity
{
@Id
@Column(name = "workspace_item_id", unique = true, nullable = false)
@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="workspaceitem_seq")
@SequenceGenerator(name="workspaceitem_seq", sequenceName="workspaceitem_seq", allocationSize = 1)
- private int workspaceItemId;
+ private Integer workspaceItemId;
/** The item this workspace object pertains to */
@OneToOne(fetch = FetchType.LAZY)
@@ -90,7 +90,7 @@ public class WorkspaceItem implements InProgressSubmission, Serializable
* @return the internal identifier
*/
@Override
- public int getID()
+ public Integer getID()
{
return workspaceItemId;
}
diff --git a/dspace-api/src/main/java/org/dspace/content/authority/ChoiceAuthorityServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/authority/ChoiceAuthorityServiceImpl.java
index 6f98bc9349..0484c0a768 100644
--- a/dspace-api/src/main/java/org/dspace/content/authority/ChoiceAuthorityServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/authority/ChoiceAuthorityServiceImpl.java
@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
*
* Configuration keys, per metadata field (e.g. "dc.contributer.author")
*
+ * {@code
* # names the ChoiceAuthority plugin called for this field
* choices.plugin. = name-of-plugin
*
@@ -36,7 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
*
* # is value "closed" to the set of these choices or are non-authority values permitted?
* choices.closed. = true | false
- *
+ * }
* @author Larry Stone
* @see ChoiceAuthority
*/
@@ -62,7 +63,7 @@ public final class ChoiceAuthorityServiceImpl implements ChoiceAuthorityService
private final String CHOICES_PRESENTATION_PREFIX = "choices.presentation.";
private final String CHOICES_CLOSED_PREFIX = "choices.closed.";
- private ChoiceAuthorityServiceImpl() {
+ protected ChoiceAuthorityServiceImpl() {
}
// translate tail of configuration key (supposed to be schema.element.qual)
diff --git a/dspace-api/src/main/java/org/dspace/content/authority/Choices.java b/dspace-api/src/main/java/org/dspace/content/authority/Choices.java
index fba7012f4f..5780f6c1b1 100644
--- a/dspace-api/src/main/java/org/dspace/content/authority/Choices.java
+++ b/dspace-api/src/main/java/org/dspace/content/authority/Choices.java
@@ -97,6 +97,11 @@ public class Choices
/**
* Constructor for general purpose
+ * @param values values array
+ * @param start start number
+ * @param total total results
+ * @param confidence confidence level
+ * @param more whether more values
*/
public Choices(Choice values[], int start, int total, int confidence, boolean more)
{
@@ -110,6 +115,12 @@ public class Choices
/**
* Constructor for general purpose
+ * @param values values array
+ * @param start start number
+ * @param total total results
+ * @param confidence confidence level
+ * @param more whether more values
+ * @param defaultSelected default selected value
*/
public Choices(Choice values[], int start, int total, int confidence, boolean more, int defaultSelected)
{
@@ -124,6 +135,7 @@ public class Choices
/**
* Constructor for error results
+ * @param confidence confidence level
*/
public Choices(int confidence)
{
@@ -133,6 +145,7 @@ public class Choices
/**
* Constructor for simple empty or error results
+ * @param isError whether error
*/
public Choices(boolean isError)
{
diff --git a/dspace-api/src/main/java/org/dspace/content/authority/DCInputAuthority.java b/dspace-api/src/main/java/org/dspace/content/authority/DCInputAuthority.java
index 0efeed2fc4..42da4664db 100644
--- a/dspace-api/src/main/java/org/dspace/content/authority/DCInputAuthority.java
+++ b/dspace-api/src/main/java/org/dspace/content/authority/DCInputAuthority.java
@@ -26,13 +26,15 @@ import org.dspace.core.SelfNamedPlugin;
*
* Configuration:
* This MUST be configured aas a self-named plugin, e.g.:
+ * {@code
* plugin.selfnamed.org.dspace.content.authority.ChoiceAuthority = \
* org.dspace.content.authority.DCInputAuthority
+ * }
*
- * It AUTOMATICALLY configures a plugin instance for each
- * element (within ) of the input-forms.xml. The name
+ * It AUTOMATICALLY configures a plugin instance for each {@code }
+ * element (within {@code }) of the input-forms.xml. The name
* of the instance is the "value-pairs-name" attribute, e.g.
- * the element:
+ * the element: {@code }
* defines a plugin instance "common_types".
*
* IMPORTANT NOTE: Since these value-pairs do NOT include authority keys,
diff --git a/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java b/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java
index 36b839cad4..91e0a53fdd 100644
--- a/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java
+++ b/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java
@@ -31,24 +31,27 @@ import org.dspace.services.ConfigurationService;
/**
* ChoiceAuthority source that reads the JSPUI-style hierarchical vocabularies
- * from ${dspace.dir}/config/controlled-vocabularies/*.xml and turns them into
+ * from {@code ${dspace.dir}/config/controlled-vocabularies/*.xml} and turns them into
* autocompleting authorities.
*
* Configuration:
* This MUST be configured as a self-named plugin, e.g.:
+ * {@code
* plugin.selfnamed.org.dspace.content.authority.ChoiceAuthority = \
* org.dspace.content.authority.DSpaceControlledVocabulary
+ * }
*
* It AUTOMATICALLY configures a plugin instance for each XML file in the
* controlled vocabularies directory. The name of the plugin is the basename
- * of the file; e.g., "${dspace.dir}/config/controlled-vocabularies/nsi.xml"
+ * of the file; e.g., {@code ${dspace.dir}/config/controlled-vocabularies/nsi.xml}
* would generate a plugin called "nsi".
*
* Each configured plugin comes with three configuration options:
+ * {@code
* vocabulary.plugin._plugin_.hierarchy.store = # Store entire hierarchy along with selected value. Default: TRUE
* vocabulary.plugin._plugin_.hierarchy.suggest = # Display entire hierarchy in the suggestion list. Default: TRUE
* vocabulary.plugin._plugin_.delimiter = "" # Delimiter to use when building hierarchy strings. Default: "::"
- *
+ * }
*
* @author Michael B. Klein
*
diff --git a/dspace-api/src/main/java/org/dspace/content/authority/MetadataAuthorityServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/authority/MetadataAuthorityServiceImpl.java
index 400b9e5ab7..21ec172d2d 100644
--- a/dspace-api/src/main/java/org/dspace/content/authority/MetadataAuthorityServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/authority/MetadataAuthorityServiceImpl.java
@@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
*
* Configuration keys, per metadata field (e.g. "dc.contributer.author")
*
+ * {@code
* # is field authority controlled (i.e. store authority, confidence values)?
* authority.controlled. = true
*
@@ -44,7 +45,7 @@ import org.springframework.beans.factory.annotation.Autowired;
* authority.minconfidence.SCHEMA.ELEMENT.QUALIFIER = SYMBOL
* e.g.
* authority.minconfidence.dc.contributor.author = accepted
- *
+ * }
* NOTE: There is *expected* to be a "choices" (see ChoiceAuthorityManager)
* configuration for each authority-controlled field.
*
@@ -215,6 +216,7 @@ public class MetadataAuthorityServiceImpl implements MetadataAuthorityService
/**
* Give the minimal level of confidence required to consider valid an authority value
* for the given metadata.
+ * @param metadataField metadata field
* @return the minimal valid level of confidence for the given metadata
*/
@Override
diff --git a/dspace-api/src/main/java/org/dspace/content/authority/service/ChoiceAuthorityService.java b/dspace-api/src/main/java/org/dspace/content/authority/service/ChoiceAuthorityService.java
index 418faa8438..0b2381b944 100644
--- a/dspace-api/src/main/java/org/dspace/content/authority/service/ChoiceAuthorityService.java
+++ b/dspace-api/src/main/java/org/dspace/content/authority/service/ChoiceAuthorityService.java
@@ -19,7 +19,7 @@ import java.util.List;
* about the choice aspect of authority control for a metadata field.
*
* Configuration keys, per metadata field (e.g. "dc.contributer.author")
- *
+ * {@code
* # names the ChoiceAuthority plugin called for this field
* choices.plugin. = name-of-plugin
*
@@ -29,7 +29,7 @@ import java.util.List;
*
* # is value "closed" to the set of these choices or are non-authority values permitted?
* choices.closed. = true | false
- *
+ * }
* @author Larry Stone
* @see ChoiceAuthority
*/
@@ -40,7 +40,7 @@ public interface ChoiceAuthorityService
* Wrapper that calls getMatches method of the plugin corresponding to
* the metadata field defined by schema,element,qualifier.
*
- * @see org.dspace.content.authority.ChoiceAuthority#getMatches(String, String, int, int, int, String)
+ * @see org.dspace.content.authority.ChoiceAuthority#getMatches(java.lang.String, java.lang.String, org.dspace.content.Collection, int, int, java.lang.String)
* @param schema schema of metadata field
* @param element element of metadata field
* @param qualifier qualifier of metadata field
@@ -57,7 +57,7 @@ public interface ChoiceAuthorityService
* Wrapper calls getMatches method of the plugin corresponding to
* the metadata field defined by single field key.
*
- * @see org.dspace.content.authority.ChoiceAuthority#getMatches(String, String, int, int, int, String)
+ * @see org.dspace.content.authority.ChoiceAuthority#getMatches(java.lang.String, java.lang.String, org.dspace.content.Collection, int, int, java.lang.String)
* @param fieldKey single string identifying metadata field
* @param query user's value to match
* @param collection database ID of Collection for context (owner of Item)
@@ -75,7 +75,7 @@ public interface ChoiceAuthorityService
* Wrapper that calls getBestMatch method of the plugin corresponding to
* the metadata field defined by single field key.
*
- * @see org.dspace.content.authority.ChoiceAuthority#getBestMatch(String, String, int, String)
+ * @see org.dspace.content.authority.ChoiceAuthority#getBestMatch(java.lang.String, java.lang.String, org.dspace.content.Collection, java.lang.String)
* @param fieldKey single string identifying metadata field
* @param query user's value to match
* @param collection database ID of Collection for context (owner of Item)
@@ -88,18 +88,26 @@ public interface ChoiceAuthorityService
/**
* Wrapper that calls getLabel method of the plugin corresponding to
* the metadata field defined by schema,element,qualifier.
+ * @param metadataValue metadata value
+ * @param locale explicit localization key if available
+ * @return label
*/
public String getLabel(MetadataValue metadataValue, String locale);
/**
* Wrapper that calls getLabel method of the plugin corresponding to
* the metadata field defined by single field key.
+ * @param fieldKey single string identifying metadata field
+ * @param locale explicit localization key if available
+ * @param authKey authority key
+ * @return label
*/
public String getLabel(String fieldKey, String authKey, String locale);
/**
* Predicate, is there a Choices configuration of any kind for the
* given metadata field?
+ * @param fieldKey single string identifying metadata field
* @return true if choices are configured for this field.
*/
public boolean isChoicesConfigured(String fieldKey);
@@ -108,6 +116,7 @@ public interface ChoiceAuthorityService
* Get the presentation keyword (should be "lookup", "select" or "suggest", but this
* is an informal convention so it can be easily extended) for this field.
*
+ * @param fieldKey field key
* @return configured presentation type for this field, or null if none found
*/
public String getPresentation(String fieldKey);
@@ -115,12 +124,15 @@ public interface ChoiceAuthorityService
/**
* Get the configured "closed" value for this field.
*
+ * @param fieldKey single string identifying metadata field
* @return true if choices are closed for this field.
*/
public boolean isClosed(String fieldKey);
/**
* Wrapper to call plugin's getVariants().
+ * @param metadataValue metadata value
+ * @return List of variants
*/
public List getVariants(MetadataValue metadataValue);
}
\ No newline at end of file
diff --git a/dspace-api/src/main/java/org/dspace/content/authority/service/MetadataAuthorityService.java b/dspace-api/src/main/java/org/dspace/content/authority/service/MetadataAuthorityService.java
index bc485bc49f..66436be6de 100644
--- a/dspace-api/src/main/java/org/dspace/content/authority/service/MetadataAuthorityService.java
+++ b/dspace-api/src/main/java/org/dspace/content/authority/service/MetadataAuthorityService.java
@@ -8,8 +8,6 @@
package org.dspace.content.authority.service;
import org.dspace.content.MetadataField;
-import org.dspace.content.authority.ChoiceAuthorityServiceImpl;
-import org.dspace.content.authority.Choices;
import java.util.List;
@@ -19,40 +17,56 @@ import java.util.List;
* Configuration keys, per metadata field (e.g. "dc.contributer.author")
*
* # is field authority controlled (i.e. store authority, confidence values)?
- * authority.controlled. = true
+ * {@code authority.controlled. = true}
*
* # is field required to have an authority value, or may it be empty?
* # default is false.
- * authority.required. = true | false
+ * {@code authority.required. = true | false}
*
* # default value of minimum confidence level for ALL fields - must be
* # symbolic confidence level, see org.dspace.content.authority.Choices
- * authority.minconfidence = uncertain
+ * {@code authority.minconfidence = uncertain}
*
* # minimum confidence level for this field
- * authority.minconfidence.SCHEMA.ELEMENT.QUALIFIER = SYMBOL
+ * {@code authority.minconfidence.SCHEMA.ELEMENT.QUALIFIER = SYMBOL}
* e.g.
- * authority.minconfidence.dc.contributor.author = accepted
+ * {@code authority.minconfidence.dc.contributor.author = accepted}
*
* NOTE: There is *expected* to be a "choices" (see ChoiceAuthorityManager)
* configuration for each authority-controlled field.
*
- * @see ChoiceAuthorityServiceImpl
- * @see Choices
+ * @see org.dspace.content.authority.ChoiceAuthorityServiceImpl
+ * @see org.dspace.content.authority.Choices
* @author Larry Stone
*/
public interface MetadataAuthorityService {
- /** Predicate - is field authority-controlled? */
+ /**
+ * Predicate - is field authority-controlled?
+ * @param metadataField metadata field
+ * @return true/false
+ */
public boolean isAuthorityControlled(MetadataField metadataField);
- /** Predicate - is field authority-controlled? */
+ /**
+ * Predicate - is field authority-controlled?
+ * @param fieldKey field key
+ * @return true/false
+ */
public boolean isAuthorityControlled(String fieldKey);
- /** Predicate - is authority value required for field? */
+ /**
+ * Predicate - is authority value required for field?
+ * @param metadataField metadata field
+ * @return true/false
+ */
public boolean isAuthorityRequired(MetadataField metadataField);
- /** Predicate - is authority value required for field? */
+ /**
+ * Predicate - is authority value required for field?
+ * @param fieldKey field key
+ * @return true/false
+ */
public boolean isAuthorityRequired(String fieldKey);
@@ -60,6 +74,8 @@ public interface MetadataAuthorityService {
* Construct a single key from the tuple of schema/element/qualifier
* that describes a metadata field. Punt to the function we use for
* submission UI input forms, for now.
+ * @param metadataField metadata field
+ * @return field key
*/
public String makeFieldKey(MetadataField metadataField);
@@ -67,12 +83,17 @@ public interface MetadataAuthorityService {
* Construct a single key from the tuple of schema/element/qualifier
* that describes a metadata field. Punt to the function we use for
* submission UI input forms, for now.
+ * @param schema schema
+ * @param element element
+ * @param qualifier qualifier
+ * @return field key
*/
public String makeFieldKey(String schema, String element, String qualifier);
/**
* Give the minimal level of confidence required to consider valid an authority value
* for the given metadata.
+ * @param metadataField metadata field
* @return the minimal valid level of confidence for the given metadata
*/
public int getMinConfidence(MetadataField metadataField);
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/AIPDIMCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/AIPDIMCrosswalk.java
index b551527ca5..a5d29247d7 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/AIPDIMCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/AIPDIMCrosswalk.java
@@ -115,6 +115,7 @@ public class AIPDIMCrosswalk
* When there are no results, an
* empty list is returned, but never
null
.
*
+ * @param context context
* @param dso the DSpace Object whose metadata to export.
* @return results of crosswalk as list of XML elements.
*
@@ -139,6 +140,7 @@ public class AIPDIMCrosswalk
* This is typically the root element of a document.
*
*
+ * @param context context
* @param dso the DSpace Object whose metadata to export.
* @return root Element of the target metadata, never null
*
@@ -160,6 +162,11 @@ public class AIPDIMCrosswalk
* Ingest a whole document. Build Document object around root element,
* and feed that to the transformation, since it may get handled
* differently than a List of metadata elements.
+ * @param createMissingMetadataFields whether to create missing fields
+ * @throws CrosswalkException if crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public void ingest(Context context, DSpaceObject dso, Element root, boolean createMissingMetadataFields)
@@ -171,6 +178,12 @@ public class AIPDIMCrosswalk
/**
* Fields correspond directly to Item.addMetadata() calls so
* they are simply executed.
+ * @param createMissingMetadataFields whether to create missing fields
+ * @param dimList List of elements
+ * @throws CrosswalkException if crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public void ingest(Context context, DSpaceObject dso, List dimList, boolean createMissingMetadataFields)
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/AIPTechMDCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/AIPTechMDCrosswalk.java
index 3a56fbf9e9..1856615edd 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/AIPTechMDCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/AIPTechMDCrosswalk.java
@@ -157,6 +157,7 @@ public class AIPTechMDCrosswalk implements IngestionCrosswalk, DisseminationCros
* When there are no results, an
* empty list is returned, but never null
.
*
+ * @param context context
* @param dso the DSpace Object whose metadata to export.
* @return results of crosswalk as list of XML elements.
*
@@ -181,6 +182,7 @@ public class AIPTechMDCrosswalk implements IngestionCrosswalk, DisseminationCros
* This is typically the root element of a document.
*
*
+ * @param context context
* @param dso the DSpace Object whose metadata to export.
* @return root Element of the target metadata, never null
*
@@ -323,6 +325,11 @@ public class AIPTechMDCrosswalk implements IngestionCrosswalk, DisseminationCros
* Ingest a whole document. Build Document object around root element,
* and feed that to the transformation, since it may get handled
* differently than a List of metadata elements.
+ * @param createMissingMetadataFields whether to create missing fields
+ * @throws CrosswalkException if crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public void ingest(Context context, DSpaceObject dso, Element root, boolean createMissingMetadataFields)
@@ -336,6 +343,12 @@ public class AIPTechMDCrosswalk implements IngestionCrosswalk, DisseminationCros
* Translation produces a list of DIM "field" elements;
* these correspond directly to Item.addMetadata() calls so
* they are simply executed.
+ * @param createMissingMetadataFields whether to create missing fields
+ * @param dimList List of elements
+ * @throws CrosswalkException if crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public void ingest(Context context, DSpaceObject dso, List dimList, boolean createMissingMetadataFields)
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/CrosswalkMetadataValidator.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/CrosswalkMetadataValidator.java
new file mode 100644
index 0000000000..0c704b9580
--- /dev/null
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/CrosswalkMetadataValidator.java
@@ -0,0 +1,115 @@
+/**
+ * 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/
+ */
+package org.dspace.content.crosswalk;
+
+import org.apache.commons.lang3.tuple.ImmutableTriple;
+import org.apache.commons.lang3.tuple.Triple;
+import org.dspace.authorize.AuthorizeException;
+import org.dspace.content.MetadataField;
+import org.dspace.content.MetadataSchema;
+import org.dspace.content.NonUniqueMetadataException;
+import org.dspace.content.factory.ContentServiceFactory;
+import org.dspace.content.service.MetadataFieldService;
+import org.dspace.content.service.MetadataSchemaService;
+import org.dspace.core.ConfigurationManager;
+import org.dspace.core.Context;
+
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+public class CrosswalkMetadataValidator {
+
+ protected MetadataSchemaService metadataSchemaService;
+ protected MetadataFieldService metadataFieldService;
+
+ private String schemaChoice;
+ private String fieldChoice;
+
+ private Map, MetadataField> validatedMetadataFields;
+
+ public CrosswalkMetadataValidator() {
+ metadataSchemaService = ContentServiceFactory.getInstance().getMetadataSchemaService();
+ metadataFieldService = ContentServiceFactory.getInstance().getMetadataFieldService();
+
+ validatedMetadataFields = new HashMap<>();
+
+ // The two options, with three possibilities each: add, ignore, fail
+ schemaChoice = ConfigurationManager.getProperty("oai", "harvester.unknownSchema");
+ if (schemaChoice == null)
+ {
+ schemaChoice = "fail";
+ }
+
+ fieldChoice = ConfigurationManager.getProperty("oai", "harvester.unknownField");
+ if (fieldChoice == null)
+ {
+ fieldChoice = "fail";
+ }
+ }
+
+ /**
+ * Scans metadata for elements not defined in this DSpace instance. It then takes action based
+ * on a configurable parameter (fail, ignore, add).
+ */
+ public MetadataField checkMetadata(Context context, String schema, String element, String qualifier, boolean forceCreate) throws SQLException, AuthorizeException, CrosswalkException {
+ if(!validatedBefore(schema, element, qualifier)) {
+ // Verify that the schema exists
+ MetadataSchema mdSchema = metadataSchemaService.find(context, schema);
+ MetadataField mdField = null;
+
+ if (mdSchema == null) {
+ // add a new schema, giving it a namespace of "unknown". Possibly a very bad idea.
+ if (forceCreate && schemaChoice.equals("add")) {
+ try {
+ mdSchema = metadataSchemaService.create(context, schema, String.valueOf(new Date().getTime()));
+ mdSchema.setNamespace("unknown" + mdSchema.getID());
+ metadataSchemaService.update(context, mdSchema);
+ } catch (NonUniqueMetadataException e) {
+ // This case should not be possible
+ e.printStackTrace();
+ }
+ }
+ // ignore the offending schema, quietly dropping all of its metadata elements before they clog our gears
+ else if (!schemaChoice.equals("ignore")) {
+ throw new CrosswalkException("The '" + schema + "' schema has not been defined in this DSpace instance. ");
+ }
+ }
+
+ if (mdSchema != null) {
+ // Verify that the element exists; this part is reachable only if the metadata schema is valid
+ mdField = metadataFieldService.findByElement(context, mdSchema, element, qualifier);
+ if (mdField == null) {
+ if (forceCreate && fieldChoice.equals("add")) {
+ try {
+ metadataFieldService.create(context, mdSchema, element, qualifier, null);
+ } catch (NonUniqueMetadataException e) {
+ // This case should also not be possible
+ e.printStackTrace();
+ }
+ } else if (!fieldChoice.equals("ignore")) {
+ throw new CrosswalkException("The '" + element + "." + qualifier + "' element has not been defined in this DSpace instance. ");
+ }
+ }
+ }
+
+ validatedMetadataFields.put(createKey(schema, element, qualifier), mdField);
+ }
+
+ return validatedMetadataFields.get(createKey(schema, element, qualifier));
+ }
+
+ private boolean validatedBefore(String schema, String element, String qualifier) {
+ return validatedMetadataFields.containsKey(createKey(schema, element, qualifier));
+ }
+
+ private ImmutableTriple createKey(final String schema, final String element, final String qualifier) {
+ return new ImmutableTriple(schema, element, qualifier);
+ }
+}
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/CrosswalkUtils.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/CrosswalkUtils.java
deleted file mode 100644
index 9c8725018c..0000000000
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/CrosswalkUtils.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * 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/
- */
-package org.dspace.content.crosswalk;
-
-import org.dspace.authorize.AuthorizeException;
-import org.dspace.content.MetadataField;
-import org.dspace.content.MetadataSchema;
-import org.dspace.content.NonUniqueMetadataException;
-import org.dspace.content.factory.ContentServiceFactory;
-import org.dspace.content.service.MetadataFieldService;
-import org.dspace.content.service.MetadataSchemaService;
-import org.dspace.core.ConfigurationManager;
-import org.dspace.core.Context;
-
-import java.sql.SQLException;
-import java.util.Date;
-
-public class CrosswalkUtils {
-
- protected static final MetadataSchemaService metadataSchemaService = ContentServiceFactory.getInstance().getMetadataSchemaService();
- protected static final MetadataFieldService metadataFieldService = ContentServiceFactory.getInstance().getMetadataFieldService();
-
- /**
- * Scans metadata for elements not defined in this DSpace instance. It then takes action based
- * on a configurable parameter (fail, ignore, add).
- */
- public static void checkMetadata(Context context, String schema, String element, String qualifier, boolean forceCreate) throws SQLException, AuthorizeException, CrosswalkException {
- // The two options, with three possibilities each: add, ignore, fail
- String schemaChoice = ConfigurationManager.getProperty("oai", "harvester.unknownSchema");
- if (schemaChoice == null)
- {
- schemaChoice = "fail";
- }
-
- String fieldChoice = ConfigurationManager.getProperty("oai", "harvester.unknownField");
- if (fieldChoice == null)
- {
- fieldChoice = "fail";
- }
-
- // Verify that the schema exists
- MetadataSchema mdSchema = metadataSchemaService.find(context, schema);
- if (mdSchema == null) {
- // add a new schema, giving it a namespace of "unknown". Possibly a very bad idea.
- if (forceCreate && schemaChoice.equals("add"))
- {
- try {
- mdSchema = metadataSchemaService.create(context, schema, String.valueOf(new Date().getTime()));
- mdSchema.setNamespace("unknown"+mdSchema.getSchemaID());
- metadataSchemaService.update(context, mdSchema);
- } catch (NonUniqueMetadataException e) {
- // This case should not be possible
- e.printStackTrace();
- }
- }
- // ignore the offending schema, quietly dropping all of its metadata elements before they clog our gears
- else if (!schemaChoice.equals("ignore")) {
- throw new CrosswalkException("The '" + schema + "' schema has not been defined in this DSpace instance. ");
- }
- }
-
- if (mdSchema != null) {
- // Verify that the element exists; this part is reachable only if the metadata schema is valid
- MetadataField mdField = metadataFieldService.findByElement(context, mdSchema, element, qualifier);
- if (mdField == null) {
- if (forceCreate && fieldChoice.equals("add")) {
- try {
- metadataFieldService.create(context, mdSchema, element, qualifier, null);
- } catch (NonUniqueMetadataException e) {
- // This case should also not be possible
- e.printStackTrace();
- }
- }
- else if (!fieldChoice.equals("ignore")) {
- throw new CrosswalkException("The '" + element + "." + qualifier + "' element has not been defined in this DSpace instance. ");
- }
- }
- }
- }
-}
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/DIMIngestionCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/DIMIngestionCrosswalk.java
index 911b0f58db..b108d90805 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/DIMIngestionCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/DIMIngestionCrosswalk.java
@@ -7,13 +7,10 @@
*/
package org.dspace.content.crosswalk;
-import java.io.IOException;
-import java.sql.SQLException;
-import java.util.List;
-
import org.dspace.authorize.AuthorizeException;
import org.dspace.content.DSpaceObject;
import org.dspace.content.Item;
+import org.dspace.content.MetadataField;
import org.dspace.content.factory.ContentServiceFactory;
import org.dspace.content.service.ItemService;
import org.dspace.core.Constants;
@@ -21,6 +18,10 @@ import org.dspace.core.Context;
import org.jdom.Element;
import org.jdom.Namespace;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.List;
+
/**
* DIM ingestion crosswalk
*
@@ -33,7 +34,7 @@ public class DIMIngestionCrosswalk implements IngestionCrosswalk
{
private static final Namespace DIM_NS = Namespace.getNamespace("http://www.dspace.org/xmlns/dspace/dim");
protected ItemService itemService = ContentServiceFactory.getInstance().getItemService();
-
+ private CrosswalkMetadataValidator metadataValidator = new CrosswalkMetadataValidator();
@Override
public void ingest(Context context, DSpaceObject dso, List metadata, boolean createMissingMetadataFields) throws CrosswalkException, IOException, SQLException, AuthorizeException {
@@ -69,8 +70,8 @@ public class DIMIngestionCrosswalk implements IngestionCrosswalk
String schema = field.getAttributeValue("mdschema");
String element = field.getAttributeValue("element");
String qualifier = field.getAttributeValue("qualifier");
- CrosswalkUtils.checkMetadata(context, schema, element, qualifier, createMissingMetadataFields);
- itemService.addMetadata(context, item, schema, element, qualifier,
+ MetadataField metadataField = metadataValidator.checkMetadata(context, schema, element, qualifier, createMissingMetadataFields);
+ itemService.addMetadata(context, item, metadataField,
field.getAttributeValue("lang"), field.getText());
}
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/DisseminationCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/DisseminationCrosswalk.java
index e272f355a4..bcc73bc80c 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/DisseminationCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/DisseminationCrosswalk.java
@@ -91,6 +91,7 @@ public interface DisseminationCrosswalk
* When there are no results, an
* empty list is returned, but never null
.
*
+ * @param context context
* @param dso the DSpace Object whose metadata to export.
* @return results of crosswalk as list of XML elements.
*
@@ -110,6 +111,7 @@ public interface DisseminationCrosswalk
* This is typically the root element of a document.
*
*
+ * @param context context
* @param dso the DSpace Object whose metadata to export.
* @return root Element of the target metadata, never null
*
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/IngestionCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/IngestionCrosswalk.java
index ec6a057c21..3151c2ec67 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/IngestionCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/IngestionCrosswalk.java
@@ -63,6 +63,7 @@ public interface IngestionCrosswalk
* @param context DSpace context.
* @param dso DSpace Object (Item, Bitstream, etc) to which new metadata gets attached.
* @param metadata List of XML Elements of metadata
+ * @param createMissingMetadataFields whether to create missing fields
*
* @throws CrosswalkInternalException (CrosswalkException
) failure of the crosswalk itself.
* @throws CrosswalkObjectNotSupported (CrosswalkException
) Cannot crosswalk into this kind of DSpace object.
@@ -85,6 +86,7 @@ public interface IngestionCrosswalk
* @param context DSpace context.
* @param dso DSpace Object (usually an Item) to which new metadata gets attached.
* @param root root Element of metadata document.
+ * @param createMissingMetadataFields whether to create missing fields
*
* @throws CrosswalkInternalException (CrosswalkException
) failure of the crosswalk itself.
* @throws CrosswalkObjectNotSupported (CrosswalkException
) Cannot crosswalk into this kind of DSpace object.
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/METSRightsCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/METSRightsCrosswalk.java
index 2a37020f4d..a2bf63ddcd 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/METSRightsCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/METSRightsCrosswalk.java
@@ -40,7 +40,7 @@ import org.jdom.Element;
import org.jdom.Namespace;
/**
- * METSRights Ingestion & Dissemination Crosswalk
+ * METSRights Ingestion and Dissemination Crosswalk
*
* Translate between DSpace internal policies (i.e. permissions) and the
* METSRights metadata schema
@@ -130,12 +130,13 @@ public class METSRightsCrosswalk
* policies (permissions) for the provided object, and translates them into
* METSRights PermissionTypes.
*
+ * @param context context
* @param dso DSpace Object
- * @return XML Element corresponding to the new translation
- * @throws CrosswalkException
- * @throws IOException
- * @throws SQLException
- * @throws AuthorizeException
+ * @return XML Element corresponding to the new {@code } translation
+ * @throws CrosswalkException if crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public Element disseminateElement(Context context, DSpaceObject dso)
@@ -404,10 +405,11 @@ public class METSRightsCrosswalk
* @param context
* @param dso
* @param root
- * @throws CrosswalkException
- * @throws IOException
- * @throws SQLException
- * @throws AuthorizeException
+ * @param createMissingMetadataFields
+ * @throws CrosswalkException if crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public void ingest(Context context, DSpaceObject dso, Element root, boolean createMissingMetadataFields)
@@ -432,12 +434,14 @@ public class METSRightsCrosswalk
* conjunction with another Crosswalk which can create/restore missing
* Groups or EPeople (e.g. RoleCrosswalk).
*
- * @param context
- * @param dso
- * @throws CrosswalkException
- * @throws IOException
- * @throws SQLException
- * @throws AuthorizeException
+ * @param context context
+ * @param dso Dspace object
+ * @param ml list of elements
+ * @param createMissingMetadataFields whether to create missing fields
+ * @throws CrosswalkException if crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
* @see RoleCrosswalk
*/
@Override
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/MODSDisseminationCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/MODSDisseminationCrosswalk.java
index 8ec6ddf628..acfb3f6e29 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/MODSDisseminationCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/MODSDisseminationCrosswalk.java
@@ -310,6 +310,11 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
/**
* Returns object's metadata in MODS format, as List of XML structure nodes.
+ * @param context context
+ * @throws org.dspace.content.crosswalk.CrosswalkException
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public List disseminateList(Context context, DSpaceObject dso)
@@ -321,6 +326,11 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
/**
* Disseminate an Item, Collection, or Community to MODS.
+ * @param context context
+ * @throws CrosswalkException if crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public Element disseminateElement(Context context, DSpaceObject dso)
@@ -439,6 +449,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
*
* @param site
* The site to derive metadata from
+ * @return list of metadata
*/
protected List site2Metadata(Site site)
{
@@ -473,6 +484,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
*
* @param community
* The community to derive metadata from
+ * @return list of metadata
*/
protected List community2Metadata(Community community)
{
@@ -522,6 +534,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
*
* @param collection
* The collection to derive metadata from
+ * @return list of metadata
*/
protected List collection2Metadata(Collection collection)
{
@@ -585,6 +598,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
*
* @param item
* The item to derive metadata from
+ * @return list of metadata
*/
protected List item2Metadata(Item item)
{
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/OAIDCIngestionCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/OAIDCIngestionCrosswalk.java
index 8ec6cb3640..124e9ce285 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/OAIDCIngestionCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/OAIDCIngestionCrosswalk.java
@@ -7,13 +7,10 @@
*/
package org.dspace.content.crosswalk;
-import java.io.IOException;
-import java.sql.SQLException;
-import java.util.List;
-
import org.dspace.authorize.AuthorizeException;
import org.dspace.content.DSpaceObject;
import org.dspace.content.Item;
+import org.dspace.content.MetadataField;
import org.dspace.content.MetadataSchema;
import org.dspace.content.factory.ContentServiceFactory;
import org.dspace.content.service.ItemService;
@@ -22,6 +19,10 @@ import org.dspace.core.Context;
import org.jdom.Element;
import org.jdom.Namespace;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.List;
+
/**
* DIM ingestion crosswalk
*
@@ -34,6 +35,7 @@ public class OAIDCIngestionCrosswalk
implements IngestionCrosswalk
{
protected ItemService itemService = ContentServiceFactory.getInstance().getItemService();
+ private CrosswalkMetadataValidator metadataValidator = new CrosswalkMetadataValidator();
@Override
public void ingest(Context context, DSpaceObject dso, List metadata, boolean createMissingMetadataFields) throws CrosswalkException, IOException, SQLException, AuthorizeException {
@@ -64,8 +66,8 @@ public class OAIDCIngestionCrosswalk
if (lang == null) {
lang = element.getAttributeValue("lang");
}
- CrosswalkUtils.checkMetadata(context, MetadataSchema.DC_SCHEMA, element.getName(), null, createMissingMetadataFields);
- itemService.addMetadata(context, item, "dc", element.getName(), null, lang, element.getText());
+ MetadataField metadataField = metadataValidator.checkMetadata(context, MetadataSchema.DC_SCHEMA, element.getName(), null, createMissingMetadataFields);
+ itemService.addMetadata(context, item, metadataField, lang, element.getText());
}
}
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/OREDisseminationCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/OREDisseminationCrosswalk.java
index 899b2d68d4..be68791368 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/OREDisseminationCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/OREDisseminationCrosswalk.java
@@ -80,10 +80,10 @@ public class OREDisseminationCrosswalk
* Disseminate an Atom-encoded ORE ReM mapped from a DSpace Item
* @param item
* @return
- * @throws CrosswalkException
- * @throws IOException
- * @throws SQLException
- * @throws AuthorizeException
+ * @throws CrosswalkException if crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
private Element disseminateItem(Context context, Item item) throws CrosswalkException, IOException, SQLException, AuthorizeException
{
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java
index a4913d7ea4..4d7310afbc 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java
@@ -225,7 +225,7 @@ public class OREIngestionCrosswalk
/**
- * Helper method to escape all chaacters that are not part of the canon set
+ * Helper method to escape all characters that are not part of the canon set
* @param sourceString source unescaped string
*/
private String encodeForURL(String sourceString) {
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/QDCCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/QDCCrosswalk.java
index f7d929d085..ff4d026d88 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/QDCCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/QDCCrosswalk.java
@@ -7,18 +7,6 @@
*/
package org.dspace.content.crosswalk;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.StringReader;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
import org.apache.commons.lang.ArrayUtils;
import org.apache.log4j.Logger;
import org.dspace.authorize.AuthorizeException;
@@ -34,6 +22,13 @@ import org.jdom.Element;
import org.jdom.Namespace;
import org.jdom.input.SAXBuilder;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.StringReader;
+import java.sql.SQLException;
+import java.util.*;
+
/**
* Configurable QDC Crosswalk
*
@@ -122,6 +117,8 @@ public class QDCCrosswalk extends SelfNamedPlugin
protected ItemService itemService = ContentServiceFactory.getInstance().getItemService();
+ private CrosswalkMetadataValidator metadataValidator = new CrosswalkMetadataValidator();
+
/**
* Fill in the plugin-name table from DSpace configuration entries
* for configuration files for flavors of QDC crosswalk:
@@ -336,6 +333,11 @@ public class QDCCrosswalk extends SelfNamedPlugin
/**
* Returns object's metadata in MODS format, as XML structure node.
+ * @param context context
+ * @throws CrosswalkException if crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public List disseminateList(Context context, DSpaceObject dso)
@@ -463,7 +465,15 @@ public class QDCCrosswalk extends SelfNamedPlugin
else if (element2qdc.containsKey(key))
{
String qdc[] = (element2qdc.get(key)).split("\\.");
- CrosswalkUtils.checkMetadata(context, qdc[0], qdc[1], qdc[2], createMissingMetadataFields);
+
+ MetadataField metadataField;
+ if (qdc.length == 3) {
+ metadataField = metadataValidator.checkMetadata(context, qdc[0], qdc[1], qdc[2], createMissingMetadataFields);
+ } else if (qdc.length == 2) {
+ metadataField = metadataValidator.checkMetadata(context, qdc[0], qdc[1], null, createMissingMetadataFields);
+ } else {
+ throw new CrosswalkInternalException("Unrecognized format in QDC element identifier for key=\"" + key + "\", qdc=\"" + element2qdc.get(key) + "\"");
+ }
// get language - prefer xml:lang, accept lang.
String lang = me.getAttributeValue("lang", Namespace.XML_NAMESPACE);
@@ -472,18 +482,7 @@ public class QDCCrosswalk extends SelfNamedPlugin
lang = me.getAttributeValue("lang");
}
- if (qdc.length == 3)
- {
- itemService.addMetadata(context, item, qdc[0], qdc[1], qdc[2], lang, me.getText());
- }
- else if (qdc.length == 2)
- {
- itemService.addMetadata(context, item, qdc[0], qdc[1], null, lang, me.getText());
- }
- else
- {
- throw new CrosswalkInternalException("Unrecognized format in QDC element identifier for key=\"" + key + "\", qdc=\"" + element2qdc.get(key) + "\"");
- }
+ itemService.addMetadata(context, item, metadataField, lang, me.getText());
}
else
{
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/RoleCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/RoleCrosswalk.java
index 6b880cb3bb..ad56dd1d45 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/RoleCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/RoleCrosswalk.java
@@ -35,11 +35,11 @@ import org.jdom.output.XMLOutputter;
/**
* Role Crosswalk
*
- * Translate between DSpace Group & EPeople definitions and a DSpace-specific
+ * Translate between DSpace Group and EPeople definitions and a DSpace-specific
* XML export format (generated by the RoleDisseminator). This is primarily
* used for AIPs, but may be used by other Packagers as necessary.
*
- * This crosswalk allows you to export DSpace Groups & EPeople to this XML
+ * This crosswalk allows you to export DSpace Groups and EPeople to this XML
* structured format. It also allows you to import an XML file of this format
* in order to restore DSpace Groups and EPeople defined within it.
*
@@ -135,6 +135,7 @@ public class RoleCrosswalk
* When there are no results, an
* empty list is returned, but never null
.
*
+ * @param context context
* @param dso the DSpace Object whose metadata to export.
* @return results of crosswalk as list of XML elements.
*
@@ -159,6 +160,7 @@ public class RoleCrosswalk
* This is typically the root element of a document.
*
*
+ * @param context context
* @param dso the DSpace Object whose metadata to export.
* @return root Element of the target metadata, never null
*
@@ -241,13 +243,14 @@ public class RoleCrosswalk
/**
* Ingest a List of XML elements
*
- * @param context
- * @param dso
- * @param metadata
- * @throws CrosswalkException
- * @throws IOException
- * @throws SQLException
- * @throws AuthorizeException
+ * @param context context
+ * @param dso DSpaceObject
+ * @param metadata list of metadata
+ * @param createMissingMetadataFields whether to create missing fields
+ * @throws CrosswalkException if crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public void ingest(Context context, DSpaceObject dso, List metadata, boolean createMissingMetadataFields)
@@ -265,13 +268,14 @@ public class RoleCrosswalk
*
* This essentially just wraps a call to the configured Role PackageIngester.
*
- * @param context
- * @param dso
- * @param root
- * @throws CrosswalkException
- * @throws IOException
- * @throws SQLException
- * @throws AuthorizeException
+ * @param context context
+ * @param dso DSpaceObject
+ * @param root root element
+ * @param createMissingMetadataFields whether to create missing fields
+ * @throws CrosswalkException if crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public void ingest(Context context, DSpaceObject dso, Element root, boolean createMissingMetadataFields)
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/SimpleDCDisseminationCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/SimpleDCDisseminationCrosswalk.java
index b60136bdb5..78ad431049 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/SimpleDCDisseminationCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/SimpleDCDisseminationCrosswalk.java
@@ -77,6 +77,11 @@ public class SimpleDCDisseminationCrosswalk extends SelfNamedPlugin
* Returns object's metadata as XML elements.
* Simple-minded copying of elements: convert contributor.author to
* "creator" but otherwise just grab element name without qualifier.
+ * @param context context
+ * @throws CrosswalkException if crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public List disseminateList(Context context, DSpaceObject dso)
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/StreamDisseminationCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/StreamDisseminationCrosswalk.java
index 8380dce629..c4582b0302 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/StreamDisseminationCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/StreamDisseminationCrosswalk.java
@@ -35,6 +35,7 @@ public interface StreamDisseminationCrosswalk
/**
* Predicate: Can this disseminator crosswalk the given object.
*
+ * @param context context
* @param dso dspace object, e.g. an Item
.
* @return true when disseminator is capable of producing metadata.
*/
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/XHTMLHeadDisseminationCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/XHTMLHeadDisseminationCrosswalk.java
index 81486e8d60..80f8e651e3 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/XHTMLHeadDisseminationCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/XHTMLHeadDisseminationCrosswalk.java
@@ -146,6 +146,11 @@ public class XHTMLHeadDisseminationCrosswalk extends SelfNamedPlugin implements
/**
* This generates a <head> element around the metadata; in general
* this will probably not be used
+ * @param context context
+ * @throws CrosswalkException crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public Element disseminateElement(Context context, DSpaceObject dso)
@@ -161,6 +166,11 @@ public class XHTMLHeadDisseminationCrosswalk extends SelfNamedPlugin implements
/**
* Return <meta> elements that can be put in the <head> element
* of an XHTML document.
+ * @param context context
+ * @throws CrosswalkException crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public List disseminateList(Context context, DSpaceObject dso) throws CrosswalkException,
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/XSLTDisseminationCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/XSLTDisseminationCrosswalk.java
index 17469eee78..687bde5a1f 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/XSLTDisseminationCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/XSLTDisseminationCrosswalk.java
@@ -250,6 +250,11 @@ public class XSLTDisseminationCrosswalk
/**
* Disseminate the DSpace item, collection, or community.
*
+ * @param context context
+ * @throws CrosswalkException crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
* @see DisseminationCrosswalk
*/
@Override
@@ -321,6 +326,8 @@ public class XSLTDisseminationCrosswalk
* Generate an intermediate representation of a DSpace object.
*
* @param dso The dspace object to build a representation of.
+ * @param dcvs list of metadata
+ * @return element
*/
public static Element createDIM(DSpaceObject dso, List dcvs)
{
@@ -343,6 +350,7 @@ public class XSLTDisseminationCrosswalk
* Generate an intermediate representation of a DSpace object.
*
* @param dso The dspace object to build a representation of.
+ * @return element
*/
public static Element createDIM(DSpaceObject dso)
{
@@ -515,7 +523,9 @@ public class XSLTDisseminationCrosswalk
/**
* Simple command-line rig for testing the DIM output of a stylesheet.
- * Usage: java XSLTDisseminationCrosswalk [output-file]
+ * Usage: {@code java XSLTDisseminationCrosswalk [output-file]}
+ * @param argv arguments
+ * @throws Exception if error
*/
public static void main(String[] argv) throws Exception
{
diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/XSLTIngestionCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/XSLTIngestionCrosswalk.java
index 08f90d803f..47f5b09bb5 100644
--- a/dspace-api/src/main/java/org/dspace/content/crosswalk/XSLTIngestionCrosswalk.java
+++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/XSLTIngestionCrosswalk.java
@@ -18,12 +18,7 @@ import javax.xml.transform.TransformerException;
import org.apache.commons.lang.ArrayUtils;
import org.apache.log4j.Logger;
import org.dspace.authorize.AuthorizeException;
-import org.dspace.content.DSpaceObject;
-import org.dspace.content.Collection;
-import org.dspace.content.Community;
-import org.dspace.content.Item;
-import org.dspace.content.MetadataField;
-import org.dspace.content.MetadataSchema;
+import org.dspace.content.*;
import org.dspace.content.authority.Choices;
import org.dspace.content.factory.ContentServiceFactory;
import org.dspace.content.packager.PackageUtils;
@@ -41,6 +36,12 @@ import org.jdom.output.XMLOutputter;
import org.jdom.transform.JDOMResult;
import org.jdom.transform.JDOMSource;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.Iterator;
+import java.util.List;
+
/**
* Configurable XSLT-driven ingestion Crosswalk
*
@@ -100,7 +101,8 @@ public class XSLTIngestionCrosswalk
String authority = field.getAttributeValue("authority");
String sconf = field.getAttributeValue("confidence");
- CrosswalkUtils.checkMetadata(context, schema, element, qualifier, createMissingMetadataFields);
+ CrosswalkMetadataValidator metadataValidator = new CrosswalkMetadataValidator();
+ MetadataField metadataField = metadataValidator.checkMetadata(context, schema, element, qualifier, createMissingMetadataFields);
// sanity check: some XSL puts an empty string in qualifier,
// change it to null so we match the unqualified DC field:
if (qualifier != null && qualifier.equals(""))
@@ -113,11 +115,11 @@ public class XSLTIngestionCrosswalk
{
int confidence = (sconf != null && sconf.length() > 0) ?
Choices.getConfidenceValue(sconf) : Choices.CF_UNSET;
- itemService.addMetadata(context, item, schema, element, qualifier, lang, field.getText(), authority, confidence);
+ itemService.addMetadata(context, item, metadataField, lang, field.getText(), authority, confidence);
}
else
{
- itemService.addMetadata(context, item, schema, element, qualifier, lang, field.getText());
+ itemService.addMetadata(context, item, metadataField, lang, field.getText());
}
}
@@ -126,6 +128,11 @@ public class XSLTIngestionCrosswalk
* Translation produces a list of DIM "field" elements;
* these correspond directly to Item.addMetadata() calls so
* they are simply executed.
+ * @param createMissingMetadataFields whether to create missing fields
+ * @throws CrosswalkException crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public void ingest(Context context, DSpaceObject dso, List metadata,
@@ -155,6 +162,11 @@ public class XSLTIngestionCrosswalk
* Ingest a whole document. Build Document object around root element,
* and feed that to the transformation, since it may get handled
* differently than a List of metadata elements.
+ * @param createMissingMetadataFields whether to create missing fields
+ * @throws CrosswalkException crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
@Override
public void ingest(Context context, DSpaceObject dso, Element root, boolean createMissingMetadataFields)
@@ -207,6 +219,11 @@ public class XSLTIngestionCrosswalk
* @param context the context
* @param dso object into which to ingest metadata
* @param dim root of a DIM expression
+ * @param createMissingMetadataFields whether to create missing fields
+ * @throws CrosswalkException crosswalk error
+ * @throws IOException if IO error
+ * @throws SQLException if database error
+ * @throws AuthorizeException if authorization error
*/
public static void ingestDIM(Context context, DSpaceObject dso, Element dim, boolean createMissingMetadataFields)
@@ -275,7 +292,9 @@ public class XSLTIngestionCrosswalk
/**
* Simple command-line rig for testing the DIM output of a stylesheet.
- * Usage: java XSLTIngestionCrosswalk
+ * Usage: {@code java XSLTIngestionCrosswalk }
+ * @param argv arguments
+ * @throws Exception if error
*/
public static void main(String[] argv) throws Exception
{
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/BitstreamDAO.java b/dspace-api/src/main/java/org/dspace/content/dao/BitstreamDAO.java
index 6e86801e0b..c568d838e6 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/BitstreamDAO.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/BitstreamDAO.java
@@ -20,7 +20,7 @@ import java.util.List;
/**
* Database Access Object interface class for the Bitstream object.
* The implementation of this class is responsible for all database calls for the Bitstream object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/BitstreamFormatDAO.java b/dspace-api/src/main/java/org/dspace/content/dao/BitstreamFormatDAO.java
index 777fd9b593..3c7c1907ff 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/BitstreamFormatDAO.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/BitstreamFormatDAO.java
@@ -17,7 +17,7 @@ import java.util.List;
/**
* Database Access Object interface class for the BitstreamFormat object.
* The implementation of this class is responsible for all database calls for the BitstreamFormat object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/BundleDAO.java b/dspace-api/src/main/java/org/dspace/content/dao/BundleDAO.java
index 09c0d298e1..0e13711876 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/BundleDAO.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/BundleDAO.java
@@ -15,7 +15,7 @@ import java.sql.SQLException;
/**
* Database Access Object interface class for the Bundle object.
* The implementation of this class is responsible for all database calls for the Bundle object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/CollectionDAO.java b/dspace-api/src/main/java/org/dspace/content/dao/CollectionDAO.java
index a202e875ab..616a3997e8 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/CollectionDAO.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/CollectionDAO.java
@@ -21,7 +21,7 @@ import java.util.Map;
/**
* Database Access Object interface class for the Collection object.
* The implementation of this class is responsible for all database calls for the Collection object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/CommunityDAO.java b/dspace-api/src/main/java/org/dspace/content/dao/CommunityDAO.java
index 4247784c64..99f422b01f 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/CommunityDAO.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/CommunityDAO.java
@@ -19,7 +19,7 @@ import java.util.List;
/**
* Database Access Object interface class for the Community object.
* The implementation of this class is responsible for all database calls for the Community object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/ItemDAO.java b/dspace-api/src/main/java/org/dspace/content/dao/ItemDAO.java
index 1a21b4c645..80f7fa834d 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/ItemDAO.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/ItemDAO.java
@@ -22,7 +22,7 @@ import java.util.UUID;
/**
* Database Access Object interface class for the Item object.
* The implementation of this class is responsible for all database calls for the Item object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
@@ -35,9 +35,10 @@ public interface ItemDAO extends DSpaceObjectLegacySupportDAO-
/**
* Find all Items modified since a Date.
*
- * @param context
+ * @param context Context
* @param since Earliest interesting last-modified date.
- * @return
+ * @return iterator over items
+ * @throws SQLException if database error
*/
public Iterator
- findByLastModifiedSince(Context context, Date since)
throws SQLException;
@@ -58,12 +59,12 @@ public interface ItemDAO extends DSpaceObjectLegacySupportDAO
-
/**
* Count number of items in a given collection
- * @param context
+ * @param context context
* @param collection the collection
* @param includeArchived whether to include archived items in count
* @param includeWithdrawn whether to include withdrawn items in count
* @return item count
- * @throws SQLException
+ * @throws SQLException if database error
*/
public int countItems(Context context, Collection collection, boolean includeArchived, boolean includeWithdrawn) throws SQLException;
@@ -73,23 +74,24 @@ public interface ItemDAO extends DSpaceObjectLegacySupportDAO
-
* {@link org.dspace.content.service.CommunityService#getAllCollections(Context,Community)}
* to determine the unique number of items in a Community.
*
- * @param context
+ * @param context context
* @param collections the list of collections
* @param includeArchived whether to include archived items in count
* @param includeWithdrawn whether to include withdrawn items in count
* @return item count
- * @throws SQLException
+ * @throws SQLException if database error
*/
public int countItems(Context context, List collections, boolean includeArchived, boolean includeWithdrawn) throws SQLException;
/**
* Get all Items installed or withdrawn, discoverable, and modified since a Date.
- * @param context
- * @param archived
- * @param withdrawn
- * @param discoverable
+ * @param context context
+ * @param archived whether to find archived
+ * @param withdrawn whether to find withdrawn
+ * @param discoverable whether to find discoverable
* @param lastModified earliest interesting last-modified date.
- * @return
+ * @return iterator over items
+ * @throws SQLException if database error
*/
public Iterator
- findAll(Context context, boolean archived,
boolean withdrawn, boolean discoverable, Date lastModified)
@@ -97,19 +99,19 @@ public interface ItemDAO extends DSpaceObjectLegacySupportDAO
-
/**
* Count total number of items (rows in item table)
- * @param context
+ * @param context context
* @return total count
- * @throws SQLException
+ * @throws SQLException if database error
*/
int countRows(Context context) throws SQLException;
/**
* Count number of items based on specific status flags
- * @param context
+ * @param context context
* @param includeArchived whether to include archived items in count
* @param includeWithdrawn whether to include withdrawn items in count
* @return count of items
- * @throws SQLException
+ * @throws SQLException if database error
*/
int countItems(Context context, boolean includeArchived, boolean includeWithdrawn) throws SQLException;
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/MetadataFieldDAO.java b/dspace-api/src/main/java/org/dspace/content/dao/MetadataFieldDAO.java
index 0338ab630d..47388761f0 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/MetadataFieldDAO.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/MetadataFieldDAO.java
@@ -18,7 +18,7 @@ import java.util.List;
/**
* Database Access Object interface class for the MetadataField object.
* The implementation of this class is responsible for all database calls for the MetadataField object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/MetadataSchemaDAO.java b/dspace-api/src/main/java/org/dspace/content/dao/MetadataSchemaDAO.java
index 5621234712..16cf18de5a 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/MetadataSchemaDAO.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/MetadataSchemaDAO.java
@@ -16,7 +16,7 @@ import java.sql.SQLException;
/**
* Database Access Object interface class for the MetadataSchema object.
* The implementation of this class is responsible for all database calls for the MetadataSchema object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/MetadataValueDAO.java b/dspace-api/src/main/java/org/dspace/content/dao/MetadataValueDAO.java
index 2e5967fa5e..212a7fe666 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/MetadataValueDAO.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/MetadataValueDAO.java
@@ -18,7 +18,7 @@ import java.util.List;
/**
* Database Access Object interface class for the MetadataValue object.
* The implementation of this class is responsible for all database calls for the MetadataValue object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
@@ -34,4 +34,5 @@ public interface MetadataValueDAO extends GenericDAO {
throws SQLException;
int countRows(Context context) throws SQLException;
+
}
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/SiteDAO.java b/dspace-api/src/main/java/org/dspace/content/dao/SiteDAO.java
index f2b13db98a..da35c10a49 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/SiteDAO.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/SiteDAO.java
@@ -9,14 +9,13 @@ package org.dspace.content.dao;
import org.dspace.content.Site;
import org.dspace.core.Context;
-import org.dspace.core.GenericDAO;
import java.sql.SQLException;
/**
* Database Access Object interface class for the Site object.
* The implementation of this class is responsible for all database calls for the Site object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/WorkspaceItemDAO.java b/dspace-api/src/main/java/org/dspace/content/dao/WorkspaceItemDAO.java
index d03baa4408..4d9f536c04 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/WorkspaceItemDAO.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/WorkspaceItemDAO.java
@@ -21,7 +21,7 @@ import java.util.Map;
/**
* Database Access Object interface class for the WorkspaceItem object.
* The implementation of this class is responsible for all database calls for the WorkspaceItem object and is autowired by spring
- * This class should only be accessed from a single service & should never be exposed outside of the API
+ * This class should only be accessed from a single service and should never be exposed outside of the API
*
* @author kevinvandevelde at atmire.com
*/
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/impl/BitstreamFormatDAOImpl.java b/dspace-api/src/main/java/org/dspace/content/dao/impl/BitstreamFormatDAOImpl.java
index 7768cd8ddd..c25c198785 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/impl/BitstreamFormatDAOImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/impl/BitstreamFormatDAOImpl.java
@@ -43,10 +43,11 @@ public class BitstreamFormatDAOImpl extends AbstractHibernateDAOnull if
* there's no bitstream format with the given MIMEtype.
- * @throws java.sql.SQLException
+ * @throws SQLException if database error
*/
@Override
public BitstreamFormat findByMIMEType(Context context, String mimeType, boolean includeInternal) throws SQLException
@@ -72,7 +73,7 @@ public class BitstreamFormatDAOImpl extends AbstractHibernateDAOnull if
* there's no bitstream format with the given short description
- * @throws java.sql.SQLException
+ * @throws SQLException if database error
*/
@Override
public BitstreamFormat findByShortDescription(Context context,
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/impl/CollectionDAOImpl.java b/dspace-api/src/main/java/org/dspace/content/dao/impl/CollectionDAOImpl.java
index 21d72281db..8426bac072 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/impl/CollectionDAOImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/impl/CollectionDAOImpl.java
@@ -47,9 +47,9 @@ public class CollectionDAOImpl extends AbstractHibernateDSODAO imple
*
* @param context
* DSpace context object
- *
+ * @param order order by MetadataField
* @return the collections in the system
- * @throws java.sql.SQLException
+ * @throws SQLException if database error
*/
@Override
public List findAll(Context context, MetadataField order) throws SQLException
@@ -72,7 +72,7 @@ public class CollectionDAOImpl extends AbstractHibernateDSODAO imple
if(limit != null){
hibernateQuery.setMaxResults(limit);
}
- hibernateQuery.setParameter(order.toString(), order.getFieldID());
+ hibernateQuery.setParameter(order.toString(), order.getID());
return list(hibernateQuery);
}
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/impl/CommunityDAOImpl.java b/dspace-api/src/main/java/org/dspace/content/dao/impl/CommunityDAOImpl.java
index 47fd0f9e58..6faf24eba1 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/impl/CommunityDAOImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/impl/CommunityDAOImpl.java
@@ -43,10 +43,11 @@ public class CommunityDAOImpl extends AbstractHibernateDSODAO impleme
* Get a list of all communities in the system. These are alphabetically
* sorted by community name.
*
- * @param context
- * DSpace context object
+ * @param context DSpace context object
+ * @param sortField sort field
*
* @return the communities in the system
+ * @throws SQLException if database error
*/
@Override
public List findAll(Context context, MetadataField sortField) throws SQLException
@@ -69,7 +70,7 @@ public class CommunityDAOImpl extends AbstractHibernateDSODAO impleme
if(limit != null){
query.setMaxResults(limit);
}
- query.setParameter(sortField.toString(), sortField.getFieldID());
+ query.setParameter(sortField.toString(), sortField.getID());
return list(query);
}
@@ -89,7 +90,7 @@ public class CommunityDAOImpl extends AbstractHibernateDSODAO impleme
addMetadataSortQuery(queryBuilder, Arrays.asList(sortField), ListUtils.EMPTY_LIST);
Query query = createQuery(context, queryBuilder.toString());
- query.setParameter(sortField.toString(), sortField.getFieldID());
+ query.setParameter(sortField.toString(), sortField.getID());
return findMany(context, query);
}
diff --git a/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java b/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java
index 4f8b21487e..8540fd88ad 100644
--- a/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java
+++ b/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java
@@ -107,7 +107,7 @@ public class ItemDAOImpl extends AbstractHibernateDSODAO
- implements ItemDA
addMetadataSortQuery(query, Collections.singletonList(metadataField), null);
Query hibernateQuery = createQuery(context, query.toString());
- hibernateQuery.setParameter(metadataField.toString(), metadataField.getFieldID());
+ hibernateQuery.setParameter(metadataField.toString(), metadataField.getID());
hibernateQuery.setParameter("in_archive", true);
hibernateQuery.setParameter("submitter", eperson);
hibernateQuery.setMaxResults(limit);
@@ -244,6 +244,9 @@ public class ItemDAOImpl extends AbstractHibernateDSODAO
- implements ItemDA
@Override
public int countItems(Context context, List