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
* source input stream
* @param verbose verbose mode
*
* @return InputStream the resulting input stream
* @throws Exception if error
*/
@Override
public InputStream getDestinationStream(Item currentItem, InputStream source, boolean verbose)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -24,7 +24,13 @@ public interface RequestItemService {
/**
* Generate a request item representing the request and put it into the DB
* @param context
* @param context context
* @param bitstream bitstream
* @param item item
* @param reqMessage message
* @param allFiles all files flag
* @param reqEmail email
* @param reqName name
* @return the token of the request item
* @throws 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.
* @param context
* @param requestItem
*/
public void update(Context context, RequestItem requestItem);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -15,15 +15,27 @@ package org.dspace.app.util;
*/
public interface DSpaceWebappMXBean
{
/** Is this webapp a user interface? False if machine interface such as SWORD. */
/**
* Is this webapp a user interface? False if machine interface such as SWORD.
* @return true/false
*/
public boolean isUI();
/** What kind of webapp? XMLUI, OAI, etc. */
/**
* What kind of webapp? XMLUI, OAI, etc.
* @return kind of webapp
*/
public String getKind();
/** What is the base URL of this application? */
/**
* What is the base URL of this application?
* @return base url
*/
public String getURL();
/** When did this application start? */
/**
* When did this application start?
* @return start time
*/
public String getStarted();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -69,6 +69,7 @@ public class LDAPAuthentication
/**
* Let a real auth method return true if it wants.
* @throws SQLException if database error
*/
@Override
public boolean canSelfRegister(Context context,
@@ -82,6 +83,7 @@ public class LDAPAuthentication
/**
* Nothing here, initialization is done when auto-registering.
* @throws SQLException if database error
*/
@Override
public void initEPerson(Context context, HttpServletRequest request,
@@ -94,6 +96,7 @@ public class LDAPAuthentication
/**
* Cannot change LDAP password through dspace, right?
* @throws SQLException if database error
*/
@Override
public boolean allowSetPassword(Context context,

View File

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

View File

@@ -159,6 +159,7 @@ public class ShibAuthentication implements AuthenticationMethod
* <br>
* NO_SUCH_USER - user not found using this method. <br>
* BAD_ARGS - user/pw not appropriate for this method
* @throws SQLException if database error
*/
@Override
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
* @param email
* e-mail address of user attempting to register
* @throws SQLException if database error
*
*/
@Override
@@ -434,6 +436,7 @@ public class ShibAuthentication implements AuthenticationMethod
* HTTP request, in case anything in that is used to decide
* @param username
* e-mail address of user attempting to register
* @throws SQLException if database error
*
*/
@Override
@@ -456,6 +459,7 @@ public class ShibAuthentication implements AuthenticationMethod
* @param eperson
* newly created EPerson record - email + information from the
* registration form will have been filled out.
* @throws SQLException if database error
*
*/
@Override
@@ -578,6 +582,8 @@ public class ShibAuthentication implements AuthenticationMethod
* @param context The DSpace database context
* @param request The current HTTP Request
* @return The EPerson identified or null.
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
*/
protected EPerson findEPerson(Context context, HttpServletRequest request) throws SQLException, AuthorizeException {
@@ -676,6 +682,8 @@ public class ShibAuthentication implements AuthenticationMethod
* @param context The current DSpace database context
* @param request The current HTTP Request
* @return A new eperson object or null if unable to create a new eperson.
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
*/
protected EPerson registerNewEPerson(Context context, HttpServletRequest request) throws SQLException, AuthorizeException {
@@ -765,6 +773,8 @@ public class ShibAuthentication implements AuthenticationMethod
* @param context The current DSpace database context
* @param request The current HTTP Request
* @param eperson The eperson object to update.
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
*/
protected void updateEPerson(Context context, HttpServletRequest request, EPerson eperson) throws SQLException, AuthorizeException {
@@ -855,6 +865,7 @@ public class ShibAuthentication implements AuthenticationMethod
* @param password The password
* @param request The HTTP Request
* @return A valid DSpace Authentication Method status code.
* @throws SQLException if database error
*/
protected int swordCompatibility(Context context, String username, String password, HttpServletRequest request) throws SQLException {
@@ -902,7 +913,8 @@ public class ShibAuthentication implements AuthenticationMethod
* the field will be automatically created.
*
* It is safe to call this methods multiple times.
* @param context
* @param context context
* @throws SQLException if database error
*/
protected synchronized void initialize(Context context) throws SQLException {
@@ -964,8 +976,9 @@ public class ShibAuthentication implements AuthenticationMethod
* Check if a MetadataField for an eperson is available.
*
* @param metadataName The name of the metadata field.
* @param context
* @param context context
* @return True if a valid metadata field, otherwise false.
* @throws SQLException if database error
*/
protected synchronized boolean checkIfEpersonMetadataFieldExists(Context context, String metadataName) throws SQLException {
@@ -984,10 +997,12 @@ public class ShibAuthentication implements AuthenticationMethod
protected final String COLUMN_NAME_REGEX = "^[_A-Za-z0-9]+$";
/**
* Automattically create a new metadataField for an eperson
* Automatically create a new metadataField for an eperson
*
* @param context context
* @param metadataName The name of the new metadata field.
* @return True if successful, otherwise false.
* @throws SQLException if database error
*/
protected synchronized boolean autoCreateEpersonMetadataField(Context context, String metadataName) throws SQLException {

View File

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

View File

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

View File

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

View File

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

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 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 {

View File

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

View File

@@ -16,6 +16,7 @@ import org.w3c.dom.Document;
* @author Kevin Van de Velde (kevin at atmire dot com)
* @author Ben Bosman (ben at atmire dot com)
* @author Mark Diggory (markd at atmire dot com)
* @param <T> type
*/
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 singleNodeXPath xpath
* @return node.getTextContent() on the node that matches singleNodeXPath
* null if nothing matches the NodeListXPath
* @throws XPathExpressionException if xpath error
*/
public static String getTextContent(Node xml, String singleNodeXPath) throws XPathExpressionException {
String text = null;
@@ -56,8 +58,10 @@ public class XMLUtils {
/**
* @param xml The starting context (a Node or a Document, for example).
* @param NodeListXPath xpath
* @return A Node matches the NodeListXPath
* null if nothing matches the NodeListXPath
* @throws XPathExpressionException if xpath error
*/
public static Node getNode(Node xml, String NodeListXPath) throws XPathExpressionException {
Node result = null;
@@ -71,8 +75,10 @@ public class XMLUtils {
/**
* @param xml The starting context (a Node or a Document, for example).
* @param NodeListXPath xpath
* @return A NodeList containing the nodes that match the NodeListXPath
* null if nothing matches the NodeListXPath
* @throws XPathExpressionException if xpath error
*/
public static NodeList getNodeList(Node xml, String NodeListXPath) throws XPathExpressionException {
NodeList nodeList = null;
@@ -93,6 +99,8 @@ public class XMLUtils {
* that are element nodes:
* node.getNodeType() == Node.ELEMENT_NODE
* node instanceof Element
* @param nodeList NodeList
* @return iterator over nodes
*/
public static Iterator<Node> getNodeListIterator(final NodeList nodeList) {
return new Iterator<Node>() {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

View File

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

View File

@@ -25,6 +25,7 @@ public class ItemCountDAOFactory
* for the specific DSpace instance.
*
* @param context DSpace Context
* @return DAO
* @throws ItemCountException if count error
*/
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.
*
* @param dso Dspace Context
* @return count
* @throws ItemCountException if count error
*/
@Override

View File

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

View File

@@ -98,6 +98,7 @@ public class ItemListConfig
* What metadata is to go in the given column number?
*
* @param col column
* @return array of metadata
*/
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
* the standard sort string filter
* @param str string
* @param lang language
* @return string
*/
@Override
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
* isn't another value
* @throws SQLException if database error
*
*/
public Bitstream next() throws SQLException;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -67,6 +67,7 @@ public class LimitedDurationDispatcher implements BitstreamDispatcher
}
/**
* @throws SQLException if database error
* @see org.dspace.checker.BitstreamDispatcher#next()
*/
@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
* date range.
*
* @param context Context
* @param startDate
* the start of the date range
* @param endDate
* the end of the date range
* @return a list of BitstreamHistoryInfo objects
* @throws SQLException if database error
*/
@Override
public List<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
* specified status.
*
* @param context Context
* @param startDate
* the start date range
* @param endDate
@@ -84,6 +87,7 @@ public class MostRecentChecksumServiceImpl implements MostRecentChecksumService
* the result code
*
* @return a list of BitstreamHistoryInfo objects
* @throws SQLException if database error
*/
@Override
public List<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
* most_recent_checksum table, and inserts them into the
* most_recent_checksum and checksum_history tables.
* @param context Context
* @throws SQLException if database error
*/
@Override
public void updateMissingBitstreams(Context context) throws SQLException {
@@ -161,7 +167,9 @@ public class MostRecentChecksumServiceImpl implements MostRecentChecksumService
* Get the oldest most recent checksum record. If more than
* one found the first one in the result set is returned.
*
* @param context COntext
* @return the oldest MostRecentChecksum or NULL if the table is empty
* @throws SQLException if database error
*
*/
@Override
@@ -174,8 +182,10 @@ public class MostRecentChecksumServiceImpl implements MostRecentChecksumService
* Returns the oldest bitstream that in the set of bitstreams that are less
* than the specified date. If no bitstreams are found -1 is returned.
*
* @param lessThanDate
* @param context context
* @param lessThanDate date
* @return id of olded bitstream or -1 if not bitstreams are found
* @throws SQLException if database error
*/
@Override
public MostRecentChecksum findOldestRecord(Context context, Date lessThanDate) throws SQLException

View File

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

View File

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

View File

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

View File

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

View File

@@ -35,11 +35,13 @@ public interface ChecksumHistoryService {
/**
* Prune the history records from the database.
*
* @param context context
* @param interests
* set of results and the duration of time before they are
* removed from the database
*
* @return number of bitstreams deleted
* @throws SQLException if database error
*/
public int prune(Context context, Map<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
* range.
*
* @param context context
* @param startDate
* the start date range
* @param endDate
@@ -40,6 +41,7 @@ public interface SimpleReporterService
*
* @throws IOException if IO error
* if io error occurs
* @throws SQLException if database error
*/
public int getDeletedBitstreamReport(Context context, Date startDate, Date endDate,
OutputStreamWriter osw) throws IOException, SQLException;
@@ -48,6 +50,7 @@ public interface SimpleReporterService
* The a report of bitstreams found where the checksum has been changed
* since the last check for the specified date range.
*
* @param context context
* @param startDate
* the start date range.
* @param endDate
@@ -59,6 +62,7 @@ public interface SimpleReporterService
*
* @throws IOException if IO error
* if io error occurs
* @throws SQLException if database error
*/
public int getChangedChecksumReport(Context context, Date startDate, Date endDate,
OutputStreamWriter osw) throws IOException, SQLException;
@@ -67,6 +71,7 @@ public interface SimpleReporterService
* The report of bitstreams for the specified date range where it was
* determined the bitstreams can no longer be found.
*
* @param context context
* @param startDate
* the start date range.
* @param endDate
@@ -78,6 +83,7 @@ public interface SimpleReporterService
*
* @throws IOException if IO error
* if io error occurs
* @throws SQLException if database error
*/
public int getBitstreamNotFoundReport(Context context, Date startDate, Date endDate,
OutputStreamWriter osw) throws IOException, SQLException;
@@ -86,15 +92,18 @@ public interface SimpleReporterService
* The bitstreams that were set to not be processed report for the specified
* date range.
*
* @param context context
* @param startDate
* the start date range.
* @param endDate
* the end date range.
* @param osw
* the output stream writer to write to
* @return number of bitstreams found
*
* @throws IOException if IO error
* if io error occurs
* @throws SQLException if database error
*
*/
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
* they are in the bitstream table but not in the most recent checksum table
*
* @param context context
* @param osw
* the output stream writer to write to
*
@@ -111,6 +121,7 @@ public interface SimpleReporterService
*
* @throws IOException if IO error
* if io error occurs
* @throws SQLException if database error
*
*/
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
*
* @param context context
* @param n
* the new name of the bitstream
* @throws SQLException if database error
*/
public void setName(Context context, String n) throws SQLException {
getBitstreamService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "title", null, null, n);
@@ -149,8 +151,10 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
/**
* Set the source of the bitstream
*
* @param context context
* @param n
* the new source of the bitstream
* @throws SQLException if database error
*/
public void setSource(Context context, String n) throws SQLException {
getBitstreamService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "source", null, null, n);
@@ -170,8 +174,10 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
/**
* Set the description of the bitstream
*
* @param context context
* @param n
* the new description of the bitstream
* @throws SQLException if database error
*/
public void setDescription(Context context, String n) throws SQLException {
getBitstreamService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "description", null, null, n);
@@ -238,7 +244,9 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
/**
* Get the format of the bitstream
*
* @param context context
* @return the format of this bitstream
* @throws SQLException if database error
*/
public BitstreamFormat getFormat(Context context) throws SQLException
{
@@ -255,6 +263,7 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* This method allows us to verify is the bitstream is still valid
*
* @return true if the bitstream has been deleted
* @throws SQLException if database error
*/
public boolean isDeleted() throws SQLException
{
@@ -335,6 +344,7 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* Set the user's format description. This implies that the format of the
* bitstream is uncertain, and the format is set to "unknown."
*
* @param context
* @param desc
* the user's description of the format
* @throws SQLException 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
* of the format defined by the system.
*
* @param context context
* @return a description of the format.
* @throws SQLException if database error
*/
public String getFormatDescription(Context context) throws SQLException
{
@@ -360,6 +372,7 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* description, it is cleared. Passing in <code>null</code> sets the type
* of this bitstream to "unknown".
*
* @param context context
* @param f
* the format of this bitstream, or <code>null</code> for
* unknown

View File

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

View File

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

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

View File

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

View File

@@ -328,6 +328,9 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
/**
* Internal method to process subcommunities recursively
* @param community community
* @param collectionList list of collections
* @throws SQLException if database error
*/
protected void addCollectionList(Community community, List<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
* database, and perform any pre/post-cleanup
*
* @param context context
* @param community community
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
* @throws IOException if IO error

View File

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

View File

@@ -34,6 +34,7 @@ import java.util.*;
* are required to have.
*
* @author kevinvandevelde at atmire.com
* @param <T> class type
*/
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
* @param dso
* @param language
* @param element
* @param schema
* @param qualifier
* @return
*/
@Override
public String getMetadataFirstValue(T dso, String schema, String element, String qualifier, String language){
@@ -369,6 +376,7 @@ public abstract class DSpaceObjectServiceImpl<T extends DSpaceObject> implements
/**
* Set first metadata field value
* @throws SQLException if database error
*/
@Override
public void setMetadataSingleValue(Context context, T dso, String schema, String element, String qualifier, String language, String value) throws SQLException {
@@ -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.
* @param context the dspaceObject
* @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 {
@@ -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
* <p>
* Values in the returned array can be empty or null.
* @param fieldName field name
* @return array
*/
protected String[] getElements(String fieldName) {
String[] tokens = StringUtils.split(fieldName, ".");
@@ -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
* <p>
* When @param fill is true, elements that would be empty or null are replaced by Item.ANY
* @param fieldName field name
* @return array
*/
protected String[] getElementsFilled(String fieldName) {
String[] elements = getElements(fieldName);

View File

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

View File

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

View File

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

View File

@@ -97,6 +97,11 @@ public class Choices
/**
* Constructor for general purpose
* @param values values array
* @param start start number
* @param total total results
* @param confidence confidence level
* @param more whether more values
*/
public Choices(Choice values[], int start, int total, int confidence, boolean more)
{
@@ -110,6 +115,12 @@ public class Choices
/**
* Constructor for general purpose
* @param values values array
* @param start start number
* @param total total results
* @param confidence confidence level
* @param more whether more values
* @param defaultSelected default selected value
*/
public Choices(Choice values[], int start, int total, int confidence, boolean more, int defaultSelected)
{
@@ -124,6 +135,7 @@ public class Choices
/**
* Constructor for error results
* @param confidence confidence level
*/
public Choices(int confidence)
{
@@ -133,6 +145,7 @@ public class Choices
/**
* Constructor for simple empty or error results
* @param isError whether error
*/
public Choices(boolean isError)
{

View File

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

View File

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

View File

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

View File

@@ -115,6 +115,7 @@ public class AIPDIMCrosswalk
* When there are no results, an
* empty list is returned, but never <code>null</code>.
*
* @param context context
* @param dso the DSpace Object whose metadata to export.
* @return results of crosswalk as list of XML elements.
*
@@ -139,6 +140,7 @@ public class AIPDIMCrosswalk
* This is typically the root element of a document.
* <p>
*
* @param context context
* @param dso the DSpace Object whose metadata to export.
* @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,
* and feed that to the transformation, since it may get handled
* differently than a List of metadata elements.
* @param createMissingMetadataFields whether to create missing fields
* @throws CrosswalkException if crosswalk error
* @throws IOException if IO error
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
*/
@Override
public void ingest(Context context, DSpaceObject dso, Element root, boolean createMissingMetadataFields)
@@ -171,6 +178,12 @@ public class AIPDIMCrosswalk
/**
* Fields correspond directly to Item.addMetadata() calls so
* they are simply executed.
* @param createMissingMetadataFields whether to create missing fields
* @param dimList List of elements
* @throws CrosswalkException if crosswalk error
* @throws IOException if IO error
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
*/
@Override
public void ingest(Context context, DSpaceObject dso, List<Element> dimList, boolean createMissingMetadataFields)

View File

@@ -157,6 +157,7 @@ public class AIPTechMDCrosswalk implements IngestionCrosswalk, DisseminationCros
* When there are no results, an
* empty list is returned, but never <code>null</code>.
*
* @param context context
* @param dso the DSpace Object whose metadata to export.
* @return results of crosswalk as list of XML elements.
*
@@ -181,6 +182,7 @@ public class AIPTechMDCrosswalk implements IngestionCrosswalk, DisseminationCros
* This is typically the root element of a document.
* <p>
*
* @param context context
* @param dso the DSpace Object whose metadata to export.
* @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,
* and feed that to the transformation, since it may get handled
* differently than a List of metadata elements.
* @param createMissingMetadataFields whether to create missing fields
* @throws CrosswalkException if crosswalk error
* @throws IOException if IO error
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
*/
@Override
public void ingest(Context context, DSpaceObject dso, Element root, boolean createMissingMetadataFields)
@@ -336,6 +343,12 @@ public class AIPTechMDCrosswalk implements IngestionCrosswalk, DisseminationCros
* Translation produces a list of DIM "field" elements;
* these correspond directly to Item.addMetadata() calls so
* they are simply executed.
* @param createMissingMetadataFields whether to create missing fields
* @param dimList List of elements
* @throws CrosswalkException if crosswalk error
* @throws IOException if IO error
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
*/
@Override
public void ingest(Context context, DSpaceObject dso, List<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
* 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 {
// 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
* empty list is returned, but never <code>null</code>.
*
* @param context context
* @param dso the DSpace Object whose metadata to export.
* @return results of crosswalk as list of XML elements.
*
@@ -110,6 +111,7 @@ public interface DisseminationCrosswalk
* This is typically the root element of a document.
* <p>
*
* @param context context
* @param dso the DSpace Object whose metadata to export.
* @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 dso DSpace Object (Item, Bitstream, etc) to which new metadata gets attached.
* @param metadata List of XML Elements of metadata
* @param createMissingMetadataFields whether to create missing fields
*
* @throws CrosswalkInternalException (<code>CrosswalkException</code>) failure of the crosswalk itself.
* @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 dso DSpace Object (usually an Item) to which new metadata gets attached.
* @param root root Element of metadata document.
* @param createMissingMetadataFields whether to create missing fields
*
* @throws CrosswalkInternalException (<code>CrosswalkException</code>) failure of the crosswalk itself.
* @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
* METSRights PermissionTypes.
*
* @param context context
* @param dso DSpace Object
* @return XML Element corresponding to the new {@code <RightsDeclarationMD>} translation
* @throws CrosswalkException if crosswalk error
@@ -404,6 +405,7 @@ public class METSRightsCrosswalk
* @param context
* @param dso
* @param root
* @param createMissingMetadataFields
* @throws CrosswalkException if crosswalk error
* @throws IOException if IO error
* @throws SQLException if database error
@@ -432,8 +434,10 @@ public class METSRightsCrosswalk
* conjunction with another Crosswalk which can create/restore missing
* Groups or EPeople (e.g. RoleCrosswalk).
*
* @param context
* @param dso
* @param context context
* @param dso Dspace object
* @param ml list of elements
* @param createMissingMetadataFields whether to create missing fields
* @throws CrosswalkException if crosswalk error
* @throws IOException if IO error
* @throws SQLException if database error

View File

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

View File

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

View File

@@ -77,6 +77,11 @@ public class SimpleDCDisseminationCrosswalk extends SelfNamedPlugin
* Returns object's metadata as XML elements.
* Simple-minded copying of elements: convert contributor.author to
* "creator" but otherwise just grab element name without qualifier.
* @param context context
* @throws CrosswalkException if crosswalk error
* @throws IOException if IO error
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
*/
@Override
public List<Element> disseminateList(Context context, DSpaceObject dso)

View File

@@ -35,6 +35,7 @@ public interface StreamDisseminationCrosswalk
/**
* Predicate: Can this disseminator crosswalk the given object.
*
* @param context context
* @param dso dspace object, e.g. an <code>Item</code>.
* @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 will probably not be used
* @param context context
* @throws CrosswalkException crosswalk error
* @throws IOException if IO error
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
*/
@Override
public Element disseminateElement(Context context, DSpaceObject dso)
@@ -161,6 +166,11 @@ public class XHTMLHeadDisseminationCrosswalk extends SelfNamedPlugin implements
/**
* Return &lt;meta&gt; elements that can be put in the &lt;head&gt; element
* of an XHTML document.
* @param context context
* @throws CrosswalkException crosswalk error
* @throws IOException if IO error
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
*/
@Override
public List<Element> disseminateList(Context context, DSpaceObject dso) throws CrosswalkException,

View File

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

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