DS-3154: more dspace-api fixes, alphabetically through org.dspace.core

This commit is contained in:
Tim Donohue
2016-04-29 13:00:13 -05:00
parent a87cf18b11
commit f92fa6605d
141 changed files with 1248 additions and 361 deletions

View File

@@ -62,10 +62,13 @@ public class BrandedPreviewJPEGFilter extends MediaFilter
/** /**
* @param currentItem item
* @param source * @param source
* source input stream * source input stream
* @param verbose verbose mode
* *
* @return InputStream the resulting input stream * @return InputStream the resulting input stream
* @throws Exception if error
*/ */
@Override @Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose) public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)

View File

@@ -73,11 +73,14 @@ public class ExcelFilter extends MediaFilter
} }
/** /**
* @param source * @param item item
* source input stream * @param source source input stream
* @param verbose verbose mode
* *
* @return InputStream the resulting input stream * @return InputStream the resulting input stream
* @throws Exception if error
*/ */
@Override
public InputStream getDestinationStream(Item item, InputStream source, boolean verbose) public InputStream getDestinationStream(Item item, InputStream source, boolean verbose)
throws Exception throws Exception
{ {

View File

@@ -70,12 +70,10 @@ public interface FormatFilter
* for any reason. * for any reason.
* *
* *
* @param c * @param c context
* context * @param item item containing bitstream to process
* @param item * @param source source bitstream to be processed
* item containing bitstream to process * @param verbose verbose mode
* @param source
* source bitstream to be processed
* *
* @return true if bitstream processing should continue, * @return true if bitstream processing should continue,
* false if this bitstream should be skipped * false if this bitstream should be skipped

View File

@@ -59,10 +59,12 @@ public class HTMLFilter extends MediaFilter
} }
/** /**
* @param source * @param currentItem item
* source input stream * @param source source input stream
* @param verbose verbose mode
* *
* @return InputStream the resulting input stream * @return InputStream the resulting input stream
* @throws Exception if error
*/ */
@Override @Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose) public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)

View File

@@ -24,10 +24,12 @@ public class ImageMagickImageThumbnailFilter extends ImageMagickThumbnailFilter
{ {
/** /**
* @param source * @param currentItem item
* source input stream * @param source source input stream
* @param verbose verbose mode
* *
* @return InputStream the resulting input stream * @return InputStream the resulting input stream
* @throws Exception if error
*/ */
@Override @Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose) public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)

View File

@@ -66,10 +66,12 @@ public class JPEGFilter extends MediaFilter implements SelfRegisterInputFormats
} }
/** /**
* @param source * @param currentItem item
* source input stream * @param source source input stream
* @param verbose verbose mode
* *
* @return InputStream the resulting input stream * @return InputStream the resulting input stream
* @throws Exception if error
*/ */
@Override @Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose) 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 * Convenience method that returns a blurred instance of the
* provided {@code BufferedImage}. * provided {@code BufferedImage}.
* *
* @param buf buffered image
* @return updated BufferedImage
*/ */
public BufferedImage getBlurredInstance(BufferedImage buf) public BufferedImage getBlurredInstance(BufferedImage buf)
{ {

View File

@@ -29,15 +29,14 @@ public abstract class MediaFilter implements FormatFilter
* for any reason. * for any reason.
* *
* *
* @param c * @param c context
* context * @param item item containing bitstream to process
* @param item * @param source source bitstream to be processed
* item containing bitstream to process * @param verbose verbose mode
* @param source
* source bitstream to be processed
* *
* @return true if bitstream processing should continue, * @return true if bitstream processing should continue,
* false if this bitstream should be skipped * false if this bitstream should be skipped
* @throws Exception if error
*/ */
@Override @Override
public boolean preProcessBitstream(Context c, Item item, Bitstream source, boolean verbose) public boolean preProcessBitstream(Context c, Item item, Bitstream source, boolean verbose)
@@ -62,6 +61,7 @@ public abstract class MediaFilter implements FormatFilter
* @param generatedBitstream * @param generatedBitstream
* the bitstream which was generated by * the bitstream which was generated by
* this filter. * this filter.
* @throws java.lang.Exception
*/ */
@Override @Override
public void postProcessBitstream(Context c, Item item, Bitstream generatedBitstream) public void postProcessBitstream(Context c, Item item, Bitstream generatedBitstream)

View File

@@ -66,10 +66,12 @@ public class PDFBoxThumbnail extends MediaFilter implements SelfRegisterInputFor
} }
/** /**
* @param source * @param currentItem item
* source input stream * @param source source input stream
* @param verbose verbose mode
* *
* @return InputStream the resulting input stream * @return InputStream the resulting input stream
* @throws Exception if error
*/ */
@Override @Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose) public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)

View File

@@ -68,10 +68,12 @@ public class PDFFilter extends MediaFilter
} }
/** /**
* @param source * @param currentItem item
* source input stream * @param source source input stream
* @param verbose verbose mode
* *
* @return InputStream the resulting input stream * @return InputStream the resulting input stream
* @throws Exception if error
*/ */
@Override @Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose) public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)

View File

@@ -64,10 +64,12 @@ public class PowerPointFilter extends MediaFilter
} }
/** /**
* @param source * @param currentItem item
* source input stream * @param source source input stream
* @param verbose verbose mode
* *
* @return InputStream the resulting input stream * @return InputStream the resulting input stream
* @throws Exception if error
*/ */
@Override @Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose) public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)

View File

@@ -63,10 +63,12 @@ public class WordFilter extends MediaFilter
} }
/** /**
* @param source * @param currentItem item
* source input stream * @param source source input stream
* @param verbose verbose mode
* *
* @return InputStream the resulting input stream * @return InputStream the resulting input stream
* @throws Exception if error
*/ */
@Override @Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose) public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)

View File

@@ -48,8 +48,11 @@ public interface MediaFilterService {
* Iterate through the item's bitstreams in the ORIGINAL bundle, applying * Iterate through the item's bitstreams in the ORIGINAL bundle, applying
* filters if possible. * filters if possible.
* *
* @param context context
* @param myItem item
* @return true if any bitstreams processed, * @return true if any bitstreams processed,
* false if none * false if none
* @throws Exception if error
*/ */
public boolean filterItem(Context context, Item myItem) throws Exception; 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 * instantiated. Exceptions from filtering will be logged to STDOUT and
* swallowed. * swallowed.
* *
* @param c context
* @param myItem item
* @param myBitstream bitstream
* @return true if bitstream processed, * @return true if bitstream processed,
* false if no applicable filter or already processed * false if no applicable filter or already processed
* @throws Exception if error
*/ */
public boolean filterBitstream(Context c, Item myItem, Bitstream myBitstream) throws Exception; public boolean filterBitstream(Context c, Item myItem, Bitstream myBitstream) throws Exception;

View File

@@ -9,7 +9,6 @@ package org.dspace.app.requestitem;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.dspace.authorize.AuthorizeException;
import org.dspace.content.Item; import org.dspace.content.Item;
import org.dspace.core.ConfigurationManager; import org.dspace.core.ConfigurationManager;
import org.dspace.core.Context; import org.dspace.core.Context;
@@ -55,9 +54,10 @@ public class RequestItemHelpdeskStrategy extends RequestItemSubmitterStrategy {
* Return a RequestItemAuthor object for the specified helpdesk email address. * 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, * 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. * Otherwise it falls back to a helpdeskname key in the Messages.props.
* @param context * @param context context
* @param helpDeskEmail * @param helpDeskEmail email
* @return * @return RequestItemAuthor
* @throws SQLException if database error
*/ */
public RequestItemAuthor getHelpDeskPerson(Context context, String helpDeskEmail) throws SQLException{ public RequestItemAuthor getHelpDeskPerson(Context context, String helpDeskEmail) throws SQLException{
EPerson helpdeskEPerson = null; EPerson helpdeskEPerson = null;

View File

@@ -24,7 +24,13 @@ public interface RequestItemService {
/** /**
* Generate a request item representing the request and put it into the DB * 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 * @return the token of the request item
* @throws SQLException if database error * @throws SQLException if database error
*/ */
@@ -36,6 +42,7 @@ public interface RequestItemService {
/** /**
* Save updates to the record. Only accept_request, and decision_date are set-able. * Save updates to the record. Only accept_request, and decision_date are set-able.
* @param context * @param context
* @param requestItem
*/ */
public void update(Context context, RequestItem requestItem); public void update(Context context, RequestItem requestItem);

View File

@@ -67,17 +67,24 @@ public interface SFXFileReaderService {
/** /**
* Is Empty text Node * * Is Empty text Node *
* @param nd node
* @return true or false
*/ */
public boolean isEmptyTextNode(Node nd); public boolean isEmptyTextNode(Node nd);
/** /**
* Returns the value of the node's attribute named {@code <name>} * Returns the value of the node's attribute named {@code <name>}
* @param e node
* @param name name
* @return value
*/ */
public String getAttribute(Node e, String name); public String getAttribute(Node e, String name);
/** /**
* Returns the value found in the Text node (if any) in the * Returns the value found in the Text node (if any) in the
* node list that's passed in. * node list that's passed in.
* @param node node
* @return value
*/ */
public String getValue(Node node); public String getValue(Node node);
} }

View File

@@ -9,7 +9,6 @@ package org.dspace.app.statistics;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.dspace.core.ConfigurationManager; import org.dspace.core.ConfigurationManager;
import org.dspace.core.Constants;
import org.dspace.core.Context; import org.dspace.core.Context;
import org.dspace.core.LogManager; import org.dspace.core.LogManager;
import org.dspace.discovery.DiscoverQuery; import org.dspace.discovery.DiscoverQuery;
@@ -213,6 +212,9 @@ public class LogAnalyser
/** /**
* main method to be run from command line. See usage information for * main method to be run from command line. See usage information for
* details as to how to use the command line flags (-help) * 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) public static void main(String [] argv)
throws Exception, SQLException throws Exception, SQLException
@@ -294,6 +296,10 @@ public class LogAnalyser
* @param myStartDate the desired start of the analysis. Starts from the beginning otherwise * @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 myEndDate the desired end of the analysis. Goes to the end otherwise
* @param myLookUp force a lookup of the database * @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, public static String processLogs(Context context, String myLogDir,
String myFileTemplate, String myConfigFile, String myFileTemplate, String myConfigFile,
@@ -587,6 +593,7 @@ public class LogAnalyser
/** /**
* generate the analyser's output to the specified out file * generate the analyser's output to the specified out file
* @return output
*/ */
public static String createOutput() public static String createOutput()
{ {
@@ -866,6 +873,7 @@ public class LogAnalyser
/** /**
* Read in the current config file and populate the class globals. * Read in the current config file and populate the class globals.
* @throws IOException if IO error
*/ */
public static void readConfig() throws IOException public static void readConfig() throws IOException
{ {
@@ -876,6 +884,7 @@ public class LogAnalyser
* Read in the given config file and populate the class globals. * Read in the given config file and populate the class globals.
* *
* @param configFile the config file to read in * @param configFile the config file to read in
* @throws IOException if IO error
*/ */
public static void readConfig(String configFile) throws IOException public static void readConfig(String configFile) throws IOException
{ {
@@ -1166,6 +1175,8 @@ public class LogAnalyser
* @param type value for DC field 'type' (unqualified) * @param type value for DC field 'type' (unqualified)
* *
* @return an integer containing the relevant count * @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) public static Integer getNumItems(Context context, String type)
throws SQLException, SearchServiceException { throws SQLException, SearchServiceException {
@@ -1216,6 +1227,8 @@ public class LogAnalyser
* *
* @return an Integer containing the number of items in the * @return an Integer containing the number of items in the
* archive * archive
* @throws SQLException if database error
* @throws SearchServiceException if search error
*/ */
public static Integer getNumItems(Context context) public static Integer getNumItems(Context context)
throws SQLException, SearchServiceException { throws SQLException, SearchServiceException {

View File

@@ -152,6 +152,9 @@ public class ReportGenerator
/** /**
* main method to be run from command line. See usage information for * main method to be run from command line. See usage information for
* details as to how to use the command line flags * 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) public static void main(String [] argv)
throws Exception, SQLException throws Exception, SQLException
@@ -206,10 +209,13 @@ public class ReportGenerator
* this method is retained for backwards compatibility, but delegates the actual * this method is retained for backwards compatibility, but delegates the actual
* wprk to a new method * wprk to a new method
* *
* @param context the DSpace context in which this action is performed * @param context the DSpace context in which this action is performed
* @param myFormat the desired output format (currently on HTML supported) * @param myFormat the desired output format (currently on HTML supported)
* @param myInput the aggregation file to be turned into a report * @param myInput the aggregation file to be turned into a report
* @param myOutput the file into which to write the 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, public static void processReport(Context context, String myFormat,
String myInput, String myOutput, String myInput, String myOutput,
@@ -242,6 +248,11 @@ public class ReportGenerator
* using the pre-configuration information passed here, read in the * using the pre-configuration information passed here, read in the
* aggregation data and output a file containing the report in the * aggregation data and output a file containing the report in the
* requested format * 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, public static void processReport(Context context, Report report,
String myInput) String myInput)
@@ -527,6 +538,7 @@ public class ReportGenerator
* actions which are more understandable to humans * actions which are more understandable to humans
* *
* @param map the map file * @param map the map file
* @throws IOException if IO error
*/ */
public static void readMap(String map) public static void readMap(String map)
throws IOException throws IOException
@@ -612,6 +624,8 @@ public class ReportGenerator
* The values that come from this file form the basis of the analysis report * The values that come from this file form the basis of the analysis report
* *
* @param input the aggregator file * @param input the aggregator file
* @throws IOException if IO error
* @throws ParseException if parse error
*/ */
public static void readInput(String input) public static void readInput(String input)
throws IOException, ParseException throws IOException, ParseException
@@ -783,6 +797,7 @@ public class ReportGenerator
* *
* @return a string containing a reference (almost citation) to the * @return a string containing a reference (almost citation) to the
* article * article
* @throws SQLException if database error
*/ */
public static String getItemInfo(Context context, String handle) public static String getItemInfo(Context context, String handle)
throws SQLException throws SQLException

View File

@@ -66,6 +66,7 @@ public class StatisticsLoader
/** /**
* Get an array of the dates of the report files. * Get an array of the dates of the report files.
* @return array of dates
*/ */
public static Date[] getMonthlyReportDates() public static Date[] getMonthlyReportDates()
{ {
@@ -74,6 +75,7 @@ public class StatisticsLoader
/** /**
* Get an array of the dates of the analysis files. * Get an array of the dates of the analysis files.
* @return array of dates
*/ */
public static Date[] getMonthlyAnalysisDates() 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. * 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<String, StatsFile> monthlyMap) protected static Date[] getDatesFromMap(Map<String, StatsFile> monthlyMap)
{ {
@@ -107,7 +110,7 @@ public class StatisticsLoader
/** /**
* Sort the date array in descending (reverse chronological) order. * Sort the date array in descending (reverse chronological) order.
* @param dates * @param dates array of dates
* @return sorted dates. * @return sorted dates.
*/ */
protected static Date[] sortDatesDescending(Date[] dates) protected static Date[] sortDatesDescending(Date[] dates)
@@ -145,7 +148,8 @@ public class StatisticsLoader
/** /**
* Get the analysis file for a given date. * Get the analysis file for a given date.
* @param date * @param date date
* @return File
*/ */
public static File getAnalysisFor(String date) public static File getAnalysisFor(String date)
{ {
@@ -156,7 +160,8 @@ public class StatisticsLoader
/** /**
* Get the report file for a given date. * Get the report file for a given date.
* @param date * @param date date
* @return File
*/ */
public static File getReportFor(String date) public static File getReportFor(String date)
{ {
@@ -167,6 +172,7 @@ public class StatisticsLoader
/** /**
* Get the current general analysis file. * Get the current general analysis file.
* @return File
*/ */
public static File getGeneralAnalysis() public static File getGeneralAnalysis()
{ {
@@ -176,6 +182,7 @@ public class StatisticsLoader
/** /**
* Get the current general report file. * Get the current general report file.
* @return File
*/ */
public static File getGeneralReport() public static File getGeneralReport()
{ {
@@ -213,7 +220,7 @@ public class StatisticsLoader
/** /**
* Generate the cached file list from the array of files * Generate the cached file list from the array of files
* @param fileList * @param fileList array of files
*/ */
private static synchronized void loadFileList(File[] fileList) 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, * formatters are used to identify the file as a particular type,
* and extract the relevant information. If the file is not identified * and extract the relevant information. If the file is not identified
* by the formatter provided, then we return null. * by the formatter provided, then we return null.
* @param thisFile * @param thisFile file
* @param thisPattern * @param thisPattern patter
* @param sdf * @param sdf date format
* @return StatsFile
*/ */
private static StatsFile makeStatsFile(File thisFile, Pattern thisPattern, DateFormat sdf) private static StatsFile makeStatsFile(File thisFile, Pattern thisPattern, DateFormat sdf)
{ {
@@ -336,6 +344,7 @@ public class StatisticsLoader
/** /**
* Get an array of all the analysis and report files. * Get an array of all the analysis and report files.
* @return array of files
*/ */
private static File[] getAnalysisAndReportFileList() private static File[] getAnalysisAndReportFileList()
{ {

View File

@@ -27,6 +27,7 @@ public class CollectionDropDown {
* @param col * @param col
* Get full path for this collection * Get full path for this collection
* @return Full path to the collection * @return Full path to the collection
* @throws SQLException if database error
*/ */
public static String collectionPath(Collection col) throws SQLException public static String collectionPath(Collection col) throws SQLException
{ {
@@ -42,6 +43,7 @@ public class CollectionDropDown {
* @param maxchars * @param maxchars
* Truncate the full path to maxchar characters. 0 means do not truncate. * Truncate the full path to maxchar characters. 0 means do not truncate.
* @return Full path to the collection (truncated) * @return Full path to the collection (truncated)
* @throws SQLException if database error
*/ */
public static String collectionPath(Collection col, int maxchars) throws SQLException public static String collectionPath(Collection col, int maxchars) throws SQLException
{ {

View File

@@ -25,7 +25,11 @@ public class DCInputSet
/** the inputs ordered by page and row position */ /** the inputs ordered by page and row position */
private DCInput[][] inputPages = null; private DCInput[][] inputPages = null;
/** constructor */ /** constructor
* @param formName form name
* @param pages pages
* @param listMap map
*/
public DCInputSet(String formName, List<List<Map<String, String>>> pages, Map<String, List<String>> listMap) public DCInputSet(String formName, List<List<Map<String, String>>> pages, Map<String, List<String>> listMap)
{ {
this.formName = formName; this.formName = formName;
@@ -116,6 +120,7 @@ public class DCInputSet
* Does the current input set define the named field? * Does the current input set define the named field?
* Scan through every field in every page of the input set * Scan through every field in every page of the input set
* *
* @param fieldName
* @return true if the current set has the named field * @return true if the current set has the named field
*/ */
public boolean isFieldPresent(String fieldName) public boolean isFieldPresent(String fieldName)
@@ -141,6 +146,8 @@ public class DCInputSet
* and is valid for the specified document type * and is valid for the specified document type
* Scan through every field in every page of the input set * 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 * @return true if the current set has the named field
*/ */
public boolean isFieldPresent(String fieldName, String documentType) public boolean isFieldPresent(String fieldName, String documentType)

View File

@@ -82,6 +82,7 @@ public class DCInputsReader
* level structures: a map between collections and forms, the definition for * level structures: a map between collections and forms, the definition for
* each page of each form, and lists of pairs of values that populate * each page of each form, and lists of pairs of values that populate
* selection boxes. * selection boxes.
* @throws DCInputsReaderException if input reader error
*/ */
public DCInputsReader() public DCInputsReader()

View File

@@ -15,15 +15,27 @@ package org.dspace.app.util;
*/ */
public interface DSpaceWebappMXBean 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(); public boolean isUI();
/** What kind of webapp? XMLUI, OAI, etc. */ /**
* What kind of webapp? XMLUI, OAI, etc.
* @return kind of webapp
*/
public String getKind(); 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(); public String getURL();
/** When did this application start? */ /**
* When did this application start?
* @return start time
*/
public String getStarted(); public String getStarted();
} }

View File

@@ -210,8 +210,9 @@ public class GoogleMetadata
* Wrap the item, parse all configured fields and generate metadata field * Wrap the item, parse all configured fields and generate metadata field
* values. * values.
* *
* @param item * @param context context
* - The item being viewed to extract metadata from * @param item The item being viewed to extract metadata from
* @throws SQLException if database error
*/ */
public GoogleMetadata(Context context, Item item) throws SQLException public GoogleMetadata(Context context, Item item) throws SQLException
{ {
@@ -779,6 +780,7 @@ public class GoogleMetadata
/** /**
* Produce meta elements that can easily be put into the head. * Produce meta elements that can easily be put into the head.
* @return List of elements
*/ */
public List<Element> disseminateList() public List<Element> disseminateList()
{ {

View File

@@ -88,6 +88,7 @@ public class SubmissionConfigReader
/** /**
* Load Submission Configuration from the * Load Submission Configuration from the
* item-submission.xml configuration file * item-submission.xml configuration file
* @throws ServletException if servlet error
*/ */
public SubmissionConfigReader() throws ServletException public SubmissionConfigReader() throws ServletException
{ {

View File

@@ -165,6 +165,11 @@ public class SyndicationFeed
/** /**
* Fills in the feed and entry-level metadata from DSpace objects. * 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, public void populate(HttpServletRequest request, Context context, DSpaceObject dso,
DSpaceObject items[], Map<String, String> labels) DSpaceObject items[], Map<String, String> labels)
@@ -450,6 +455,7 @@ public class SyndicationFeed
* Sets the feed type for XML delivery, e.g. "rss_1.0", "atom_1.0" * 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 * Must match one of ROME's configured generators, see rome.properties
* (currently rss_1.0, rss_2.0, atom_1.0, atom_0.3) * (currently rss_1.0, rss_2.0, atom_1.0, atom_0.3)
* @param feedType feed type
*/ */
public void setType(String feedType) public void setType(String feedType)
{ {
@@ -463,6 +469,7 @@ public class SyndicationFeed
/** /**
* @return the feed we built as DOM Document * @return the feed we built as DOM Document
* @throws FeedException if feed error
*/ */
public Document outputW3CDom() public Document outputW3CDom()
throws FeedException throws FeedException
@@ -481,6 +488,7 @@ public class SyndicationFeed
/** /**
* @return the feed we built as serialized XML string * @return the feed we built as serialized XML string
* @throws FeedException if feed error
*/ */
public String outputString() public String outputString()
throws FeedException throws FeedException
@@ -491,6 +499,9 @@ public class SyndicationFeed
/** /**
* send the output to designated Writer * 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) public void output(java.io.Writer writer)
throws FeedException, IOException throws FeedException, IOException
@@ -501,6 +512,7 @@ public class SyndicationFeed
/** /**
* Add a ROME plugin module (e.g. for OpenSearch) at the feed level. * Add a ROME plugin module (e.g. for OpenSearch) at the feed level.
* @param m module
*/ */
public void addModule(Module m) public void addModule(Module m)
{ {
@@ -532,7 +544,7 @@ public class SyndicationFeed
* *
* @param request current servlet request * @param request current servlet request
* @param dso The object to reference, null if to the repository. * @param dso The object to reference, null if to the repository.
* @return * @return URL
*/ */
protected String resolveURL(HttpServletRequest request, DSpaceObject dso) protected String resolveURL(HttpServletRequest request, DSpaceObject dso)
{ {

View File

@@ -89,6 +89,7 @@ public class Util {
* @param encoding * @param encoding
* character encoding, e.g. UTF-8 * character encoding, e.g. UTF-8
* @return the encoded string * @return the encoded string
* @throws java.io.UnsupportedEncodingException if encoding error
*/ */
public static String encodeBitstreamName(String stringIn, String encoding) throws java.io.UnsupportedEncodingException { 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 // FIXME: This should be moved elsewhere, as it is used outside the UI
@@ -164,6 +165,7 @@ public class Util {
* @param stringIn * @param stringIn
* input string to encode * input string to encode
* @return the encoded string * @return the encoded string
* @throws java.io.UnsupportedEncodingException if encoding error
*/ */
public static String encodeBitstreamName(String stringIn) throws java.io.UnsupportedEncodingException { public static String encodeBitstreamName(String stringIn) throws java.io.UnsupportedEncodingException {
return encodeBitstreamName(stringIn, Constants.DEFAULT_ENCODING); return encodeBitstreamName(stringIn, Constants.DEFAULT_ENCODING);
@@ -455,7 +457,10 @@ public class Util {
* A String with the element name of the metadata field * A String with the element name of the metadata field
* @param qualifier * @param qualifier
* A String with the qualifier name of the metadata field * A String with the qualifier name of the metadata field
* @param locale locale
* @return A list of the respective "displayed-values" * @return A list of the respective "displayed-values"
* @throws SQLException if database error
* @throws DCInputsReaderException if reader error
*/ */
public static List<String> getControlledVocabulariesDisplayValueLocalized( public static List<String> getControlledVocabulariesDisplayValueLocalized(

View File

@@ -74,6 +74,7 @@ public interface AuthenticationMethod {
* @param username * @param username
* Username, if available. May be null. * Username, if available. May be null.
* @return true if new ePerson should be created. * @return true if new ePerson should be created.
* @throws SQLException if database error
*/ */
public boolean canSelfRegister(Context context, public boolean canSelfRegister(Context context,
HttpServletRequest request, HttpServletRequest request,
@@ -92,6 +93,7 @@ public interface AuthenticationMethod {
* @param eperson * @param eperson
* newly created EPerson record - email + information from the * newly created EPerson record - email + information from the
* registration form will have been filled out. * registration form will have been filled out.
* @throws SQLException if database error
*/ */
public void initEPerson(Context context, public void initEPerson(Context context,
HttpServletRequest request, HttpServletRequest request,
@@ -111,6 +113,7 @@ public interface AuthenticationMethod {
* @param username * @param username
* Username, if available. May be null. * Username, if available. May be null.
* @return true if this method allows user to change ePerson password. * @return true if this method allows user to change ePerson password.
* @throws SQLException if database error
*/ */
public boolean allowSetPassword(Context context, public boolean allowSetPassword(Context context,
HttpServletRequest request, HttpServletRequest request,
@@ -149,6 +152,7 @@ public interface AuthenticationMethod {
* *
* @return array of EPerson-group IDs, possibly 0-length, but never * @return array of EPerson-group IDs, possibly 0-length, but never
* <code>null</code>. * <code>null</code>.
* @throws SQLException if database error
*/ */
public List<Group> getSpecialGroups(Context context, HttpServletRequest request) public List<Group> getSpecialGroups(Context context, HttpServletRequest request)
throws SQLException; throws SQLException;
@@ -185,6 +189,7 @@ public interface AuthenticationMethod {
* <br>CERT_REQUIRED - not allowed to login this way without X.509 cert. * <br>CERT_REQUIRED - not allowed to login this way without X.509 cert.
* <br>NO_SUCH_USER - user not found using this method. * <br>NO_SUCH_USER - user not found using this method.
* <br>BAD_ARGS - user/pw not appropriate for this method * <br>BAD_ARGS - user/pw not appropriate for this method
* @throws SQLException if database error
*/ */
public int authenticate(Context context, public int authenticate(Context context,

View File

@@ -69,6 +69,7 @@ public class LDAPAuthentication
/** /**
* Let a real auth method return true if it wants. * Let a real auth method return true if it wants.
* @throws SQLException if database error
*/ */
@Override @Override
public boolean canSelfRegister(Context context, 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 @Override
public void initEPerson(Context context, HttpServletRequest request, public void initEPerson(Context context, HttpServletRequest request,
@@ -94,6 +96,7 @@ public class LDAPAuthentication
/** /**
* Cannot change LDAP password through dspace, right? * Cannot change LDAP password through dspace, right?
* @throws SQLException if database error
*/ */
@Override @Override
public boolean allowSetPassword(Context context, public boolean allowSetPassword(Context context,

View File

@@ -59,6 +59,8 @@ public class PasswordAuthentication
* <p> * <p>
* Example - aber.ac.uk domain : @aber.ac.uk * Example - aber.ac.uk domain : @aber.ac.uk
* Example - MIT domain and all .ac.uk domains: @mit.edu, .ac.uk * Example - MIT domain and all .ac.uk domains: @mit.edu, .ac.uk
* @param email email
* @throws SQLException if database error
*/ */
@Override @Override
public boolean canSelfRegister(Context context, public boolean canSelfRegister(Context context,
@@ -95,6 +97,7 @@ public class PasswordAuthentication
/** /**
* Nothing extra to initialize. * Nothing extra to initialize.
* @throws SQLException if database error
*/ */
@Override @Override
public void initEPerson(Context context, HttpServletRequest request, public void initEPerson(Context context, HttpServletRequest request,
@@ -105,6 +108,7 @@ public class PasswordAuthentication
/** /**
* We always allow the user to change their password. * We always allow the user to change their password.
* @throws SQLException if database error
*/ */
@Override @Override
public boolean allowSetPassword(Context context, public boolean allowSetPassword(Context context,
@@ -196,6 +200,7 @@ public class PasswordAuthentication
* <br>CERT_REQUIRED - not allowed to login this way without X.509 cert. * <br>CERT_REQUIRED - not allowed to login this way without X.509 cert.
* <br>NO_SUCH_USER - no EPerson with matching email address. * <br>NO_SUCH_USER - no EPerson with matching email address.
* <br>BAD_ARGS - missing username, or user matched but cannot login. * <br>BAD_ARGS - missing username, or user matched but cannot login.
* @throws SQLException if database error
*/ */
@Override @Override
public int authenticate(Context context, public int authenticate(Context context,

View File

@@ -159,6 +159,7 @@ public class ShibAuthentication implements AuthenticationMethod
* <br> * <br>
* NO_SUCH_USER - user not found using this method. <br> * NO_SUCH_USER - user not found using this method. <br>
* BAD_ARGS - user/pw not appropriate for this method * BAD_ARGS - user/pw not appropriate for this method
* @throws SQLException if database error
*/ */
@Override @Override
public int authenticate(Context context, String username, String password, public int authenticate(Context context, String username, String password,
@@ -400,6 +401,7 @@ public class ShibAuthentication implements AuthenticationMethod
* HTTP request, in case anything in that is used to decide * HTTP request, in case anything in that is used to decide
* @param email * @param email
* e-mail address of user attempting to register * e-mail address of user attempting to register
* @throws SQLException if database error
* *
*/ */
@Override @Override
@@ -434,6 +436,7 @@ public class ShibAuthentication implements AuthenticationMethod
* HTTP request, in case anything in that is used to decide * HTTP request, in case anything in that is used to decide
* @param username * @param username
* e-mail address of user attempting to register * e-mail address of user attempting to register
* @throws SQLException if database error
* *
*/ */
@Override @Override
@@ -456,6 +459,7 @@ public class ShibAuthentication implements AuthenticationMethod
* @param eperson * @param eperson
* newly created EPerson record - email + information from the * newly created EPerson record - email + information from the
* registration form will have been filled out. * registration form will have been filled out.
* @throws SQLException if database error
* *
*/ */
@Override @Override
@@ -578,6 +582,8 @@ public class ShibAuthentication implements AuthenticationMethod
* @param context The DSpace database context * @param context The DSpace database context
* @param request The current HTTP Request * @param request The current HTTP Request
* @return The EPerson identified or null. * @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 { 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 context The current DSpace database context
* @param request The current HTTP Request * @param request The current HTTP Request
* @return A new eperson object or null if unable to create a new eperson. * @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 { 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 context The current DSpace database context
* @param request The current HTTP Request * @param request The current HTTP Request
* @param eperson The eperson object to update. * @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 { 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 password The password
* @param request The HTTP Request * @param request The HTTP Request
* @return A valid DSpace Authentication Method status code. * @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 { 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. * the field will be automatically created.
* *
* It is safe to call this methods multiple times. * 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 { 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. * Check if a MetadataField for an eperson is available.
* *
* @param metadataName The name of the metadata field. * @param metadataName The name of the metadata field.
* @param context * @param context context
* @return True if a valid metadata field, otherwise false. * @return True if a valid metadata field, otherwise false.
* @throws SQLException if database error
*/ */
protected synchronized boolean checkIfEpersonMetadataFieldExists(Context context, String metadataName) throws SQLException { 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]+$"; 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. * @param metadataName The name of the new metadata field.
* @return True if successful, otherwise false. * @return True if successful, otherwise false.
* @throws SQLException if database error
*/ */
protected synchronized boolean autoCreateEpersonMetadataField(Context context, String metadataName) throws SQLException { protected synchronized boolean autoCreateEpersonMetadataField(Context context, String metadataName) throws SQLException {

View File

@@ -387,6 +387,7 @@ public class X509Authentication implements AuthenticationMethod
* configuration value. You'll probably want this to be true to take * configuration value. You'll probably want this to be true to take
* advantage of a Web certificate infrastructure with many more users than * advantage of a Web certificate infrastructure with many more users than
* are already known by DSpace. * are already known by DSpace.
* @throws SQLException if database error
*/ */
@Override @Override
public boolean canSelfRegister(Context context, HttpServletRequest request, public boolean canSelfRegister(Context context, HttpServletRequest request,
@@ -398,6 +399,7 @@ public class X509Authentication implements AuthenticationMethod
/** /**
* Nothing extra to initialize. * Nothing extra to initialize.
* @throws SQLException if database error
*/ */
@Override @Override
public void initEPerson(Context context, HttpServletRequest request, 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. * We don't use EPerson password so there is no reason to change it.
* @throws SQLException if database error
*/ */
@Override @Override
public boolean allowSetPassword(Context context, public boolean allowSetPassword(Context context,
@@ -486,11 +489,12 @@ public class X509Authentication implements AuthenticationMethod
* Return special groups configured in dspace.cfg for X509 certificate * Return special groups configured in dspace.cfg for X509 certificate
* authentication. * authentication.
* *
* @param context * @param context context
* @param request * @param request
* object potentially containing the cert * object potentially containing the cert
* *
* @return An int array of group IDs * @return An int array of group IDs
* @throws SQLException if database error
* *
*/ */
@Override @Override
@@ -558,6 +562,7 @@ public class X509Authentication implements AuthenticationMethod
* </ul> * </ul>
* *
* @return One of: SUCCESS, BAD_CREDENTIALS, NO_SUCH_USER, BAD_ARGS * @return One of: SUCCESS, BAD_CREDENTIALS, NO_SUCH_USER, BAD_ARGS
* @throws SQLException if database error
*/ */
@Override @Override
public int authenticate(Context context, String username, String password, public int authenticate(Context context, String username, String password,

View File

@@ -128,13 +128,11 @@ public interface AuthenticationService {
* Invokes <code>canSelfRegister()</code> of every authentication * Invokes <code>canSelfRegister()</code> of every authentication
* method in the stack, and returns true if any of them is true. * method in the stack, and returns true if any of them is true.
* *
* @param context * @param context DSpace context
* DSpace context * @param request HTTP request, in case it's needed. Can be null.
* @param request * @param username Username, if available. Can be null.
* 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. * @return true if new ePerson should be created.
* @throws SQLException if database error
*/ */
public boolean canSelfRegister(Context context, public boolean canSelfRegister(Context context,
HttpServletRequest request, HttpServletRequest request,
@@ -145,13 +143,11 @@ public interface AuthenticationService {
* Returns true if the <code>allowSetPassword()</code> method of any * Returns true if the <code>allowSetPassword()</code> method of any
* member of the stack returns true. * member of the stack returns true.
* *
* @param context * @param context DSpace context
* DSpace context * @param request HTTP request, in case it's needed. Can be null.
* @param request * @param username Username, if available. Can be null.
* 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. * @return true if this method allows user to change ePerson password.
* @throws SQLException if database error
*/ */
public boolean allowSetPassword(Context context, public boolean allowSetPassword(Context context,
HttpServletRequest request, HttpServletRequest request,
@@ -168,15 +164,14 @@ public interface AuthenticationService {
* Returns accumulation of groups of all the <code>getSpecialGroups()</code> * Returns accumulation of groups of all the <code>getSpecialGroups()</code>
* methods in the stack. * methods in the stack.
* *
* @param context * @param context A valid DSpace context.
* A valid DSpace context.
* *
* @param request * @param request The request that started this operation, or null if not applicable.
* The request that started this operation, or null if not applicable.
* *
* @return Returns IDs of any groups the user authenticated by this * @return Returns IDs of any groups the user authenticated by this
* request is in implicitly -- checks for e.g. network-address dependent * request is in implicitly -- checks for e.g. network-address dependent
* groups. * groups.
* @throws SQLException if database error
*/ */
public List<Group> getSpecialGroups(Context context, public List<Group> getSpecialGroups(Context context,
HttpServletRequest request) throws SQLException; HttpServletRequest request) throws SQLException;

View File

@@ -131,6 +131,7 @@ public class AuthoritySolrServiceImpl implements AuthorityIndexingService, Autho
/** /**
* Retrieves all the metadata fields which are indexed in the authority control * Retrieves all the metadata fields which are indexed in the authority control
* @return a list of metadata fields * @return a list of metadata fields
* @throws Exception if error
*/ */
@Override @Override
public List<String> getAllIndexedMetadataFields() throws Exception { public List<String> getAllIndexedMetadataFields() throws Exception {

View File

@@ -148,6 +148,7 @@ public class AuthorityValue {
/** /**
* Generate a solr record from this instance * Generate a solr record from this instance
* @return SolrInputDocument
*/ */
public SolrInputDocument getSolrInputDocument() { public SolrInputDocument getSolrInputDocument() {
@@ -164,6 +165,7 @@ public class AuthorityValue {
/** /**
* Initialize this instance based on a solr record * Initialize this instance based on a solr record
* @param document SolrDocument
*/ */
public void setValues(SolrDocument document) { public void setValues(SolrDocument document) {
this.id = String.valueOf(document.getFieldValue("id")); this.id = String.valueOf(document.getFieldValue("id"));
@@ -176,6 +178,11 @@ public class AuthorityValue {
/** /**
* Replace an item's DCValue with this authority * 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 { public void updateItem(Context context, Item currentItem, MetadataValue value) throws SQLException, AuthorizeException {
value.setValue(getValue()); value.setValue(getValue());
@@ -185,6 +192,7 @@ public class AuthorityValue {
/** /**
* Information that can be used the choice ui * Information that can be used the choice ui
* @return map
*/ */
public Map<String, String> choiceSelectMap() { public Map<String, String> choiceSelectMap() {
return new HashMap<String, String>(); return new HashMap<String, String>();
@@ -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). * 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. * See the implementation of com.atmire.org.dspace.authority.AuthorityValueGenerator#generateRaw(java.lang.String, java.lang.String) for more precisions.
* @return
*/ */
public String generateString() { public String generateString() {
return AuthorityValueServiceImpl.GENERATE; return AuthorityValueServiceImpl.GENERATE;
@@ -249,6 +258,8 @@ public class AuthorityValue {
/** /**
* Makes an instance of the AuthorityValue with the given information. * Makes an instance of the AuthorityValue with the given information.
* @param info string info
* @return AuthorityValue
*/ */
public AuthorityValue newInstance(String info) { public AuthorityValue newInstance(String info) {
return new AuthorityValue(); return new AuthorityValue();
@@ -262,6 +273,8 @@ public class AuthorityValue {
* The regular equals() only checks if both AuthorityValues describe the same authority. * The regular equals() only checks if both AuthorityValues describe the same authority.
* This method checks if the AuthorityValues have different information * This method checks if the AuthorityValues have different information
* E.g. it is used to decide when lastModified should be updated. * E.g. it is used to decide when lastModified should be updated.
* @param o object
* @return true or false
*/ */
public boolean hasTheSameInformationAs(Object o) { public boolean hasTheSameInformationAs(Object o) {
if (this == o) { if (this == o) {

View File

@@ -113,6 +113,9 @@ public class AuthorityValueServiceImpl implements AuthorityValueService{
/** /**
* Item.ANY does not work here. * Item.ANY does not work here.
* @param context Context
* @param authorityID authority id
* @return AuthorityValue
*/ */
@Override @Override
public AuthorityValue findByUID(Context context, String authorityID) { public AuthorityValue findByUID(Context context, String authorityID) {

View File

@@ -169,6 +169,8 @@ public class DSpaceAuthorityIndexer implements AuthorityIndexerInterface, Initia
* *
* @param metadataField Is one of the fields defined in dspace.cfg to be indexed. * @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. * @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 { protected void prepareNextValue(String metadataField, MetadataValue value) throws SQLException, AuthorizeException {

View File

@@ -119,6 +119,8 @@ public class OrcidAuthorityValue extends PersonAuthorityValue {
/** /**
* Create an authority based on a given orcid bio * Create an authority based on a given orcid bio
* @param bio Bio
* @return OrcidAuthorityValue
*/ */
public static OrcidAuthorityValue create(Bio bio) { public static OrcidAuthorityValue create(Bio bio) {
OrcidAuthorityValue authority = OrcidAuthorityValue.create(); OrcidAuthorityValue authority = OrcidAuthorityValue.create();

View File

@@ -16,6 +16,7 @@ import org.w3c.dom.Document;
* @author Kevin Van de Velde (kevin at atmire dot com) * @author Kevin Van de Velde (kevin at atmire dot com)
* @author Ben Bosman (ben at atmire dot com) * @author Ben Bosman (ben at atmire dot com)
* @author Mark Diggory (markd at atmire dot com) * @author Mark Diggory (markd at atmire dot com)
* @param <T> type
*/ */
public abstract class Converter<T> { public abstract class Converter<T> {

View File

@@ -41,8 +41,10 @@ public class XMLUtils {
/** /**
* @param xml The starting context (a Node or a Document, for example). * @param xml The starting context (a Node or a Document, for example).
* @param singleNodeXPath xpath
* @return node.getTextContent() on the node that matches singleNodeXPath * @return node.getTextContent() on the node that matches singleNodeXPath
* null if nothing matches the NodeListXPath * null if nothing matches the NodeListXPath
* @throws XPathExpressionException if xpath error
*/ */
public static String getTextContent(Node xml, String singleNodeXPath) throws XPathExpressionException { public static String getTextContent(Node xml, String singleNodeXPath) throws XPathExpressionException {
String text = null; String text = null;
@@ -56,8 +58,10 @@ public class XMLUtils {
/** /**
* @param xml The starting context (a Node or a Document, for example). * @param xml The starting context (a Node or a Document, for example).
* @param NodeListXPath xpath
* @return A Node matches the NodeListXPath * @return A Node matches the NodeListXPath
* null if nothing matches the NodeListXPath * null if nothing matches the NodeListXPath
* @throws XPathExpressionException if xpath error
*/ */
public static Node getNode(Node xml, String NodeListXPath) throws XPathExpressionException { public static Node getNode(Node xml, String NodeListXPath) throws XPathExpressionException {
Node result = null; Node result = null;
@@ -71,8 +75,10 @@ public class XMLUtils {
/** /**
* @param xml The starting context (a Node or a Document, for example). * @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 * @return A NodeList containing the nodes that match the NodeListXPath
* null if nothing matches the NodeListXPath * null if nothing matches the NodeListXPath
* @throws XPathExpressionException if xpath error
*/ */
public static NodeList getNodeList(Node xml, String NodeListXPath) throws XPathExpressionException { public static NodeList getNodeList(Node xml, String NodeListXPath) throws XPathExpressionException {
NodeList nodeList = null; NodeList nodeList = null;
@@ -93,6 +99,8 @@ public class XMLUtils {
* that are element nodes: * that are element nodes:
* node.getNodeType() == Node.ELEMENT_NODE * node.getNodeType() == Node.ELEMENT_NODE
* node instanceof Element * node instanceof Element
* @param nodeList NodeList
* @return iterator over nodes
*/ */
public static Iterator<Node> getNodeListIterator(final NodeList nodeList) { public static Iterator<Node> getNodeListIterator(final NodeList nodeList) {
return new Iterator<Node>() { return new Iterator<Node>() {

View File

@@ -174,6 +174,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to create new, not strictly community * Are community admins allowed to create new, not strictly community
* related, group? * related, group?
* @return true/false
*/ */
public static boolean canCommunityAdminPerformGroupCreation() public static boolean canCommunityAdminPerformGroupCreation()
{ {
@@ -182,6 +183,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to create collections or subcommunities? * Are community admins allowed to create collections or subcommunities?
* @return true/false
*/ */
public static boolean canCommunityAdminPerformSubelementCreation() public static boolean canCommunityAdminPerformSubelementCreation()
{ {
@@ -190,6 +192,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to remove collections or subcommunities? * Are community admins allowed to remove collections or subcommunities?
* @return true/false
*/ */
public static boolean canCommunityAdminPerformSubelementDeletion() public static boolean canCommunityAdminPerformSubelementDeletion()
{ {
@@ -199,6 +202,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to manage the community's and * Are community admins allowed to manage the community's and
* subcommunities' policies? * subcommunities' policies?
* @return true/false
*/ */
public static boolean canCommunityAdminManagePolicies() public static boolean canCommunityAdminManagePolicies()
{ {
@@ -208,6 +212,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to create/edit them community's and * Are community admins allowed to create/edit them community's and
* subcommunities' admin groups? * subcommunities' admin groups?
* @return true/false
*/ */
public static boolean canCommunityAdminManageAdminGroup() public static boolean canCommunityAdminManageAdminGroup()
{ {
@@ -217,6 +222,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to create/edit the community's and * Are community admins allowed to create/edit the community's and
* subcommunities' admin group? * subcommunities' admin group?
* @return true/false
*/ */
public static boolean canCommunityAdminManageCollectionPolicies() public static boolean canCommunityAdminManageCollectionPolicies()
{ {
@@ -226,6 +232,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to manage the item template of them * Are community admins allowed to manage the item template of them
* collections? * collections?
* @return true/false
*/ */
public static boolean canCommunityAdminManageCollectionTemplateItem() public static boolean canCommunityAdminManageCollectionTemplateItem()
{ {
@@ -235,6 +242,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to manage (create/edit/remove) the * Are community admins allowed to manage (create/edit/remove) the
* submitters group of them collections? * submitters group of them collections?
* @return true/false
*/ */
public static boolean canCommunityAdminManageCollectionSubmitters() public static boolean canCommunityAdminManageCollectionSubmitters()
{ {
@@ -244,6 +252,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to manage (create/edit/remove) the workflows * Are community admins allowed to manage (create/edit/remove) the workflows
* group of them collections? * group of them collections?
* @return true/false
*/ */
public static boolean canCommunityAdminManageCollectionWorkflows() public static boolean canCommunityAdminManageCollectionWorkflows()
{ {
@@ -253,6 +262,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to manage (create/edit/remove) the admin * Are community admins allowed to manage (create/edit/remove) the admin
* group of them collections? * group of them collections?
* @return true/false
*/ */
public static boolean canCommunityAdminManageCollectionAdminGroup() public static boolean canCommunityAdminManageCollectionAdminGroup()
{ {
@@ -261,6 +271,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to remove an item from them collections? * Are community admins allowed to remove an item from them collections?
* @return true/false
*/ */
public static boolean canCommunityAdminPerformItemDeletion() public static boolean canCommunityAdminPerformItemDeletion()
{ {
@@ -269,6 +280,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to withdrawn an item from them collections? * Are community admins allowed to withdrawn an item from them collections?
* @return true/false
*/ */
public static boolean canCommunityAdminPerformItemWithdrawn() public static boolean canCommunityAdminPerformItemWithdrawn()
{ {
@@ -278,6 +290,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to reinstate an item from them * Are community admins allowed to reinstate an item from them
* collections? * collections?
* @return true/false
*/ */
public static boolean canCommunityAdminPerformItemReinstatiate() public static boolean canCommunityAdminPerformItemReinstatiate()
{ {
@@ -287,6 +300,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to manage the policies of an item owned by * Are community admins allowed to manage the policies of an item owned by
* one of them collections? * one of them collections?
* @return true/false
*/ */
public static boolean canCommunityAdminManageItemPolicies() 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 * Are community admins allowed to add a bitstream to an item owned by one
* of them collections? * of them collections?
* @return true/false
*/ */
public static boolean canCommunityAdminPerformBitstreamCreation() public static boolean canCommunityAdminPerformBitstreamCreation()
{ {
@@ -305,6 +320,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to remove a bitstream from an item owned by * Are community admins allowed to remove a bitstream from an item owned by
* one of them collections? * one of them collections?
* @return true/false
*/ */
public static boolean canCommunityAdminPerformBitstreamDeletion() public static boolean canCommunityAdminPerformBitstreamDeletion()
{ {
@@ -314,6 +330,7 @@ public class AuthorizeConfiguration
/** /**
* Are community admins allowed to perform CC License replace or addition to * Are community admins allowed to perform CC License replace or addition to
* an item owned by one of them collections? * an item owned by one of them collections?
* @return true/false
*/ */
public static boolean canCommunityAdminManageCCLicense() public static boolean canCommunityAdminManageCCLicense()
{ {
@@ -322,6 +339,7 @@ public class AuthorizeConfiguration
/** /**
* Are collection admins allowed to manage the collection's policies? * Are collection admins allowed to manage the collection's policies?
* @return true/false
*/ */
public static boolean canCollectionAdminManagePolicies() public static boolean canCollectionAdminManagePolicies()
{ {
@@ -331,6 +349,7 @@ public class AuthorizeConfiguration
/** /**
* Are collection admins allowed to manage (create/edit/delete) the * Are collection admins allowed to manage (create/edit/delete) the
* collection's item template? * collection's item template?
* @return true/false
*/ */
public static boolean canCollectionAdminManageTemplateItem() public static boolean canCollectionAdminManageTemplateItem()
{ {
@@ -340,6 +359,7 @@ public class AuthorizeConfiguration
/** /**
* Are collection admins allowed to manage (create/edit/delete) the * Are collection admins allowed to manage (create/edit/delete) the
* collection's submitters group? * collection's submitters group?
* @return true/false
*/ */
public static boolean canCollectionAdminManageSubmitters() public static boolean canCollectionAdminManageSubmitters()
{ {
@@ -349,6 +369,7 @@ public class AuthorizeConfiguration
/** /**
* Are collection admins allowed to manage (create/edit/delete) the * Are collection admins allowed to manage (create/edit/delete) the
* collection's workflows group? * collection's workflows group?
* @return true/false
*/ */
public static boolean canCollectionAdminManageWorkflows() public static boolean canCollectionAdminManageWorkflows()
{ {
@@ -358,6 +379,7 @@ public class AuthorizeConfiguration
/** /**
* Are collection admins allowed to manage (create/edit) the collection's * Are collection admins allowed to manage (create/edit) the collection's
* admins group? * admins group?
* @return true/false
*/ */
public static boolean canCollectionAdminManageAdminGroup() public static boolean canCollectionAdminManageAdminGroup()
{ {
@@ -366,6 +388,7 @@ public class AuthorizeConfiguration
/** /**
* Are collection admins allowed to remove an item from the collection? * Are collection admins allowed to remove an item from the collection?
* @return true/false
*/ */
public static boolean canCollectionAdminPerformItemDeletion() public static boolean canCollectionAdminPerformItemDeletion()
{ {
@@ -374,6 +397,7 @@ public class AuthorizeConfiguration
/** /**
* Are collection admins allowed to withdrawn an item from the collection? * Are collection admins allowed to withdrawn an item from the collection?
* @return true/false
*/ */
public static boolean canCollectionAdminPerformItemWithdrawn() public static boolean canCollectionAdminPerformItemWithdrawn()
{ {
@@ -383,6 +407,7 @@ public class AuthorizeConfiguration
/** /**
* Are collection admins allowed to reinstate an item from the * Are collection admins allowed to reinstate an item from the
* collection? * collection?
* @return true/false
*/ */
public static boolean canCollectionAdminPerformItemReinstatiate() public static boolean canCollectionAdminPerformItemReinstatiate()
{ {
@@ -392,6 +417,7 @@ public class AuthorizeConfiguration
/** /**
* Are collection admins allowed to manage the policies of item owned by the * Are collection admins allowed to manage the policies of item owned by the
* collection? * collection?
* @return true/false
*/ */
public static boolean canCollectionAdminManageItemPolicies() 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 * Are collection admins allowed to add a bitstream to an item owned by the
* collections? * collections?
* @return true/false
*/ */
public static boolean canCollectionAdminPerformBitstreamCreation() public static boolean canCollectionAdminPerformBitstreamCreation()
{ {
@@ -410,6 +437,7 @@ public class AuthorizeConfiguration
/** /**
* Are collection admins allowed to remove a bitstream from an item owned by * Are collection admins allowed to remove a bitstream from an item owned by
* the collections? * the collections?
* @return true/false
*/ */
public static boolean canCollectionAdminPerformBitstreamDeletion() public static boolean canCollectionAdminPerformBitstreamDeletion()
{ {
@@ -419,6 +447,7 @@ public class AuthorizeConfiguration
/** /**
* Are collection admins allowed to replace or adding a CC License to an * Are collection admins allowed to replace or adding a CC License to an
* item owned by the collections? * item owned by the collections?
* @return true/false
*/ */
public static boolean canCollectionAdminManageCCLicense() public static boolean canCollectionAdminManageCCLicense()
{ {
@@ -427,6 +456,7 @@ public class AuthorizeConfiguration
/** /**
* Are item admins allowed to manage the item's policies? * Are item admins allowed to manage the item's policies?
* @return true/false
*/ */
public static boolean canItemAdminManagePolicies() public static boolean canItemAdminManagePolicies()
{ {
@@ -435,6 +465,7 @@ public class AuthorizeConfiguration
/** /**
* Are item admins allowed to add bitstreams to the item? * Are item admins allowed to add bitstreams to the item?
* @return true/false
*/ */
public static boolean canItemAdminPerformBitstreamCreation() public static boolean canItemAdminPerformBitstreamCreation()
{ {
@@ -443,6 +474,7 @@ public class AuthorizeConfiguration
/** /**
* Are item admins allowed to remove bitstreams from the item? * Are item admins allowed to remove bitstreams from the item?
* @return true/false
*/ */
public static boolean canItemAdminPerformBitstreamDeletion() public static boolean canItemAdminPerformBitstreamDeletion()
{ {
@@ -451,6 +483,7 @@ public class AuthorizeConfiguration
/** /**
* Are item admins allowed to replace or adding CC License to the item? * Are item admins allowed to replace or adding CC License to the item?
* @return true/false
*/ */
public static boolean canItemAdminManageCCLicense() public static boolean canItemAdminManageCCLicense()
{ {

View File

@@ -59,6 +59,8 @@ public class AuthorizeException extends Exception
* *
* @param message * @param message
* the message * the message
* @param o object
* @param a actionID
*/ */
public AuthorizeException(String message, DSpaceObject o, int a) public AuthorizeException(String message, DSpaceObject o, int a)
{ {

View File

@@ -34,6 +34,8 @@ public class FixDefaultPolicies
{ {
/** /**
* Command line interface to setPolicies - run to see arguments * Command line interface to setPolicies - run to see arguments
* @param argv arguments
* @throws Exception if error
*/ */
public static void main(String[] argv) throws Exception public static void main(String[] argv) throws Exception
{ {

View File

@@ -43,6 +43,8 @@ public class PolicySet
/** /**
* Command line interface to setPolicies - run to see arguments * Command line interface to setPolicies - run to see arguments
* @param argv arguments
* @throws Exception if error
*/ */
public static void main(String[] argv) throws Exception public static void main(String[] argv) throws Exception
{ {

View File

@@ -203,6 +203,7 @@ public class ResourcePolicy{
/** /**
* assign an EPerson to this policy * assign an EPerson to this policy
* @param eperson Eperson
*/ */
public void setEPerson(EPerson eperson) public void setEPerson(EPerson eperson)
{ {
@@ -221,6 +222,7 @@ public class ResourcePolicy{
/** /**
* sets ID for Group referred to by this policy * sets ID for Group referred to by this policy
* @param epersonGroup Group
*/ */
public void setGroup(Group epersonGroup) public void setGroup(Group epersonGroup)
{ {

View File

@@ -55,6 +55,7 @@ public class ResourcePolicyServiceImpl implements ResourcePolicyService
* ID of the ResourcePolicy * ID of the ResourcePolicy
* *
* @return the ResourcePolicy format, or null if the ID is invalid. * @return the ResourcePolicy format, or null if the ID is invalid.
* @throws SQLException if database error
*/ */
@Override @Override
public ResourcePolicy find(Context context, int id) throws SQLException public ResourcePolicy find(Context context, int id) throws SQLException
@@ -67,6 +68,8 @@ public class ResourcePolicyServiceImpl implements ResourcePolicyService
* *
* @param context * @param context
* DSpace context object * DSpace context object
* @return ResourcePolicy
* @throws SQLException if database error
*/ */
@Override @Override
public ResourcePolicy create(Context context) throws SQLException public ResourcePolicy create(Context context) throws SQLException
@@ -109,6 +112,10 @@ public class ResourcePolicyServiceImpl implements ResourcePolicyService
/** /**
* Delete an ResourcePolicy * Delete an ResourcePolicy
* *
* @param context context
* @param resourcePolicy resource policy
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
*/ */
@Override @Override
public void delete(Context context, ResourcePolicy resourcePolicy) throws SQLException, AuthorizeException { public void delete(Context context, ResourcePolicy resourcePolicy) throws SQLException, AuthorizeException {
@@ -125,6 +132,7 @@ public class ResourcePolicyServiceImpl implements ResourcePolicyService
/** /**
* @param resourcePolicy resource policy
* @return action text or 'null' if action row empty * @return action text or 'null' if action row empty
*/ */
@Override @Override
@@ -144,6 +152,7 @@ public class ResourcePolicyServiceImpl implements ResourcePolicyService
/** /**
* figures out if the date is valid for the policy * 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 * @return true if policy has begun and hasn't expired yet (or no dates are
* set) * set)
*/ */
@@ -253,6 +262,10 @@ public class ResourcePolicyServiceImpl implements ResourcePolicyService
/** /**
* Update the ResourcePolicy * Update the ResourcePolicy
* @param context context
* @param resourcePolicy resource policy
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
*/ */
@Override @Override
public void update(Context context, ResourcePolicy resourcePolicy) throws SQLException, AuthorizeException { public void update(Context context, ResourcePolicy resourcePolicy) throws SQLException, AuthorizeException {

View File

@@ -41,16 +41,13 @@ public interface AuthorizeService {
* perform all of the specified actions on the given object. An * perform all of the specified actions on the given object. An
* <code>AuthorizeException</code> if all the authorizations fail. * <code>AuthorizeException</code> if all the authorizations fail.
* *
* @param c * @param c context with the current user
* context with the current user * @param o DSpace object user is attempting to perform action on
* @param o * @param actions array of action IDs from
* DSpace object user is attempting to perform action on
* @param actions
* array of action IDs from
* <code>org.dspace.core.Constants</code> * <code>org.dspace.core.Constants</code>
* @throws AuthorizeException if authorization error * @throws AuthorizeException if any one of the specified actions cannot be
* if any one of the specified actions cannot be performed by * performed by the current user on the given object.
* the current user on the given object. * @throws SQLException if database error
*/ */
public void authorizeAnyOf(Context c, DSpaceObject o, int[] actions) throws AuthorizeException, SQLException; 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, * the given object. Throws an exception if the user is not authorized,
* otherwise the method call does nothing. * otherwise the method call does nothing.
* *
* @param c * @param c context
* context * @param o a DSpaceObject
* @param o * @param action action to perform from <code>org.dspace.core.Constants</code>
* a DSpaceObject * @throws AuthorizeException if the user is denied
* @param action * @throws SQLException if database error
* action to perform from <code>org.dspace.core.Constants</code>
* @throws AuthorizeException if authorization error
* if the user is denied
*/ */
public void authorizeAction(Context c, DSpaceObject o, int action) throws AuthorizeException, SQLException; 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, * the given object. Throws an exception if the user is not authorized,
* otherwise the method call does nothing. * otherwise the method call does nothing.
* *
* @param c * @param c context
* context * @param o a DSpaceObject
* @param o
* a DSpaceObject
* @param useInheritance * @param useInheritance
* flag to say if ADMIN action on the current object or parent * flag to say if ADMIN action on the current object or parent
* object can be used * object can be used
* @param action * @param action action to perform from <code>org.dspace.core.Constants</code>
* action to perform from <code>org.dspace.core.Constants</code> * @throws AuthorizeException if the user is denied
* @throws AuthorizeException if authorization error * @throws SQLException if database error
* if the user is denied
*/ */
public void authorizeAction(Context c, DSpaceObject o, int action, boolean useInheritance) public void authorizeAction(Context c, DSpaceObject o, int action, boolean useInheritance)
throws AuthorizeException, SQLException; throws AuthorizeException, SQLException;
@@ -95,19 +86,15 @@ public interface AuthorizeService {
* the given object. Throws an exception if the user is not authorized, * the given object. Throws an exception if the user is not authorized,
* otherwise the method call does nothing. * otherwise the method call does nothing.
* *
* @param c * @param c context
* context * @param e the eperson to use for the authorization check
* @param e * @param o a DSpaceObject
* the eperson to use for the authorization check
* @param o
* a DSpaceObject
* @param useInheritance * @param useInheritance
* flag to say if ADMIN action on the current object or parent * flag to say if ADMIN action on the current object or parent
* object can be used * object can be used
* @param action * @param action action to perform from <code>org.dspace.core.Constants</code>
* action to perform from <code>org.dspace.core.Constants</code> * @throws AuthorizeException if the user is denied
* @throws AuthorizeException if authorization error * @throws SQLException if database error
* if the user is denied
*/ */
public void authorizeAction(Context c, EPerson e, DSpaceObject o, int action, boolean useInheritance) public void authorizeAction(Context c, EPerson e, DSpaceObject o, int action, boolean useInheritance)
throws AuthorizeException, SQLException; throws AuthorizeException, SQLException;
@@ -116,15 +103,13 @@ public interface AuthorizeService {
* same authorize, returns boolean for those who don't want to deal with * same authorize, returns boolean for those who don't want to deal with
* catching exceptions. * catching exceptions.
* *
* @param c * @param c DSpace context, containing current user
* DSpace context, containing current user * @param o DSpaceObject
* @param o * @param a action being attempted, from
* DSpaceObject
* @param a
* action being attempted, from
* <code>org.dspace.core.Constants</code> * <code>org.dspace.core.Constants</code>
* @return <code>true</code> if the current user in the context is * @return <code>true</code> if the current user in the context is
* authorized to perform the given action on the given object * 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; 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 * same authorize, returns boolean for those who don't want to deal with
* catching exceptions. * catching exceptions.
* *
* @param c * @param c DSpace context, containing current user
* DSpace context, containing current user * @param o DSpaceObject
* @param o * @param a action being attempted, from
* DSpaceObject
* @param a
* action being attempted, from
* <code>org.dspace.core.Constants</code> * <code>org.dspace.core.Constants</code>
* @param useInheritance * @param useInheritance
* flag to say if ADMIN action on the current object or parent * flag to say if ADMIN action on the current object or parent
* object can be used * object can be used
* @return <code>true</code> if the current user in the context is * @return <code>true</code> if the current user in the context is
* authorized to perform the given action on the given object * 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; 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 * same authorize with a specif eperson (not the current user), returns boolean for those who don't want to deal with
* catching exceptions. * catching exceptions.
* *
* @param c * @param c DSpace context
* DSpace context * @param e EPerson to use in the check
* @param e * @param o DSpaceObject
* EPerson to use in the check * @param a action being attempted, from
* @param o
* DSpaceObject
* @param a
* action being attempted, from
* <code>org.dspace.core.Constants</code> * <code>org.dspace.core.Constants</code>
* @param useInheritance * @param useInheritance
* flag to say if ADMIN action on the current object or parent * flag to say if ADMIN action on the current object or parent
* object can be used * object can be used
* @return <code>true</code> if the requested user is * @return <code>true</code> if the requested user is
* authorized to perform the given action on the given object * 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; 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 <code>true</code> if the user is a System * within DSpace. Always return <code>true</code> if the user is a System
* Admin * Admin
* *
* @param c * @param c current context
* current context * @param o current DSpace Object, if <code>null</code> the call will be
* @param o
* current DSpace Object, if <code>null</code> the call will be
* equivalent to a call to the <code>isAdmin(Context c)</code> * equivalent to a call to the <code>isAdmin(Context c)</code>
* method * method
* @return <code>true</code> if user has administrative privileges on the * @return <code>true</code> if user has administrative privileges on the
* given DSpace object * given DSpace object
* @throws SQLException if database error
*/ */
public boolean isAdmin(Context c, DSpaceObject o) throws SQLException; public boolean isAdmin(Context c, DSpaceObject o) throws SQLException;
@@ -194,10 +173,10 @@ public interface AuthorizeService {
* <code>true</code> if c.ignoreAuthorization is set. Anonymous users * <code>true</code> if c.ignoreAuthorization is set. Anonymous users
* can't be Admins (EPerson set to NULL) * can't be Admins (EPerson set to NULL)
* *
* @param c * @param c current context
* current context
* @return <code>true</code> if user is an admin or ignore authorization * @return <code>true</code> if user is an admin or ignore authorization
* flag set * flag set
* @throws SQLException if database error
*/ */
public boolean isAdmin(Context c) throws SQLException; public boolean isAdmin(Context c) throws SQLException;
@@ -208,16 +187,12 @@ public interface AuthorizeService {
/** /**
* Add a policy for an individual eperson * Add a policy for an individual eperson
* *
* @param c * @param c context. Current user irrelevant
* context. Current user irrelevant * @param o DSpaceObject to add policy to
* @param o * @param actionID ID of action from <code>org.dspace.core.Constants</code>
* DSpaceObject to add policy to * @param e eperson who can perform the action
* @param actionID * @throws SQLException if database error
* ID of action from <code>org.dspace.core.Constants</code> * @throws AuthorizeException if current user in context is not authorized to add policies
* @param e
* eperson who can perform the action
* @throws AuthorizeException if authorization error
* 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; public void addPolicy(Context c, DSpaceObject o, int actionID, EPerson e) throws SQLException, AuthorizeException;
@@ -225,147 +200,112 @@ public interface AuthorizeService {
/** /**
* Add a policy for an individual eperson * Add a policy for an individual eperson
* *
* @param c * @param c context. Current user irrelevant
* context. Current user irrelevant * @param o DSpaceObject to add policy to
* @param o * @param actionID ID of action from <code>org.dspace.core.Constants</code>
* DSpaceObject to add policy to * @param e eperson who can perform the action
* @param actionID * @param type policy type, deafult types are declared in the ResourcePolicy class
* ID of action from <code>org.dspace.core.Constants</code> * @throws SQLException if database error
* @param e * @throws AuthorizeException if current user in context is not authorized to add policies
* eperson who can perform the action
* @param type
* policy type, deafult types are declared in the ResourcePolicy class
* @throws AuthorizeException if authorization error
* 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; public void addPolicy(Context c, DSpaceObject o, int actionID, EPerson e, String type) throws SQLException, AuthorizeException;
/** /**
* Add a policy for a group * Add a policy for a group
* *
* @param c * @param c current context
* current context * @param o object to add policy for
* @param o * @param actionID ID of action from <code>org.dspace.core.Constants</code>
* object to add policy for * @param g group to add policy for
* @param actionID * @throws SQLException if there's a database problem
* ID of action from <code>org.dspace.core.Constants</code> * @throws AuthorizeException if the current user is not authorized to add this policy
* @param g
* group to add policy for
* @throws SQLException if database error
* if there's a database problem
* @throws AuthorizeException if authorization error
* 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; public void addPolicy(Context c, DSpaceObject o, int actionID, Group g) throws SQLException, AuthorizeException;
/** /**
* Add a policy for a group * Add a policy for a group
* *
* @param c * @param c current context
* current context * @param o object to add policy for
* @param o * @param actionID ID of action from <code>org.dspace.core.Constants</code>
* object to add policy for * @param g group to add policy for
* @param actionID * @param type policy type, deafult types are declared in the ResourcePolicy class
* ID of action from <code>org.dspace.core.Constants</code> * @throws SQLException if there's a database problem
* @param g * @throws AuthorizeException if the current user is not authorized to add this policy
* group to add policy for
* @param type
* policy type, deafult types are declared in the ResourcePolicy class
* @throws SQLException if database error
* if there's a database problem
* @throws AuthorizeException if authorization error
* 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; 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 * Return a List of the policies for an object
* *
* @param c * @param c current context
* current context * @param o object to retrieve policies for
* @param o
* object to retrieve policies for
* @return List of <code>ResourcePolicy</code> objects * @return List of <code>ResourcePolicy</code> objects
* @throws SQLException if database error
*/ */
public List<ResourcePolicy> getPolicies(Context c, DSpaceObject o) throws SQLException; public List<ResourcePolicy> getPolicies(Context c, DSpaceObject o) throws SQLException;
/** /**
* Return a List of the policies for an object * Return a List of the policies for an object
* *
* @param c * @param c current context
* current context * @param o object to retrieve policies for
* @param o * @param type type
* object to retrieve policies for
* @return List of <code>ResourcePolicy</code> objects * @return List of <code>ResourcePolicy</code> objects
* @throws SQLException if database error
*/ */
public List<ResourcePolicy> findPoliciesByDSOAndType(Context c, DSpaceObject o, String type) throws SQLException; public List<ResourcePolicy> findPoliciesByDSOAndType(Context c, DSpaceObject o, String type) throws SQLException;
/** /**
* Return a List of the policies for a group * Return a List of the policies for a group
* *
* @param c * @param c current context
* current context * @param g group to retrieve policies for
* @param g
* group to retrieve policies for
* @return List of <code>ResourcePolicy</code> objects * @return List of <code>ResourcePolicy</code> objects
* @@throws SQLException if database error
*/ */
public List<ResourcePolicy> getPoliciesForGroup(Context c, Group g) throws SQLException; public List<ResourcePolicy> getPoliciesForGroup(Context c, Group g) throws SQLException;
/** /**
* Return a list of policies for an object that match the action * Return a list of policies for an object that match the action
* *
* @param c * @param c context
* context * @param o DSpaceObject policies relate to
* @param o * @param actionID action (defined in class Constants)
* DSpaceObject policies relate to * @return list of resource policies
* @param actionID * @throws SQLException if there's a database problem
* action (defined in class Constants)
* @throws SQLException if database error
* if there's a database problem
*/ */
public List<ResourcePolicy> getPoliciesActionFilter(Context c, DSpaceObject o, int actionID) throws SQLException; public List<ResourcePolicy> getPoliciesActionFilter(Context c, DSpaceObject o, int actionID) throws SQLException;
/** /**
* Add policies to an object to match those from a previous object * Add policies to an object to match those from a previous object
* *
* @param c * @param c context
* context * @param src source of policies
* @param src * @param dest destination of inherited policies
* source of policies * @throws SQLException if there's a database problem
* @param dest * @throws AuthorizeException if the current user is not authorized to add these policies
* destination of inherited policies
* @throws SQLException if database error
* if there's a database problem
* @throws AuthorizeException if authorization error
* if the current user is not authorized to add these policies
*/ */
public void inheritPolicies(Context c, DSpaceObject src, DSpaceObject dest) throws SQLException, AuthorizeException; public void inheritPolicies(Context c, DSpaceObject src, DSpaceObject dest) throws SQLException, AuthorizeException;
/** /**
* Copies policies from a list of resource policies to a given DSpaceObject * Copies policies from a list of resource policies to a given DSpaceObject
* *
* @param c * @param c DSpace context
* DSpace context * @param policies List of ResourcePolicy objects
* @param policies * @param dest object to have policies added
* List of ResourcePolicy objects * @throws SQLException if there's a database problem
* @param dest * @throws AuthorizeException if the current user is not authorized to add these policies
* object to have policies added
* @throws SQLException if database error
* if there's a database problem
* @throws AuthorizeException if authorization error
* if the current user is not authorized to add these policies
*/ */
public void addPolicies(Context c, List<ResourcePolicy> policies, DSpaceObject dest) throws SQLException, AuthorizeException; public void addPolicies(Context c, List<ResourcePolicy> policies, DSpaceObject dest) throws SQLException, AuthorizeException;
/** /**
* removes ALL policies for an object. FIXME doesn't check authorization * removes ALL policies for an object. FIXME doesn't check authorization
* *
* @param c * @param c DSpace context
* DSpace context * @param o object to remove policies for
* @param o * @throws SQLException if there's a database problem
* object to remove policies for * @throws AuthorizeException if authorization error
* @throws SQLException if database error
* if there's a database problem
*/ */
public void removeAllPolicies(Context c, DSpaceObject o) throws SQLException, AuthorizeException; public void removeAllPolicies(Context c, DSpaceObject o) throws SQLException, AuthorizeException;
@@ -374,26 +314,22 @@ public interface AuthorizeService {
/** /**
* removes ALL policies for an object that are not of the input type. * removes ALL policies for an object that are not of the input type.
* *
* @param c * @param c DSpace context
* DSpace context * @param o object to remove policies for
* @param o * @param type type
* object to remove policies for * @throws SQLException if there's a database problem
* @throws SQLException if database error * @throws AuthorizeException if authorization error
* if there's a database problem
*/ */
public void removeAllPoliciesByDSOAndTypeNotEqualsTo(Context c, DSpaceObject o, String type) throws SQLException, AuthorizeException; public void removeAllPoliciesByDSOAndTypeNotEqualsTo(Context c, DSpaceObject o, String type) throws SQLException, AuthorizeException;
/** /**
* removes policies * removes policies
* *
* @param c * @param c DSpace context
* DSpace context * @param o object to remove policies for
* @param o * @param type policy type
* object to remove policies for * @throws SQLException if there's a database problem
* @param type * @throws AuthorizeException if authorization error
* policy type
* @throws SQLException if database error
* if there's a database problem
*/ */
public void removeAllPoliciesByDSOAndType(Context c, DSpaceObject o, String type) throws SQLException, AuthorizeException; public void removeAllPoliciesByDSOAndType(Context c, DSpaceObject o, String type) throws SQLException, AuthorizeException;
@@ -401,15 +337,12 @@ public interface AuthorizeService {
* Remove all policies from an object that match a given action. FIXME * Remove all policies from an object that match a given action. FIXME
* doesn't check authorization * doesn't check authorization
* *
* @param context * @param context current context
* current context * @param dso object to remove policies from
* @param dso * @param actionID ID of action to match from
* object to remove policies from
* @param actionID
* ID of action to match from
* <code>org.dspace.core.Constants</code>, or -1=all * <code>org.dspace.core.Constants</code>, or -1=all
* @throws SQLException if database error * @throws SQLException if there's a database problem
* if there's a database problem * @throws AuthorizeException if authorization error
*/ */
public void removePoliciesActionFilter(Context context, DSpaceObject dso, int actionID) throws SQLException, AuthorizeException; public void removePoliciesActionFilter(Context context, DSpaceObject dso, int actionID) throws SQLException, AuthorizeException;
@@ -417,12 +350,9 @@ public interface AuthorizeService {
* Removes all policies relating to a particular group. FIXME doesn't check * Removes all policies relating to a particular group. FIXME doesn't check
* authorization * authorization
* *
* @param c * @param c current context
* current context * @param group the group
* @param group * @throws SQLException if there's a database problem
* the group
* @throws SQLException if database error
* if there's a database problem
*/ */
public void removeGroupPolicies(Context c, Group group) throws SQLException; public void removeGroupPolicies(Context c, Group group) throws SQLException;
@@ -430,14 +360,11 @@ public interface AuthorizeService {
* Removes all policies from a group for a particular object that belong to * Removes all policies from a group for a particular object that belong to
* a Group. FIXME doesn't check authorization * a Group. FIXME doesn't check authorization
* *
* @param c * @param c current context
* current context * @param o the object
* @param o * @param g the group
* the object * @throws SQLException if there's a database problem
* @param g * @throws AuthorizeException if authorization error
* the group
* @throws SQLException if database error
* if there's a database problem
*/ */
public void removeGroupPolicies(Context c, DSpaceObject o, Group g) throws SQLException, AuthorizeException; public void removeGroupPolicies(Context c, DSpaceObject o, Group g) throws SQLException, AuthorizeException;
@@ -445,14 +372,11 @@ public interface AuthorizeService {
* Removes all policies from an eperson for a particular object that belong to * Removes all policies from an eperson for a particular object that belong to
* an EPerson. FIXME doesn't check authorization * an EPerson. FIXME doesn't check authorization
* *
* @param c * @param c current context
* current context * @param o the object
* @param o * @param e the eperson
* the object * @throws SQLException if there's a database problem
* @param e * @throws AuthorizeException if authorization error
* the eperson
* @throws SQLException if database error
* if there's a database problem
*/ */
public void removeEPersonPolicies(Context c, DSpaceObject o, EPerson e) throws SQLException, AuthorizeException; public void removeEPersonPolicies(Context c, DSpaceObject o, EPerson e) throws SQLException, AuthorizeException;
@@ -460,16 +384,12 @@ public interface AuthorizeService {
* Returns all groups authorized to perform an action on an object. Returns * Returns all groups authorized to perform an action on an object. Returns
* empty array if no matches. * empty array if no matches.
* *
* @param c * @param c current context
* current context * @param o object
* @param o * @param actionID ID of action from <code>org.dspace.core.Constants</code>
* object
* @param actionID
* ID of action from <code>org.dspace.core.Constants</code>
* @return array of <code>Group</code>s that can perform the specified * @return array of <code>Group</code>s that can perform the specified
* action on the specified object * action on the specified object
* @throws SQLException if database error * @throws SQLException if there's a database problem
* if there's a database problem
*/ */
public List<Group> getAuthorizedGroups(Context c, DSpaceObject o, int actionID) throws java.sql.SQLException; public List<Group> getAuthorizedGroups(Context c, DSpaceObject o, int actionID) throws java.sql.SQLException;
@@ -479,17 +399,13 @@ public interface AuthorizeService {
/** /**
* Is a policy with the specified parameters already in place? * Is a policy with the specified parameters already in place?
* *
* @param c * @param c current context
* current context * @param o object
* @param o * @param group group
* object * @param actionID ID of action from <code>org.dspace.core.Constants</code>
* @param actionID * @param policyID ID of an existing policy. If -1 is specified, this parameter will be ignored
* ID of action from <code>org.dspace.core.Constants</code>
* @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 * @return true if such a policy exists, false otherwise
* @throws SQLException if database error * @throws SQLException if there's a database problem
* if there's a database problem
*/ */
public boolean isAnIdenticalPolicyAlreadyInPlace(Context c, DSpaceObject o, Group group, int actionID, int policyID) throws SQLException; public boolean isAnIdenticalPolicyAlreadyInPlace(Context c, DSpaceObject o, Group group, int actionID, int policyID) throws SQLException;
@@ -501,10 +417,10 @@ public interface AuthorizeService {
* have right on the collection. E.g., if the anonymous can access the collection policies are assigned to anonymous. * have right on the collection. E.g., if the anonymous can access the collection policies are assigned to anonymous.
* *
* @param context current context * @param context current context
* @param embargoDate * @param embargoDate date
* @param reason * @param reason reason
* @param dso * @param dso DSpaceObject
* @param owningCollection * @param owningCollection collection
* @throws SQLException if database error * @throws SQLException if database error
* @throws AuthorizeException if authorization error * @throws AuthorizeException if authorization error
*/ */

View File

@@ -575,6 +575,7 @@ public class BrowseInfo
/** /**
* True if this browse was cached. * True if this browse was cached.
* @return true/false
*/ */
public boolean wasCached() public boolean wasCached()
{ {
@@ -684,6 +685,7 @@ public class BrowseInfo
/** /**
* Utility method for obtaining a string representation of the browse. This is * Utility method for obtaining a string representation of the browse. This is
* useful only for debug * useful only for debug
* @return String representation
*/ */
public String toString() public String toString()
{ {

View File

@@ -184,6 +184,7 @@ public class BrowserScope
/** /**
* @param browseIndex The browseIndex to set. * @param browseIndex The browseIndex to set.
* @throws BrowseException if error
*/ */
public void setBrowseIndex(BrowseIndex browseIndex) public void setBrowseIndex(BrowseIndex browseIndex)
throws BrowseException throws BrowseException
@@ -370,6 +371,7 @@ public class BrowserScope
/** /**
* @param sortBy The sortBy to set. * @param sortBy The sortBy to set.
* @throws BrowseException if error
*/ */
public void setSortBy(int sortBy) public void setSortBy(int sortBy)
throws BrowseException throws BrowseException

View File

@@ -57,6 +57,7 @@ public class CrossLinks
* Is there a link for the given canonical form of metadata (i.e. schema.element.qualifier)? * 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 * @param metadata the metadata to check for a link on
* @return true/false
*/ */
public boolean hasLink(String metadata) public boolean hasLink(String metadata)
{ {
@@ -67,6 +68,7 @@ public class CrossLinks
* Get the type of link that the bit of metadata has. * Get the type of link that the bit of metadata has.
* *
* @param metadata the metadata to get the link type for * @param metadata the metadata to get the link type for
* @return type
*/ */
public String getLinkType(String metadata) public String getLinkType(String metadata)
{ {

View File

@@ -33,6 +33,7 @@ public interface ItemCountDAO
* Collection. Otherwise it will throw an exception. * Collection. Otherwise it will throw an exception.
* *
* @param dso Dspace Object * @param dso Dspace Object
* @return count
* @throws ItemCountException if count error * @throws ItemCountException if count error
*/ */
public int getCount(DSpaceObject dso) throws ItemCountException; public int getCount(DSpaceObject dso) throws ItemCountException;

View File

@@ -25,6 +25,7 @@ public class ItemCountDAOFactory
* for the specific DSpace instance. * for the specific DSpace instance.
* *
* @param context DSpace Context * @param context DSpace Context
* @return DAO
* @throws ItemCountException if count error * @throws ItemCountException if count error
*/ */
public static ItemCountDAO getInstance(Context context) public static ItemCountDAO getInstance(Context context)

View File

@@ -72,6 +72,7 @@ public class ItemCountDAOSolr implements ItemCountDAO
* Get the count of the items in the given container. * Get the count of the items in the given container.
* *
* @param dso Dspace Context * @param dso Dspace Context
* @return count
* @throws ItemCountException if count error * @throws ItemCountException if count error
*/ */
@Override @Override

View File

@@ -71,6 +71,7 @@ public class ItemCounter
* the number of items in the container in real time. * the number of items in the container in real time.
* *
* @param dso DSpaceObject * @param dso DSpaceObject
* @return count
* @throws ItemCountException when error occurs * @throws ItemCountException when error occurs
*/ */
public int getCount(DSpaceObject dso) public int getCount(DSpaceObject dso)

View File

@@ -98,6 +98,7 @@ public class ItemListConfig
* What metadata is to go in the given column number? * What metadata is to go in the given column number?
* *
* @param col column * @param col column
* @return array of metadata
*/ */
public String[] getMetadata(int col) public String[] getMetadata(int col)
{ {

View File

@@ -72,6 +72,9 @@ public class LocaleOrderingFilter implements TextFilter
/** /**
* We don't need to use the language parameter, so map this to * We don't need to use the language parameter, so map this to
* the standard sort string filter * the standard sort string filter
* @param str string
* @param lang language
* @return string
*/ */
@Override @Override
public String filter(String str, String lang) public String filter(String str, String lang)

View File

@@ -50,6 +50,7 @@ public interface BitstreamDispatcher
* *
* @return the next bitstream id, or BitstreamDispatcher.SENTINEL if there * @return the next bitstream id, or BitstreamDispatcher.SENTINEL if there
* isn't another value * isn't another value
* @throws SQLException if database error
* *
*/ */
public Bitstream next() throws SQLException; public Bitstream next() throws SQLException;

View File

@@ -73,6 +73,7 @@ public final class CheckerCommand
/** /**
* Default constructor uses DSpace plugin manager to construct dependencies. * Default constructor uses DSpace plugin manager to construct dependencies.
* @param context Context
*/ */
public CheckerCommand(Context context) public CheckerCommand(Context context)
{ {
@@ -94,6 +95,7 @@ public final class CheckerCommand
* N.B. a valid BitstreamDispatcher must be provided using * N.B. a valid BitstreamDispatcher must be provided using
* setBitstreamDispatcher before calling this method * setBitstreamDispatcher before calling this method
* </p> * </p>
* @throws SQLException if database error
*/ */
public void process() throws SQLException { public void process() throws SQLException {
LOG.debug("Begin Checker Processing"); LOG.debug("Begin Checker Processing");
@@ -136,6 +138,7 @@ public final class CheckerCommand
* the bitstream * the bitstream
* *
* @return the information about the bitstream and its checksum data * @return the information about the bitstream and its checksum data
* @throws SQLException if database error
*/ */
protected MostRecentChecksum checkBitstream(final Bitstream bitstream) throws SQLException { protected MostRecentChecksum checkBitstream(final Bitstream bitstream) throws SQLException {
// get bitstream info from bitstream table // get bitstream info from bitstream table
@@ -181,6 +184,7 @@ public final class CheckerCommand
* the second checksum * the second checksum
* *
* @return a result code (constants defined in Util) * @return a result code (constants defined in Util)
* @throws SQLException if database error
*/ */
protected ChecksumResult compareChecksums(String checksumA, String checksumB) throws SQLException { protected ChecksumResult compareChecksums(String checksumA, String checksumB) throws SQLException {
ChecksumResult result = getChecksumResultByCode(ChecksumResultCode.CHECKSUM_NO_MATCH); ChecksumResult result = getChecksumResultByCode(ChecksumResultCode.CHECKSUM_NO_MATCH);
@@ -205,6 +209,7 @@ public final class CheckerCommand
* *
* @param info * @param info
* a deleted bitstream. * a deleted bitstream.
* @throws SQLException if database error
*/ */
protected void processDeletedBitstream(MostRecentChecksum info) throws SQLException { protected void processDeletedBitstream(MostRecentChecksum info) throws SQLException {
info.setProcessStartDate(new Date()); info.setProcessStartDate(new Date());
@@ -223,6 +228,7 @@ public final class CheckerCommand
* @param info * @param info
* A not found BitStreamInfo * 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 { protected void processNullInfoBitstream(MostRecentChecksum info) throws SQLException {
info.setInfoFound(false); info.setInfoFound(false);
@@ -246,6 +252,7 @@ public final class CheckerCommand
* *
* @param info * @param info
* BitstreamInfo to handle * BitstreamInfo to handle
* @throws SQLException if database error
*/ */
protected void processBitstream(MostRecentChecksum info) throws SQLException { protected void processBitstream(MostRecentChecksum info) throws SQLException {
info.setProcessStartDate(new Date()); info.setProcessStartDate(new Date());

View File

@@ -33,6 +33,7 @@ public class CheckerConsumer implements Consumer
/** /**
* Initialize - allocate any resources required to operate. * Initialize - allocate any resources required to operate.
* Called at the start of ANY sequence of event consume() calls. * Called at the start of ANY sequence of event consume() calls.
* @throws Exception if error
*/ */
@Override @Override
public void initialize() throws Exception public void initialize() throws Exception
@@ -46,6 +47,7 @@ public class CheckerConsumer implements Consumer
* @param ctx the execution context object * @param ctx the execution context object
* *
* @param event the content event * @param event the content event
* @throws Exception if error
*/ */
@Override @Override
public void consume(Context ctx, Event event) throws Exception 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 * Signal that there are no more events queued in this
* event stream. * event stream.
* @param ctx Context
* @throws Exception if error
*/ */
@Override @Override
public void end(Context ctx) throws Exception public void end(Context ctx) throws Exception
@@ -73,6 +77,8 @@ public class CheckerConsumer implements Consumer
/** /**
* Finish - free any allocated resources. * Finish - free any allocated resources.
* Called when consumer is being released * Called when consumer is being released
* @param ctx Context
* @throws Exception if error
*/ */
@Override @Override
public void finish(Context ctx) throws Exception public void finish(Context ctx) throws Exception

View File

@@ -12,7 +12,6 @@ import org.dspace.content.Bitstream;
import javax.persistence.*; import javax.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.UUID;
/** /**
* <p> * <p>
@@ -169,6 +168,7 @@ public class ChecksumHistory
/** /**
* Return the processing result. * Return the processing result.
* @return result
*/ */
public ChecksumResult getResult() public ChecksumResult getResult()
{ {

View File

@@ -88,6 +88,7 @@ public class ChecksumHistoryServiceImpl implements ChecksumHistoryService {
/** /**
* Delete the history records from the database. * Delete the history records from the database.
* *
* @param context Context
* @param retentionDate * @param retentionDate
* any records older than this data are deleted. * any records older than this data are deleted.
* @param checksumResultCode * @param checksumResultCode

View File

@@ -35,9 +35,11 @@ public class ChecksumResultServiceImpl implements ChecksumResultService {
/** /**
* Get the result description for the given result code * Get the result description for the given result code
* *
* @param context Context
* @param code * @param code
* to get the description for. * to get the description for.
* @return the found description. * @return the found description.
* @throws SQLException if database error
*/ */
@Override @Override
public ChecksumResult findByCode(Context context, ChecksumResultCode code) throws SQLException 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. * Get a list of all the possible result codes.
* *
* @param context Context
* @return a list of all the result codes * @return a list of all the result codes
* @throws SQLException if database error
*/ */
@Override @Override
public List<ChecksumResult> findAll(Context context) throws SQLException { public List<ChecksumResult> findAll(Context context) throws SQLException {

View File

@@ -24,8 +24,10 @@ public interface ChecksumResultsCollector
/** /**
* Collects results. * Collects results.
* *
* @param context Context
* @param info * @param info
* BitstreamInfo representing the check results. * BitstreamInfo representing the check results.
* @throws SQLException if database error
*/ */
void collect(Context context, MostRecentChecksum info) throws SQLException; void collect(Context context, MostRecentChecksum info) throws SQLException;
} }

View File

@@ -61,6 +61,7 @@ public class HandleDispatcher implements BitstreamDispatcher
/** /**
* Main constructor. * Main constructor.
* *
* @param context Context
* @param hdl * @param hdl
* the handle to get bitstreams from. * the handle to get bitstreams from.
*/ */
@@ -110,6 +111,7 @@ public class HandleDispatcher implements BitstreamDispatcher
/** /**
* Initializes this dispatcher on first execution. * Initializes this dispatcher on first execution.
* *
* @throws SQLException if database error
* @see org.dspace.checker.BitstreamDispatcher#next() * @see org.dspace.checker.BitstreamDispatcher#next()
*/ */
@Override @Override

View File

@@ -67,6 +67,7 @@ public class LimitedCountDispatcher implements BitstreamDispatcher
* Retreives the next bitstream to be checked. * Retreives the next bitstream to be checked.
* *
* @return the bitstream * @return the bitstream
* @throws SQLException if database error
*/ */
@Override @Override
public Bitstream next() throws SQLException { public Bitstream next() throws SQLException {

View File

@@ -67,6 +67,7 @@ public class LimitedDurationDispatcher implements BitstreamDispatcher
} }
/** /**
* @throws SQLException if database error
* @see org.dspace.checker.BitstreamDispatcher#next() * @see org.dspace.checker.BitstreamDispatcher#next()
*/ */
@Override @Override

View File

@@ -60,11 +60,13 @@ public class MostRecentChecksumServiceImpl implements MostRecentChecksumService
* Find all bitstreams that were set to not be processed for the specified * Find all bitstreams that were set to not be processed for the specified
* date range. * date range.
* *
* @param context Context
* @param startDate * @param startDate
* the start of the date range * the start of the date range
* @param endDate * @param endDate
* the end of the date range * the end of the date range
* @return a list of BitstreamHistoryInfo objects * @return a list of BitstreamHistoryInfo objects
* @throws SQLException if database error
*/ */
@Override @Override
public List<MostRecentChecksum> findNotProcessedBitstreamsReport(Context context, Date startDate, Date endDate) throws SQLException public List<MostRecentChecksum> 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 * Select the most recent bitstream for a given date range with the
* specified status. * specified status.
* *
* @param context Context
* @param startDate * @param startDate
* the start date range * the start date range
* @param endDate * @param endDate
@@ -84,6 +87,7 @@ public class MostRecentChecksumServiceImpl implements MostRecentChecksumService
* the result code * the result code
* *
* @return a list of BitstreamHistoryInfo objects * @return a list of BitstreamHistoryInfo objects
* @throws SQLException if database error
*/ */
@Override @Override
public List<MostRecentChecksum> findBitstreamResultTypeReport(Context context, Date startDate, Date endDate, ChecksumResultCode resultCode) throws SQLException { public List<MostRecentChecksum> 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 * 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 table, and inserts them into the
* most_recent_checksum and checksum_history tables. * most_recent_checksum and checksum_history tables.
* @param context Context
* @throws SQLException if database error
*/ */
@Override @Override
public void updateMissingBitstreams(Context context) throws SQLException { 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 * Get the oldest most recent checksum record. If more than
* one found the first one in the result set is returned. * 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 * @return the oldest MostRecentChecksum or NULL if the table is empty
* @throws SQLException if database error
* *
*/ */
@Override @Override
@@ -174,8 +182,10 @@ public class MostRecentChecksumServiceImpl implements MostRecentChecksumService
* Returns the oldest bitstream that in the set of bitstreams that are less * 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. * 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 * @return id of olded bitstream or -1 if not bitstreams are found
* @throws SQLException if database error
*/ */
@Override @Override
public MostRecentChecksum findOldestRecord(Context context, Date lessThanDate) throws SQLException public MostRecentChecksum findOldestRecord(Context context, Date lessThanDate) throws SQLException

View File

@@ -83,8 +83,10 @@ public class ResultsLogger implements ChecksumResultsCollector
/** /**
* Collect a result for logging. * Collect a result for logging.
* *
* @param context Context
* @param info * @param info
* the BitstreamInfo representing the result. * the BitstreamInfo representing the result.
* @throws SQLException if database error
* @see org.dspace.checker.ChecksumResultsCollector#collect(org.dspace.core.Context, org.dspace.checker.MostRecentChecksum) * @see org.dspace.checker.ChecksumResultsCollector#collect(org.dspace.core.Context, org.dspace.checker.MostRecentChecksum)
*/ */
@Override @Override

View File

@@ -49,6 +49,7 @@ public final class ResultsPruner
* Factory method for the default results pruner configuration using * Factory method for the default results pruner configuration using
* dspace.cfg * dspace.cfg
* *
* @param context Context
* @return a ResultsPruner that represent the default retention policy * @return a ResultsPruner that represent the default retention policy
*/ */
public static ResultsPruner getDefaultPruner(Context context) public static ResultsPruner getDefaultPruner(Context context)
@@ -69,6 +70,7 @@ public final class ResultsPruner
/** /**
* Factory method for ResultsPruners * Factory method for ResultsPruners
* *
* @param context Context
* @param propsFile * @param propsFile
* to configure the results pruner. * to configure the results pruner.
* @return the configured results pruner. * @return the configured results pruner.
@@ -112,7 +114,9 @@ public final class ResultsPruner
* Factory method for ResultsPruners (used to load ConfigurationManager * Factory method for ResultsPruners (used to load ConfigurationManager
* properties. * properties.
* *
* @param props * @param context Context
* @param props Properties
* @return pruner
* @throws FileNotFoundException if file doesn't exist * @throws FileNotFoundException if file doesn't exist
*/ */
public static ResultsPruner getPruner(Context context, Properties props) public static ResultsPruner getPruner(Context context, Properties props)
@@ -177,6 +181,7 @@ public final class ResultsPruner
/** /**
* Default Constructor * Default Constructor
* @param context Context
*/ */
public ResultsPruner(Context context) public ResultsPruner(Context context)
{ {
@@ -234,6 +239,7 @@ public final class ResultsPruner
* registered with this object. * registered with this object.
* *
* @return number of results removed. * @return number of results removed.
* @throws SQLException if database error
*/ */
public int prune() throws SQLException { public int prune() throws SQLException {
ChecksumResultCode[] codes = ChecksumResultCode.values(); ChecksumResultCode[] codes = ChecksumResultCode.values();

View File

@@ -47,6 +47,7 @@ public class SimpleDispatcher implements BitstreamDispatcher
/** /**
* Creates a new SimpleDispatcher. * Creates a new SimpleDispatcher.
* *
* @param context Context
* @param startTime * @param startTime
* timestamp for beginning of checker process * timestamp for beginning of checker process
* @param looping * @param looping
@@ -71,6 +72,7 @@ public class SimpleDispatcher implements BitstreamDispatcher
/** /**
* Selects the next candidate bitstream. * Selects the next candidate bitstream.
* *
* @throws SQLException if database error
* @see org.dspace.checker.BitstreamDispatcher#next() * @see org.dspace.checker.BitstreamDispatcher#next()
*/ */
@Override @Override

View File

@@ -55,6 +55,7 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
* Sends the Deleted bitstream report to an administrator. for the * Sends the Deleted bitstream report to an administrator. for the
* specified date range. * specified date range.
* *
* @param context context
* @param startDate * @param startDate
* the start date for the range * the start date for the range
* @param endDate * @param endDate
@@ -66,6 +67,7 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
* *
* @throws IOException if IO error * @throws IOException if IO error
* if io error occurs * if io error occurs
* @throws SQLException if database error
*/ */
@Override @Override
public int getDeletedBitstreamReport(Context context, Date startDate, Date endDate, 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. * Send the checksum changed report for the specified date range.
* *
* @param context context
* @param startDate * @param startDate
* the start date for the range * the start date for the range
* @param endDate * @param endDate
@@ -111,6 +114,7 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
* *
* @throws IOException if IO error * @throws IOException if IO error
* if io error occurs * if io error occurs
* @throws SQLException if database error
*/ */
@Override @Override
public int getChangedChecksumReport(Context context, Date startDate, Date endDate, 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. * Send the bitstream not found report for the specified date range.
* *
* @param context context
* @param startDate * @param startDate
* the start date for the range. * the start date for the range.
* @param endDate * @param endDate
@@ -158,6 +163,7 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
* *
* @throws IOException if IO error * @throws IOException if IO error
* if io error occurs * if io error occurs
* @throws SQLException if database error
*/ */
@Override @Override
public int getBitstreamNotFoundReport(Context context, Date startDate, Date endDate, 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 * Send the bitstreams that were set to not be processed report for the
* specified date range. * specified date range.
* *
* @param context context
* @param startDate * @param startDate
* the start date for the range * the start date for the range
* @param endDate * @param endDate
@@ -204,6 +211,7 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
* *
* @throws IOException if IO error * @throws IOException if IO error
* if io error occurs * if io error occurs
* @throws SQLException if database error
*/ */
@Override @Override
public int getNotToBeProcessedReport(Context context, Date startDate, Date endDate, public int getNotToBeProcessedReport(Context context, Date startDate, Date endDate,
@@ -239,6 +247,7 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
/** /**
* Get any bitstreams that are not checked by the checksum checker. * Get any bitstreams that are not checked by the checksum checker.
* *
* @param context context
* @param osw * @param osw
* the OutputStreamWriter to write to * the OutputStreamWriter to write to
* *
@@ -246,6 +255,7 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
* *
* @throws IOException if IO error * @throws IOException if IO error
* if io error occurs * if io error occurs
* @throws SQLException if database error
*/ */
@Override @Override
public int getUncheckedBitstreamsReport(Context context, OutputStreamWriter osw) public int getUncheckedBitstreamsReport(Context context, OutputStreamWriter osw)
@@ -313,6 +323,7 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
/** /**
* Create a list of the found history records. * Create a list of the found history records.
* *
* @param context context
* @param bitstreams * @param bitstreams
* the list of history records to be iterated over. * the list of history records to be iterated over.
* @param osw * @param osw
@@ -320,6 +331,7 @@ public class SimpleReporterServiceImpl implements SimpleReporterService
* *
* @throws IOException if IO error * @throws IOException if IO error
* if io error occurs * if io error occurs
* @throws SQLException if database error
*/ */
protected void printDSpaceInfoRecords(Context context, List<Bitstream> bitstreams, OutputStreamWriter osw) protected void printDSpaceInfoRecords(Context context, List<Bitstream> bitstreams, OutputStreamWriter osw)
throws IOException, SQLException { throws IOException, SQLException {

View File

@@ -35,11 +35,13 @@ public interface ChecksumHistoryService {
/** /**
* Prune the history records from the database. * Prune the history records from the database.
* *
* @param context context
* @param interests * @param interests
* set of results and the duration of time before they are * set of results and the duration of time before they are
* removed from the database * removed from the database
* *
* @return number of bitstreams deleted * @return number of bitstreams deleted
* @throws SQLException if database error
*/ */
public int prune(Context context, Map<ChecksumResultCode, Long> interests) throws SQLException; public int prune(Context context, Map<ChecksumResultCode, Long> interests) throws SQLException;
} }

View File

@@ -29,6 +29,7 @@ public interface SimpleReporterService
* Returns the bitstreams set found to be deleted for the specified date * Returns the bitstreams set found to be deleted for the specified date
* range. * range.
* *
* @param context context
* @param startDate * @param startDate
* the start date range * the start date range
* @param endDate * @param endDate
@@ -40,6 +41,7 @@ public interface SimpleReporterService
* *
* @throws IOException if IO error * @throws IOException if IO error
* if io error occurs * if io error occurs
* @throws SQLException if database error
*/ */
public int getDeletedBitstreamReport(Context context, Date startDate, Date endDate, public int getDeletedBitstreamReport(Context context, Date startDate, Date endDate,
OutputStreamWriter osw) throws IOException, SQLException; OutputStreamWriter osw) throws IOException, SQLException;
@@ -48,6 +50,7 @@ public interface SimpleReporterService
* The a report of bitstreams found where the checksum has been changed * The a report of bitstreams found where the checksum has been changed
* since the last check for the specified date range. * since the last check for the specified date range.
* *
* @param context context
* @param startDate * @param startDate
* the start date range. * the start date range.
* @param endDate * @param endDate
@@ -59,6 +62,7 @@ public interface SimpleReporterService
* *
* @throws IOException if IO error * @throws IOException if IO error
* if io error occurs * if io error occurs
* @throws SQLException if database error
*/ */
public int getChangedChecksumReport(Context context, Date startDate, Date endDate, public int getChangedChecksumReport(Context context, Date startDate, Date endDate,
OutputStreamWriter osw) throws IOException, SQLException; OutputStreamWriter osw) throws IOException, SQLException;
@@ -67,6 +71,7 @@ public interface SimpleReporterService
* The report of bitstreams for the specified date range where it was * The report of bitstreams for the specified date range where it was
* determined the bitstreams can no longer be found. * determined the bitstreams can no longer be found.
* *
* @param context context
* @param startDate * @param startDate
* the start date range. * the start date range.
* @param endDate * @param endDate
@@ -78,6 +83,7 @@ public interface SimpleReporterService
* *
* @throws IOException if IO error * @throws IOException if IO error
* if io error occurs * if io error occurs
* @throws SQLException if database error
*/ */
public int getBitstreamNotFoundReport(Context context, Date startDate, Date endDate, public int getBitstreamNotFoundReport(Context context, Date startDate, Date endDate,
OutputStreamWriter osw) throws IOException, SQLException; 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 * The bitstreams that were set to not be processed report for the specified
* date range. * date range.
* *
* @param context context
* @param startDate * @param startDate
* the start date range. * the start date range.
* @param endDate * @param endDate
* the end date range. * the end date range.
* @param osw * @param osw
* the output stream writer to write to * the output stream writer to write to
* @return number of bitstreams found
* *
* @throws IOException if IO error * @throws IOException if IO error
* if io error occurs * if io error occurs
* @throws SQLException if database error
* *
*/ */
public int getNotToBeProcessedReport(Context context, Date startDate, Date endDate, public int getNotToBeProcessedReport(Context context, Date startDate, Date endDate,
@@ -104,6 +113,7 @@ public interface SimpleReporterService
* The bitstreams that are not known to the checksum checker. This means * 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 * they are in the bitstream table but not in the most recent checksum table
* *
* @param context context
* @param osw * @param osw
* the output stream writer to write to * the output stream writer to write to
* *
@@ -111,6 +121,7 @@ public interface SimpleReporterService
* *
* @throws IOException if IO error * @throws IOException if IO error
* if io error occurs * if io error occurs
* @throws SQLException if database error
* *
*/ */
public int getUncheckedBitstreamsReport(Context context, OutputStreamWriter osw) public int getUncheckedBitstreamsReport(Context context, OutputStreamWriter osw)

View File

@@ -127,8 +127,10 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
/** /**
* Set the name of the bitstream * Set the name of the bitstream
* *
* @param context context
* @param n * @param n
* the new name of the bitstream * the new name of the bitstream
* @throws SQLException if database error
*/ */
public void setName(Context context, String n) throws SQLException { public void setName(Context context, String n) throws SQLException {
getBitstreamService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "title", null, null, n); 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 * Set the source of the bitstream
* *
* @param context context
* @param n * @param n
* the new source of the bitstream * the new source of the bitstream
* @throws SQLException if database error
*/ */
public void setSource(Context context, String n) throws SQLException { public void setSource(Context context, String n) throws SQLException {
getBitstreamService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "source", null, null, n); 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 * Set the description of the bitstream
* *
* @param context context
* @param n * @param n
* the new description of the bitstream * the new description of the bitstream
* @throws SQLException if database error
*/ */
public void setDescription(Context context, String n) throws SQLException { public void setDescription(Context context, String n) throws SQLException {
getBitstreamService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "description", null, null, n); 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 * Get the format of the bitstream
* *
* @param context context
* @return the format of this bitstream * @return the format of this bitstream
* @throws SQLException if database error
*/ */
public BitstreamFormat getFormat(Context context) throws SQLException 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 * This method allows us to verify is the bitstream is still valid
* *
* @return true if the bitstream has been deleted * @return true if the bitstream has been deleted
* @throws SQLException if database error
*/ */
public boolean isDeleted() throws SQLException public boolean isDeleted() throws SQLException
{ {
@@ -335,6 +344,7 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* Set the user's format description. This implies that the format of the * Set the user's format description. This implies that the format of the
* bitstream is uncertain, and the format is set to "unknown." * bitstream is uncertain, and the format is set to "unknown."
* *
* @param context
* @param desc * @param desc
* the user's description of the format * the user's description of the format
* @throws SQLException if database error * @throws SQLException if database error
@@ -348,7 +358,9 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* Get the description of the format - either the user's or the description * Get the description of the format - either the user's or the description
* of the format defined by the system. * of the format defined by the system.
* *
* @param context context
* @return a description of the format. * @return a description of the format.
* @throws SQLException if database error
*/ */
public String getFormatDescription(Context context) throws SQLException public String getFormatDescription(Context context) throws SQLException
{ {
@@ -360,6 +372,7 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* description, it is cleared. Passing in <code>null</code> sets the type * description, it is cleared. Passing in <code>null</code> sets the type
* of this bitstream to "unknown". * of this bitstream to "unknown".
* *
* @param context context
* @param f * @param f
* the format of this bitstream, or <code>null</code> for * the format of this bitstream, or <code>null</code> for
* unknown * unknown

View File

@@ -146,6 +146,7 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
* @return the newly registered bitstream * @return the newly registered bitstream
* @throws IOException if IO error * @throws IOException if IO error
* @throws SQLException if database error * @throws SQLException if database error
* @throws AuthorizeException if authorization error
*/ */
@Override @Override
public Bitstream register(Context context, public Bitstream register(Context context,

View File

@@ -88,9 +88,11 @@ public class Bundle extends DSpaceObject implements DSpaceObjectLegacySupport
/** /**
* Set the name of the bundle * Set the name of the bundle
* *
* @param context context
* @param name * @param name
* string name of the bundle (ORIGINAL, TEXT, THUMBNAIL) are the * string name of the bundle (ORIGINAL, TEXT, THUMBNAIL) are the
* values currently used * values currently used
* @throws SQLException if database error
*/ */
public void setName(Context context, String name) throws SQLException 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 type found in Constants
* @return bundle type
*/ */
@Override @Override
public int getType() public int getType()

View File

@@ -228,8 +228,9 @@ public class Collection extends DSpaceObject implements DSpaceObjectLegacySuppor
* Set the license for this collection. Passing in <code>null</code> means * Set the license for this collection. Passing in <code>null</code> means
* that the site-wide default will be used. * that the site-wide default will be used.
* *
* @param license * @param context context
* the license, or <code>null</code> * @param license the license, or <code>null</code>
* @throws SQLException if database error
*/ */
public void setLicense(Context context, String license) throws SQLException { public void setLicense(Context context, String license) throws SQLException {
getCollectionService().setMetadata(context, this, "license", license); getCollectionService().setMetadata(context, this, "license", license);
@@ -242,6 +243,7 @@ public class Collection extends DSpaceObject implements DSpaceObjectLegacySuppor
* for a submission. * for a submission.
* *
* @return the item template, or <code>null</code> * @return the item template, or <code>null</code>
* @throws SQLException if database error
*/ */
public Item getTemplateItem() throws SQLException public Item getTemplateItem() throws SQLException
{ {

View File

@@ -224,6 +224,7 @@ public class Community extends DSpaceObject implements DSpaceObjectLegacySupport
/** /**
* return type found in Constants * return type found in Constants
* @return Community type
*/ */
@Override @Override
public int getType() public int getType()

View File

@@ -328,6 +328,9 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
/** /**
* Internal method to process subcommunities recursively * 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<Collection> collectionList) throws SQLException protected void addCollectionList(Community community, List<Collection> collectionList) throws SQLException
{ {
@@ -488,6 +491,8 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
* Internal method to remove the community and all its children from the * Internal method to remove the community and all its children from the
* database, and perform any pre/post-cleanup * database, and perform any pre/post-cleanup
* *
* @param context context
* @param community community
* @throws SQLException if database error * @throws SQLException if database error
* @throws AuthorizeException if authorization error * @throws AuthorizeException if authorization error
* @throws IOException if IO error * @throws IOException if IO error

View File

@@ -93,6 +93,7 @@ public class DCSeriesNumber
/** /**
* Get the series name - guaranteed non-null * Get the series name - guaranteed non-null
* @return name
*/ */
public String getSeries() public String getSeries()
{ {
@@ -101,6 +102,7 @@ public class DCSeriesNumber
/** /**
* Get the number - guaranteed non-null * Get the number - guaranteed non-null
* @return number
*/ */
public String getNumber() public String getNumber()
{ {

View File

@@ -34,6 +34,7 @@ import java.util.*;
* are required to have. * are required to have.
* *
* @author kevinvandevelde at atmire.com * @author kevinvandevelde at atmire.com
* @param <T> class type
*/ */
public abstract class DSpaceObjectServiceImpl<T extends DSpaceObject> implements DSpaceObjectService<T> { public abstract class DSpaceObjectServiceImpl<T extends DSpaceObject> implements DSpaceObjectService<T> {
@@ -357,6 +358,12 @@ public abstract class DSpaceObjectServiceImpl<T extends DSpaceObject> implements
/** /**
* Retrieve first metadata field value * Retrieve first metadata field value
* @param dso
* @param language
* @param element
* @param schema
* @param qualifier
* @return
*/ */
@Override @Override
public String getMetadataFirstValue(T dso, String schema, String element, String qualifier, String language){ public String getMetadataFirstValue(T dso, String schema, String element, String qualifier, String language){
@@ -369,6 +376,7 @@ public abstract class DSpaceObjectServiceImpl<T extends DSpaceObject> implements
/** /**
* Set first metadata field value * Set first metadata field value
* @throws SQLException if database error
*/ */
@Override @Override
public void setMetadataSingleValue(Context context, T dso, String schema, String element, String qualifier, String language, String value) throws SQLException { public void setMetadataSingleValue(Context context, T dso, String schema, String element, String qualifier, String language, String value) throws SQLException {
@@ -384,6 +392,7 @@ public abstract class DSpaceObjectServiceImpl<T extends DSpaceObject> implements
* Protected method that deletes all metadata values from the database, should only be called when deleting the item. * Protected method that deletes all metadata values from the database, should only be called when deleting the item.
* @param context the dspaceObject * @param context the dspaceObject
* @param dso the dspaceObject who's metadata we are to delete * @param dso the dspaceObject who's metadata we are to delete
* @throws SQLException if database error
*/ */
protected void deleteMetadata(Context context, T dso) throws SQLException { protected void deleteMetadata(Context context, T dso) throws SQLException {
@@ -491,6 +500,8 @@ public abstract class DSpaceObjectServiceImpl<T extends DSpaceObject> implements
* The returned array will always have length greater than or equal to 4 * The returned array will always have length greater than or equal to 4
* <p> * <p>
* Values in the returned array can be empty or null. * Values in the returned array can be empty or null.
* @param fieldName field name
* @return array
*/ */
protected String[] getElements(String fieldName) { protected String[] getElements(String fieldName) {
String[] tokens = StringUtils.split(fieldName, "."); String[] tokens = StringUtils.split(fieldName, ".");
@@ -509,6 +520,8 @@ public abstract class DSpaceObjectServiceImpl<T extends DSpaceObject> implements
* The returned array will always have length greater than or equal to 4 * The returned array will always have length greater than or equal to 4
* <p> * <p>
* When @param fill is true, elements that would be empty or null are replaced by Item.ANY * 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) { protected String[] getElementsFilled(String fieldName) {
String[] elements = getElements(fieldName); String[] elements = getElements(fieldName);

View File

@@ -45,6 +45,7 @@ public interface InProgressSubmission
* Get the submitter * Get the submitter
* *
* @return the submitting e-person * @return the submitting e-person
* @throws SQLException if database error
*/ */
EPerson getSubmitter() throws SQLException; EPerson getSubmitter() throws SQLException;

View File

@@ -153,9 +153,10 @@ public class MetadataFieldServiceImpl implements MetadataFieldService {
* database constraint. * database constraint.
* *
* @param context dspace context * @param context dspace context
* @param fieldId field id
* @param metadataSchema metadataSchema * @param metadataSchema metadataSchema
* @param element * @param element element
* @param qualifier * @param qualifier qualifier
* @return true if unique * @return true if unique
* @throws SQLException if database error * @throws SQLException if database error
*/ */

View File

@@ -151,6 +151,7 @@ public class MetadataSchemaServiceImpl implements MetadataSchemaService {
* number of times in the current schema. * number of times in the current schema.
* *
* @param context DSpace context * @param context DSpace context
* @param metadataSchemaId metadata schema id
* @param namespace namespace URI to match * @param namespace namespace URI to match
* @return true of false * @return true of false
* @throws SQLException if database error * @throws SQLException if database error
@@ -165,6 +166,7 @@ public class MetadataSchemaServiceImpl implements MetadataSchemaService {
* Return true if and only if the passed name is unique. * Return true if and only if the passed name is unique.
* *
* @param context DSpace context * @param context DSpace context
* @param metadataSchemaId metadata schema id
* @param name short name of schema * @param name short name of schema
* @return true of false * @return true of false
* @throws SQLException if database error * @throws SQLException if database error

View File

@@ -97,6 +97,11 @@ public class Choices
/** /**
* Constructor for general purpose * 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) public Choices(Choice values[], int start, int total, int confidence, boolean more)
{ {
@@ -110,6 +115,12 @@ public class Choices
/** /**
* Constructor for general purpose * 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) 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 * Constructor for error results
* @param confidence confidence level
*/ */
public Choices(int confidence) public Choices(int confidence)
{ {
@@ -133,6 +145,7 @@ public class Choices
/** /**
* Constructor for simple empty or error results * Constructor for simple empty or error results
* @param isError whether error
*/ */
public Choices(boolean isError) public Choices(boolean isError)
{ {

View File

@@ -216,6 +216,7 @@ public class MetadataAuthorityServiceImpl implements MetadataAuthorityService
/** /**
* Give the minimal level of confidence required to consider valid an authority value * Give the minimal level of confidence required to consider valid an authority value
* for the given metadata. * for the given metadata.
* @param metadataField metadata field
* @return the minimal valid level of confidence for the given metadata * @return the minimal valid level of confidence for the given metadata
*/ */
@Override @Override

View File

@@ -88,18 +88,26 @@ public interface ChoiceAuthorityService
/** /**
* Wrapper that calls getLabel method of the plugin corresponding to * Wrapper that calls getLabel method of the plugin corresponding to
* the metadata field defined by schema,element,qualifier. * 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); public String getLabel(MetadataValue metadataValue, String locale);
/** /**
* Wrapper that calls getLabel method of the plugin corresponding to * Wrapper that calls getLabel method of the plugin corresponding to
* the metadata field defined by single field key. * 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); public String getLabel(String fieldKey, String authKey, String locale);
/** /**
* Predicate, is there a Choices configuration of any kind for the * Predicate, is there a Choices configuration of any kind for the
* given metadata field? * given metadata field?
* @param fieldKey single string identifying metadata field
* @return true if choices are configured for this field. * @return true if choices are configured for this field.
*/ */
public boolean isChoicesConfigured(String fieldKey); public boolean isChoicesConfigured(String fieldKey);
@@ -108,6 +116,7 @@ public interface ChoiceAuthorityService
* Get the presentation keyword (should be "lookup", "select" or "suggest", but this * 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. * 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 * @return configured presentation type for this field, or null if none found
*/ */
public String getPresentation(String fieldKey); public String getPresentation(String fieldKey);
@@ -115,12 +124,15 @@ public interface ChoiceAuthorityService
/** /**
* Get the configured "closed" value for this field. * Get the configured "closed" value for this field.
* *
* @param fieldKey single string identifying metadata field
* @return true if choices are closed for this field. * @return true if choices are closed for this field.
*/ */
public boolean isClosed(String fieldKey); public boolean isClosed(String fieldKey);
/** /**
* Wrapper to call plugin's getVariants(). * Wrapper to call plugin's getVariants().
* @param metadataValue metadata value
* @return List of variants
*/ */
public List<String> getVariants(MetadataValue metadataValue); public List<String> getVariants(MetadataValue metadataValue);
} }

View File

@@ -41,16 +41,32 @@ import java.util.List;
*/ */
public interface MetadataAuthorityService { 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); 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); 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); 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); public boolean isAuthorityRequired(String fieldKey);
@@ -58,6 +74,8 @@ public interface MetadataAuthorityService {
* Construct a single key from the tuple of schema/element/qualifier * Construct a single key from the tuple of schema/element/qualifier
* that describes a metadata field. Punt to the function we use for * that describes a metadata field. Punt to the function we use for
* submission UI input forms, for now. * submission UI input forms, for now.
* @param metadataField metadata field
* @return field key
*/ */
public String makeFieldKey(MetadataField metadataField); public String makeFieldKey(MetadataField metadataField);
@@ -65,12 +83,17 @@ public interface MetadataAuthorityService {
* Construct a single key from the tuple of schema/element/qualifier * Construct a single key from the tuple of schema/element/qualifier
* that describes a metadata field. Punt to the function we use for * that describes a metadata field. Punt to the function we use for
* submission UI input forms, for now. * 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); public String makeFieldKey(String schema, String element, String qualifier);
/** /**
* Give the minimal level of confidence required to consider valid an authority value * Give the minimal level of confidence required to consider valid an authority value
* for the given metadata. * for the given metadata.
* @param metadataField metadata field
* @return the minimal valid level of confidence for the given metadata * @return the minimal valid level of confidence for the given metadata
*/ */
public int getMinConfidence(MetadataField metadataField); public int getMinConfidence(MetadataField metadataField);

View File

@@ -115,6 +115,7 @@ public class AIPDIMCrosswalk
* When there are no results, an * When there are no results, an
* empty list is returned, but never <code>null</code>. * empty list is returned, but never <code>null</code>.
* *
* @param context context
* @param dso the DSpace Object whose metadata to export. * @param dso the DSpace Object whose metadata to export.
* @return results of crosswalk as list of XML elements. * @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. * This is typically the root element of a document.
* <p> * <p>
* *
* @param context context
* @param dso the DSpace Object whose metadata to export. * @param dso the DSpace Object whose metadata to export.
* @return root Element of the target metadata, never <code>null</code> * @return root Element of the target metadata, never <code>null</code>
* *
@@ -160,6 +162,11 @@ public class AIPDIMCrosswalk
* Ingest a whole document. Build Document object around root element, * Ingest a whole document. Build Document object around root element,
* and feed that to the transformation, since it may get handled * and feed that to the transformation, since it may get handled
* differently than a List of metadata elements. * 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 @Override
public void ingest(Context context, DSpaceObject dso, Element root, boolean createMissingMetadataFields) 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 * Fields correspond directly to Item.addMetadata() calls so
* they are simply executed. * 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 @Override
public void ingest(Context context, DSpaceObject dso, List<Element> dimList, boolean createMissingMetadataFields) public void ingest(Context context, DSpaceObject dso, List<Element> dimList, boolean createMissingMetadataFields)

View File

@@ -157,6 +157,7 @@ public class AIPTechMDCrosswalk implements IngestionCrosswalk, DisseminationCros
* When there are no results, an * When there are no results, an
* empty list is returned, but never <code>null</code>. * empty list is returned, but never <code>null</code>.
* *
* @param context context
* @param dso the DSpace Object whose metadata to export. * @param dso the DSpace Object whose metadata to export.
* @return results of crosswalk as list of XML elements. * @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. * This is typically the root element of a document.
* <p> * <p>
* *
* @param context context
* @param dso the DSpace Object whose metadata to export. * @param dso the DSpace Object whose metadata to export.
* @return root Element of the target metadata, never <code>null</code> * @return root Element of the target metadata, never <code>null</code>
* *
@@ -323,6 +325,11 @@ public class AIPTechMDCrosswalk implements IngestionCrosswalk, DisseminationCros
* Ingest a whole document. Build Document object around root element, * Ingest a whole document. Build Document object around root element,
* and feed that to the transformation, since it may get handled * and feed that to the transformation, since it may get handled
* differently than a List of metadata elements. * 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 @Override
public void ingest(Context context, DSpaceObject dso, Element root, boolean createMissingMetadataFields) 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; * Translation produces a list of DIM "field" elements;
* these correspond directly to Item.addMetadata() calls so * these correspond directly to Item.addMetadata() calls so
* they are simply executed. * 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 @Override
public void ingest(Context context, DSpaceObject dso, List<Element> dimList, boolean createMissingMetadataFields) public void ingest(Context context, DSpaceObject dso, List<Element> dimList, boolean createMissingMetadataFields)

View File

@@ -28,6 +28,14 @@ public class CrosswalkUtils {
/** /**
* Scans metadata for elements not defined in this DSpace instance. It then takes action based * Scans metadata for elements not defined in this DSpace instance. It then takes action based
* on a configurable parameter (fail, ignore, add). * on a configurable parameter (fail, ignore, add).
* @param context context
* @param schema schema
* @param element element
* @param qualifier qualifier
* @param forceCreate force create flag
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
* @throws CrosswalkException if crosswalk error
*/ */
public static void checkMetadata(Context context, String schema, String element, String qualifier, boolean forceCreate) throws SQLException, AuthorizeException, CrosswalkException { 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 // The two options, with three possibilities each: add, ignore, fail

View File

@@ -91,6 +91,7 @@ public interface DisseminationCrosswalk
* When there are no results, an * When there are no results, an
* empty list is returned, but never <code>null</code>. * empty list is returned, but never <code>null</code>.
* *
* @param context context
* @param dso the DSpace Object whose metadata to export. * @param dso the DSpace Object whose metadata to export.
* @return results of crosswalk as list of XML elements. * @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. * This is typically the root element of a document.
* <p> * <p>
* *
* @param context context
* @param dso the DSpace Object whose metadata to export. * @param dso the DSpace Object whose metadata to export.
* @return root Element of the target metadata, never <code>null</code> * @return root Element of the target metadata, never <code>null</code>
* *

View File

@@ -63,6 +63,7 @@ public interface IngestionCrosswalk
* @param context DSpace context. * @param context DSpace context.
* @param dso DSpace Object (Item, Bitstream, etc) to which new metadata gets attached. * @param dso DSpace Object (Item, Bitstream, etc) to which new metadata gets attached.
* @param metadata List of XML Elements of metadata * @param metadata List of XML Elements of metadata
* @param createMissingMetadataFields whether to create missing fields
* *
* @throws CrosswalkInternalException (<code>CrosswalkException</code>) failure of the crosswalk itself. * @throws CrosswalkInternalException (<code>CrosswalkException</code>) failure of the crosswalk itself.
* @throws CrosswalkObjectNotSupported (<code>CrosswalkException</code>) Cannot crosswalk into this kind of DSpace object. * @throws CrosswalkObjectNotSupported (<code>CrosswalkException</code>) Cannot crosswalk into this kind of DSpace object.
@@ -85,6 +86,7 @@ public interface IngestionCrosswalk
* @param context DSpace context. * @param context DSpace context.
* @param dso DSpace Object (usually an Item) to which new metadata gets attached. * @param dso DSpace Object (usually an Item) to which new metadata gets attached.
* @param root root Element of metadata document. * @param root root Element of metadata document.
* @param createMissingMetadataFields whether to create missing fields
* *
* @throws CrosswalkInternalException (<code>CrosswalkException</code>) failure of the crosswalk itself. * @throws CrosswalkInternalException (<code>CrosswalkException</code>) failure of the crosswalk itself.
* @throws CrosswalkObjectNotSupported (<code>CrosswalkException</code>) Cannot crosswalk into this kind of DSpace object. * @throws CrosswalkObjectNotSupported (<code>CrosswalkException</code>) Cannot crosswalk into this kind of DSpace object.

View File

@@ -130,6 +130,7 @@ public class METSRightsCrosswalk
* policies (permissions) for the provided object, and translates them into * policies (permissions) for the provided object, and translates them into
* METSRights PermissionTypes. * METSRights PermissionTypes.
* *
* @param context context
* @param dso DSpace Object * @param dso DSpace Object
* @return XML Element corresponding to the new {@code <RightsDeclarationMD>} translation * @return XML Element corresponding to the new {@code <RightsDeclarationMD>} translation
* @throws CrosswalkException if crosswalk error * @throws CrosswalkException if crosswalk error
@@ -404,6 +405,7 @@ public class METSRightsCrosswalk
* @param context * @param context
* @param dso * @param dso
* @param root * @param root
* @param createMissingMetadataFields
* @throws CrosswalkException if crosswalk error * @throws CrosswalkException if crosswalk error
* @throws IOException if IO error * @throws IOException if IO error
* @throws SQLException if database error * @throws SQLException if database error
@@ -432,8 +434,10 @@ public class METSRightsCrosswalk
* conjunction with another Crosswalk which can create/restore missing * conjunction with another Crosswalk which can create/restore missing
* Groups or EPeople (e.g. RoleCrosswalk). * Groups or EPeople (e.g. RoleCrosswalk).
* *
* @param context * @param context context
* @param dso * @param dso Dspace object
* @param ml list of elements
* @param createMissingMetadataFields whether to create missing fields
* @throws CrosswalkException if crosswalk error * @throws CrosswalkException if crosswalk error
* @throws IOException if IO error * @throws IOException if IO error
* @throws SQLException if database error * @throws SQLException if database error

View File

@@ -310,6 +310,11 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
/** /**
* Returns object's metadata in MODS format, as List of XML structure nodes. * 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 @Override
public List<Element> disseminateList(Context context, DSpaceObject dso) public List<Element> disseminateList(Context context, DSpaceObject dso)
@@ -321,6 +326,11 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
/** /**
* Disseminate an Item, Collection, or Community to MODS. * 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 @Override
public Element disseminateElement(Context context, DSpaceObject dso) public Element disseminateElement(Context context, DSpaceObject dso)
@@ -439,6 +449,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
* *
* @param site * @param site
* The site to derive metadata from * The site to derive metadata from
* @return list of metadata
*/ */
protected List<MockMetadataValue> site2Metadata(Site site) protected List<MockMetadataValue> site2Metadata(Site site)
{ {
@@ -473,6 +484,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
* *
* @param community * @param community
* The community to derive metadata from * The community to derive metadata from
* @return list of metadata
*/ */
protected List<MockMetadataValue> community2Metadata(Community community) protected List<MockMetadataValue> community2Metadata(Community community)
{ {
@@ -522,6 +534,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
* *
* @param collection * @param collection
* The collection to derive metadata from * The collection to derive metadata from
* @return list of metadata
*/ */
protected List<MockMetadataValue> collection2Metadata(Collection collection) protected List<MockMetadataValue> collection2Metadata(Collection collection)
{ {
@@ -585,6 +598,7 @@ public class MODSDisseminationCrosswalk extends SelfNamedPlugin
* *
* @param item * @param item
* The item to derive metadata from * The item to derive metadata from
* @return list of metadata
*/ */
protected List<MockMetadataValue> item2Metadata(Item item) protected List<MockMetadataValue> item2Metadata(Item item)
{ {

View File

@@ -336,6 +336,11 @@ public class QDCCrosswalk extends SelfNamedPlugin
/** /**
* Returns object's metadata in MODS format, as XML structure node. * 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 @Override
public List<Element> disseminateList(Context context, DSpaceObject dso) public List<Element> disseminateList(Context context, DSpaceObject dso)

View File

@@ -135,6 +135,7 @@ public class RoleCrosswalk
* When there are no results, an * When there are no results, an
* empty list is returned, but never <code>null</code>. * empty list is returned, but never <code>null</code>.
* *
* @param context context
* @param dso the DSpace Object whose metadata to export. * @param dso the DSpace Object whose metadata to export.
* @return results of crosswalk as list of XML elements. * @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. * This is typically the root element of a document.
* <p> * <p>
* *
* @param context context
* @param dso the DSpace Object whose metadata to export. * @param dso the DSpace Object whose metadata to export.
* @return root Element of the target metadata, never <code>null</code> * @return root Element of the target metadata, never <code>null</code>
* *
@@ -241,9 +243,10 @@ public class RoleCrosswalk
/** /**
* Ingest a List of XML elements * Ingest a List of XML elements
* *
* @param context * @param context context
* @param dso * @param dso DSpaceObject
* @param metadata * @param metadata list of metadata
* @param createMissingMetadataFields whether to create missing fields
* @throws CrosswalkException if crosswalk error * @throws CrosswalkException if crosswalk error
* @throws IOException if IO error * @throws IOException if IO error
* @throws SQLException if database error * @throws SQLException if database error
@@ -265,9 +268,10 @@ public class RoleCrosswalk
* <P> * <P>
* This essentially just wraps a call to the configured Role PackageIngester. * This essentially just wraps a call to the configured Role PackageIngester.
* *
* @param context * @param context context
* @param dso * @param dso DSpaceObject
* @param root * @param root root element
* @param createMissingMetadataFields whether to create missing fields
* @throws CrosswalkException if crosswalk error * @throws CrosswalkException if crosswalk error
* @throws IOException if IO error * @throws IOException if IO error
* @throws SQLException if database error * @throws SQLException if database error

View File

@@ -77,6 +77,11 @@ public class SimpleDCDisseminationCrosswalk extends SelfNamedPlugin
* Returns object's metadata as XML elements. * Returns object's metadata as XML elements.
* Simple-minded copying of elements: convert contributor.author to * Simple-minded copying of elements: convert contributor.author to
* "creator" but otherwise just grab element name without qualifier. * "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 @Override
public List<Element> disseminateList(Context context, DSpaceObject dso) public List<Element> disseminateList(Context context, DSpaceObject dso)

View File

@@ -35,6 +35,7 @@ public interface StreamDisseminationCrosswalk
/** /**
* Predicate: Can this disseminator crosswalk the given object. * Predicate: Can this disseminator crosswalk the given object.
* *
* @param context context
* @param dso dspace object, e.g. an <code>Item</code>. * @param dso dspace object, e.g. an <code>Item</code>.
* @return true when disseminator is capable of producing metadata. * @return true when disseminator is capable of producing metadata.
*/ */

View File

@@ -146,6 +146,11 @@ public class XHTMLHeadDisseminationCrosswalk extends SelfNamedPlugin implements
/** /**
* This generates a &lt;head&gt; element around the metadata; in general * This generates a &lt;head&gt; element around the metadata; in general
* this will probably not be used * 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 @Override
public Element disseminateElement(Context context, DSpaceObject dso) public Element disseminateElement(Context context, DSpaceObject dso)
@@ -161,6 +166,11 @@ public class XHTMLHeadDisseminationCrosswalk extends SelfNamedPlugin implements
/** /**
* Return &lt;meta&gt; elements that can be put in the &lt;head&gt; element * Return &lt;meta&gt; elements that can be put in the &lt;head&gt; element
* of an XHTML document. * 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 @Override
public List<Element> disseminateList(Context context, DSpaceObject dso) throws CrosswalkException, public List<Element> disseminateList(Context context, DSpaceObject dso) throws CrosswalkException,

View File

@@ -250,6 +250,11 @@ public class XSLTDisseminationCrosswalk
/** /**
* Disseminate the DSpace item, collection, or community. * 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 * @see DisseminationCrosswalk
*/ */
@Override @Override
@@ -321,6 +326,8 @@ public class XSLTDisseminationCrosswalk
* Generate an intermediate representation of a DSpace object. * Generate an intermediate representation of a DSpace object.
* *
* @param dso The dspace object to build a representation of. * @param dso The dspace object to build a representation of.
* @param dcvs list of metadata
* @return element
*/ */
public static Element createDIM(DSpaceObject dso, List<MockMetadataValue> dcvs) public static Element createDIM(DSpaceObject dso, List<MockMetadataValue> dcvs)
{ {
@@ -343,6 +350,7 @@ public class XSLTDisseminationCrosswalk
* Generate an intermediate representation of a DSpace object. * Generate an intermediate representation of a DSpace object.
* *
* @param dso The dspace object to build a representation of. * @param dso The dspace object to build a representation of.
* @return element
*/ */
public static Element createDIM(DSpaceObject dso) public static Element createDIM(DSpaceObject dso)
{ {
@@ -516,6 +524,8 @@ public class XSLTDisseminationCrosswalk
/** /**
* Simple command-line rig for testing the DIM output of a stylesheet. * Simple command-line rig for testing the DIM output of a stylesheet.
* Usage: {@code java XSLTDisseminationCrosswalk <crosswalk-name> <handle> [output-file]} * Usage: {@code java XSLTDisseminationCrosswalk <crosswalk-name> <handle> [output-file]}
* @param argv arguments
* @throws Exception if error
*/ */
public static void main(String[] argv) throws Exception public static void main(String[] argv) throws Exception
{ {

Some files were not shown because too many files have changed in this diff Show More