mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
Merge branch 'master' into DS-3363-csv-import-error-messages
This commit is contained in:
14
.travis.yml
14
.travis.yml
@@ -5,6 +5,20 @@ env:
|
||||
# Give Maven 1GB of memory to work with
|
||||
- MAVEN_OPTS=-Xmx1024M
|
||||
|
||||
jdk:
|
||||
# DS-3384 Oracle JDK 8 has DocLint enabled by default.
|
||||
# Let's use this to catch any newly introduced DocLint issues.
|
||||
- oraclejdk8
|
||||
- oraclejdk7
|
||||
|
||||
## Should we run into any problems with oraclejdk8 on Travis, we may try the following workaround.
|
||||
## https://docs.travis-ci.com/user/languages/java#Testing-Against-Multiple-JDKs
|
||||
## https://github.com/travis-ci/travis-ci/issues/3259#issuecomment-130860338
|
||||
#addons:
|
||||
# apt:
|
||||
# packages:
|
||||
# - oracle-java8-installer
|
||||
|
||||
# Install prerequisites for building Mirage2 more rapidly
|
||||
before_install:
|
||||
# Install Node.js 6.5.0 & print version info
|
||||
|
@@ -12,7 +12,7 @@
|
||||
<parent>
|
||||
<groupId>org.dspace</groupId>
|
||||
<artifactId>dspace-parent</artifactId>
|
||||
<version>6.0-rc5-SNAPSHOT</version>
|
||||
<version>7.0-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@@ -72,10 +72,10 @@ public interface ExtractingParams {
|
||||
/**
|
||||
* Restrict the extracted parts of a document to be indexed
|
||||
* by passing in an XPath expression. All content that satisfies the XPath expr.
|
||||
* will be passed to the {@link SolrContentHandler}.
|
||||
* will be passed to the {@link org.apache.solr.handler.extraction.SolrContentHandler}.
|
||||
* <p>
|
||||
* See Tika's docs for what the extracted document looks like.
|
||||
* <p>
|
||||
*
|
||||
* @see #CAPTURE_ELEMENTS
|
||||
*/
|
||||
public static final String XPATH_EXPRESSION = "xpath";
|
||||
@@ -105,7 +105,7 @@ public interface ExtractingParams {
|
||||
* Capture the specified fields (and everything included below it that isn't capture by some other capture field) separately from the default. This is different
|
||||
* then the case of passing in an XPath expression.
|
||||
* <p>
|
||||
* The Capture field is based on the localName returned to the {@link SolrContentHandler}
|
||||
* The Capture field is based on the localName returned to the {@link org.apache.solr.handler.extraction.SolrContentHandler}
|
||||
* by Tika, not to be confused by the mapped field. The field name can then
|
||||
* be mapped into the index schema.
|
||||
* <p>
|
||||
|
@@ -48,7 +48,7 @@ public class CommunityFiliator
|
||||
|
||||
/**
|
||||
*
|
||||
* @param argv arguments
|
||||
* @param argv the command line arguments given
|
||||
* @throws Exception if error
|
||||
*/
|
||||
public static void main(String[] argv) throws Exception
|
||||
|
@@ -57,8 +57,7 @@ public final class CreateAdministrator
|
||||
* For invoking via the command line. If called with no command line arguments,
|
||||
* it will negotiate with the user for the administrator details
|
||||
*
|
||||
* @param argv
|
||||
* command-line arguments
|
||||
* @param argv the command line arguments given
|
||||
* @throws Exception if error
|
||||
*/
|
||||
public static void main(String[] argv)
|
||||
|
@@ -71,7 +71,8 @@ public class MetadataImporter
|
||||
|
||||
/**
|
||||
* main method for reading user input from the command line
|
||||
* @param args arguments
|
||||
*
|
||||
* @param args the command line arguments given
|
||||
* @throws ParseException if parse error
|
||||
* @throws SQLException if database error
|
||||
* @throws IOException if IO error
|
||||
|
@@ -54,8 +54,7 @@ public class RegistryLoader
|
||||
/**
|
||||
* For invoking via the command line
|
||||
*
|
||||
* @param argv
|
||||
* command-line arguments
|
||||
* @param argv the command line arguments given
|
||||
* @throws Exception if error
|
||||
*/
|
||||
public static void main(String[] argv) throws Exception
|
||||
|
@@ -92,7 +92,8 @@ public class StructBuilder
|
||||
*
|
||||
* The output file will contain exactly the same as the source xml document, but
|
||||
* with the handle for each imported item added as an attribute.
|
||||
* @param argv commandline arguments
|
||||
*
|
||||
* @param argv the command line arguments given
|
||||
* @throws Exception if an error occurs
|
||||
*/
|
||||
public static void main(String[] argv)
|
||||
|
@@ -53,7 +53,6 @@ public final class ChecksumChecker
|
||||
/**
|
||||
* Command line access to the checksum package.
|
||||
*
|
||||
* @param args
|
||||
* <dl>
|
||||
* <dt>-h</dt>
|
||||
* <dd>Print help on command line options</dd>
|
||||
@@ -72,6 +71,7 @@ public final class ChecksumChecker
|
||||
* <dt>-p</dt>
|
||||
* <dd>Don't prune results before running checker</dd>
|
||||
* </dl>
|
||||
* @param args the command line arguments given
|
||||
* @throws SQLException if error
|
||||
*/
|
||||
public static void main(String[] args) throws SQLException {
|
||||
@@ -98,8 +98,7 @@ public final class ChecksumChecker
|
||||
options.addOption(useBitstreamIds);
|
||||
|
||||
options.addOption("p", "prune", false, "Prune configuration file");
|
||||
options
|
||||
.addOption(OptionBuilder
|
||||
options.addOption(OptionBuilder
|
||||
.withArgName("prune")
|
||||
.hasOptionalArgs(1)
|
||||
.withDescription(
|
||||
@@ -249,19 +248,15 @@ public final class ChecksumChecker
|
||||
HelpFormatter myhelp = new HelpFormatter();
|
||||
|
||||
myhelp.printHelp("Checksum Checker\n", options);
|
||||
System.out
|
||||
.println("\nSpecify a duration for checker process, using s(seconds),"
|
||||
System.out.println("\nSpecify a duration for checker process, using s(seconds),"
|
||||
+ "m(minutes), or h(hours): ChecksumChecker -d 30s"
|
||||
+ " OR ChecksumChecker -d 30m"
|
||||
+ " OR ChecksumChecker -d 2h");
|
||||
System.out
|
||||
.println("\nSpecify bitstream IDs: ChecksumChecker -b 13 15 17 20");
|
||||
System.out.println("\nSpecify bitstream IDs: ChecksumChecker -b 13 15 17 20");
|
||||
System.out.println("\nLoop once through all bitstreams: "
|
||||
+ "ChecksumChecker -l");
|
||||
System.out
|
||||
.println("\nLoop continuously through all bitstreams: ChecksumChecker -L");
|
||||
System.out
|
||||
.println("\nCheck a defined number of bitstreams: ChecksumChecker -c 10");
|
||||
System.out.println("\nLoop continuously through all bitstreams: ChecksumChecker -L");
|
||||
System.out.println("\nCheck a defined number of bitstreams: ChecksumChecker -c 10");
|
||||
System.out.println("\nReport all processing (verbose)(default reports only errors): ChecksumChecker -v");
|
||||
System.out.println("\nDefault (no arguments) is equivalent to '-c 1'");
|
||||
System.exit(0);
|
||||
|
@@ -67,12 +67,18 @@ public class Harvest
|
||||
options.addOption("P", "purge", false, "purge all harvestable collections");
|
||||
|
||||
|
||||
options.addOption("e", "eperson", true, "eperson");
|
||||
options.addOption("c", "collection", true, "harvesting collection (handle or id)");
|
||||
options.addOption("t", "type", true, "type of harvesting (0 for none)");
|
||||
options.addOption("a", "address", true, "address of the OAI-PMH server");
|
||||
options.addOption("i", "oai_set_id", true, "id of the PMH set representing the harvested collection");
|
||||
options.addOption("m", "metadata_format", true, "the name of the desired metadata format for harvesting, resolved to namespace and crosswalk in dspace.cfg");
|
||||
options.addOption("e", "eperson", true,
|
||||
"eperson");
|
||||
options.addOption("c", "collection", true,
|
||||
"harvesting collection (handle or id)");
|
||||
options.addOption("t", "type", true,
|
||||
"type of harvesting (0 for none)");
|
||||
options.addOption("a", "address", true,
|
||||
"address of the OAI-PMH server");
|
||||
options.addOption("i", "oai_set_id", true,
|
||||
"id of the PMH set representing the harvested collection");
|
||||
options.addOption("m", "metadata_format", true,
|
||||
"the name of the desired metadata format for harvesting, resolved to namespace and crosswalk in dspace.cfg");
|
||||
|
||||
options.addOption("h", "help", false, "help");
|
||||
|
||||
@@ -90,22 +96,14 @@ public class Harvest
|
||||
{
|
||||
HelpFormatter myhelp = new HelpFormatter();
|
||||
myhelp.printHelp("Harvest\n", options);
|
||||
System.out
|
||||
.println("\nPING OAI server: Harvest -g -s oai_source -i oai_set_id");
|
||||
System.out
|
||||
.println("RUNONCE harvest with arbitrary options: Harvest -o -e eperson -c collection -t harvest_type -a oai_source -i oai_set_id -m metadata_format");
|
||||
System.out
|
||||
.println("SETUP a collection for harvesting: Harvest -s -c collection -t harvest_type -a oai_source -i oai_set_id -m metadata_format");
|
||||
System.out
|
||||
.println("RUN harvest once: Harvest -r -e eperson -c collection");
|
||||
System.out
|
||||
.println("START harvest scheduler: Harvest -S");
|
||||
System.out
|
||||
.println("RESET all harvest status: Harvest -R");
|
||||
System.out
|
||||
.println("PURGE a collection of items and settings: Harvest -p -e eperson -c collection");
|
||||
System.out
|
||||
.println("PURGE all harvestable collections: Harvest -P -e eperson");
|
||||
System.out.println("\nPING OAI server: Harvest -g -s oai_source -i oai_set_id");
|
||||
System.out.println("RUNONCE harvest with arbitrary options: Harvest -o -e eperson -c collection -t harvest_type -a oai_source -i oai_set_id -m metadata_format");
|
||||
System.out.println("SETUP a collection for harvesting: Harvest -s -c collection -t harvest_type -a oai_source -i oai_set_id -m metadata_format");
|
||||
System.out.println("RUN harvest once: Harvest -r -e eperson -c collection");
|
||||
System.out.println("START harvest scheduler: Harvest -S");
|
||||
System.out.println("RESET all harvest status: Harvest -R");
|
||||
System.out.println("PURGE a collection of items and settings: Harvest -p -e eperson -c collection");
|
||||
System.out.println("PURGE all harvestable collections: Harvest -P -e eperson");
|
||||
|
||||
|
||||
|
||||
|
@@ -31,7 +31,7 @@ public class BitstreamFilterByFilename extends BitstreamFilter {
|
||||
*
|
||||
* @param bitstream Bitstream
|
||||
* @return whether bitstream name matches the regular expression
|
||||
* @exception BitstreamFilterException if filter error
|
||||
* @throws BitstreamFilterException if filter error
|
||||
*/
|
||||
@Override
|
||||
public boolean accept(Bitstream bitstream) throws BitstreamFilterException
|
||||
|
@@ -113,7 +113,7 @@ public class ItemUpdate {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param argv commandline args
|
||||
* @param argv the command line arguments given
|
||||
*/
|
||||
public static void main(String[] argv)
|
||||
{
|
||||
@@ -395,6 +395,7 @@ public class ItemUpdate {
|
||||
|
||||
/**
|
||||
* process an archive
|
||||
*
|
||||
* @param context DSpace Context
|
||||
* @param sourceDirPath source path
|
||||
* @param itemField item field
|
||||
@@ -516,7 +517,6 @@ public class ItemUpdate {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* to avoid overwriting the undo source tree on repeated processing
|
||||
* sequence numbers are added and checked
|
||||
*
|
||||
@@ -606,6 +606,7 @@ public class ItemUpdate {
|
||||
* poor man's logging
|
||||
* As with ItemImport, API logging goes through log4j to the DSpace.log files
|
||||
* whereas the batch logging goes to the console to be captured there.
|
||||
*
|
||||
* @param s String
|
||||
*/
|
||||
static void pr(String s)
|
||||
|
@@ -25,7 +25,7 @@ public class CommandRunner
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @param args commandline args
|
||||
* @param args the command line arguments given
|
||||
* @throws IOException if IO error
|
||||
* @throws FileNotFoundException if file doesn't exist
|
||||
*/
|
||||
|
@@ -92,8 +92,9 @@ public class ScriptLauncher
|
||||
|
||||
/**
|
||||
* Recognize and execute a single command.
|
||||
*
|
||||
* @param doc Document
|
||||
* @param args arguments
|
||||
* @param args the command line arguments given
|
||||
*/
|
||||
static int runOneCommand(Document commandConfigs, String[] args)
|
||||
{
|
||||
|
@@ -61,7 +61,7 @@ public abstract class MediaFilter implements FormatFilter
|
||||
* @param generatedBitstream
|
||||
* the bitstream which was generated by
|
||||
* this filter.
|
||||
* @throws java.lang.Exception
|
||||
* @throws Exception if error
|
||||
*/
|
||||
@Override
|
||||
public void postProcessBitstream(Context c, Item item, Bitstream generatedBitstream)
|
||||
|
@@ -24,13 +24,20 @@ public interface RequestItemService {
|
||||
|
||||
/**
|
||||
* Generate a request item representing the request and put it into the DB
|
||||
* @param context context
|
||||
* @param bitstream bitstream
|
||||
* @param item item
|
||||
* @param reqMessage message
|
||||
* @param allFiles all files flag
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param bitstream
|
||||
* The requested bitstream
|
||||
* @param item
|
||||
* The requested item
|
||||
* @param reqMessage
|
||||
* Request message text
|
||||
* @param allFiles
|
||||
* true indicates that all bitstreams of this item are requested
|
||||
* @param reqEmail email
|
||||
* @param reqName name
|
||||
* Requester email
|
||||
* @param reqName
|
||||
* Requester name
|
||||
* @return the token of the request item
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
@@ -41,8 +48,11 @@ public interface RequestItemService {
|
||||
|
||||
/**
|
||||
* Save updates to the record. Only accept_request, and decision_date are set-able.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param requestItem
|
||||
* requested item
|
||||
*/
|
||||
public void update(Context context, RequestItem requestItem);
|
||||
|
||||
|
@@ -212,7 +212,7 @@ 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
|
||||
* @param argv the command line arguments given
|
||||
* @throws Exception if error
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
|
@@ -152,9 +152,10 @@ 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
|
||||
* @param argv the command line arguments given
|
||||
* @throws Exception on generic exception
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public static void main(String [] argv)
|
||||
throws Exception, SQLException
|
||||
|
@@ -30,6 +30,8 @@ public class CollectionDropDown {
|
||||
* Get full path starting from a top-level community via subcommunities down to a collection.
|
||||
* The full path will not be truncated.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param col
|
||||
* Get full path for this collection
|
||||
* @return Full path to the collection
|
||||
@@ -44,6 +46,8 @@ public class CollectionDropDown {
|
||||
* Get full path starting from a top-level community via subcommunities down to a collection.
|
||||
* The full cat will be truncated to the specified number of characters and prepended with an ellipsis.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param col
|
||||
* Get full path for this collection
|
||||
* @param maxchars
|
||||
@@ -84,6 +88,8 @@ public class CollectionDropDown {
|
||||
|
||||
/**
|
||||
* Annotates an array of collections with their respective full paths (@see #collectionPath() method in this class).
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param collections An array of collections to annotate with their hierarchical paths.
|
||||
* The array and all its entries must be non-null.
|
||||
* @return A sorted array of collection path entries (essentially collection/path pairs).
|
||||
|
@@ -36,8 +36,7 @@ public class Configuration
|
||||
* </ul>
|
||||
* If the property does not exist, nothing is written.
|
||||
*
|
||||
* @param argv
|
||||
* command-line arguments
|
||||
* @param argv the command line arguments given
|
||||
*/
|
||||
public static void main(String[] argv)
|
||||
{
|
||||
|
@@ -94,8 +94,10 @@ public class DCInput
|
||||
* a HashMap
|
||||
*
|
||||
* @param fieldMap
|
||||
* ???
|
||||
* named field values.
|
||||
*
|
||||
* @param listMap
|
||||
* value-pairs map, computed from the forms definition XML file
|
||||
*/
|
||||
public DCInput(Map<String, String> fieldMap, Map<String, List<String>> listMap)
|
||||
{
|
||||
|
@@ -120,7 +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
|
||||
* @param fieldName selects the field.
|
||||
* @return true if the current set has the named field
|
||||
*/
|
||||
public boolean isFieldPresent(String fieldName)
|
||||
|
@@ -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
|
||||
*/
|
||||
|
||||
@@ -197,6 +198,9 @@ public class DCInputsReader
|
||||
* Process the top level child nodes in the passed top-level node. These
|
||||
* should correspond to the collection-form maps, the form definitions, and
|
||||
* the display/storage word pairs.
|
||||
*
|
||||
* @param n
|
||||
* top-level DOM node
|
||||
*/
|
||||
private void doNodes(Node n)
|
||||
throws SAXException, DCInputsReaderException
|
||||
@@ -337,7 +341,6 @@ public class DCInputsReader
|
||||
|
||||
// we omit the duplicate validation, allowing multiple fields definition for
|
||||
// the same metadata and different visibility/type-bind
|
||||
|
||||
}
|
||||
}
|
||||
} // ignore any child that is not a 'page'
|
||||
@@ -545,7 +548,6 @@ public class DCInputsReader
|
||||
String errString =
|
||||
"Missing name attribute for value-pairs for DC term " + dcTerm;
|
||||
throw new SAXException(errString);
|
||||
|
||||
}
|
||||
List<String> pairs = new ArrayList<String>();
|
||||
valuePairs.put(pairsName, pairs);
|
||||
@@ -626,7 +628,6 @@ public class DCInputsReader
|
||||
|
||||
// we omit the "required" and "visibility" validation, provided this must be checked in the processing class
|
||||
// only when it makes sense (if the field isn't visible means that it is not applicable, therefore it can't be required)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@ public class DSpaceContextListener implements ServletContextListener
|
||||
/**
|
||||
* Initialize any resources required by the application.
|
||||
* @param event
|
||||
* This is the event class for notifications about changes to the servlet context of a web application.
|
||||
*/
|
||||
@Override
|
||||
public void contextInitialized(ServletContextEvent event)
|
||||
@@ -63,6 +64,7 @@ public class DSpaceContextListener implements ServletContextListener
|
||||
* Clean up resources used by the application when stopped
|
||||
*
|
||||
* @param event
|
||||
8 Event class for notifications about changes to the servlet context of a web application.
|
||||
*/
|
||||
@Override
|
||||
public void contextDestroyed(ServletContextEvent event)
|
||||
|
@@ -229,6 +229,7 @@ public class GoogleMetadata
|
||||
* first-encountered instance of the field for this Item.
|
||||
*
|
||||
* @param fieldName
|
||||
* metadata field name
|
||||
* @return successful?
|
||||
*/
|
||||
protected boolean addSingleField(String fieldName)
|
||||
@@ -291,6 +292,7 @@ public class GoogleMetadata
|
||||
* instead of an aggregate.
|
||||
*
|
||||
* @param configFilter
|
||||
* list of DC metadata fields separated by "|" characters
|
||||
* @return The first configured match of metadata field for the item.
|
||||
*/
|
||||
protected MetadataValue resolveMetadataField(String configFilter)
|
||||
@@ -309,6 +311,7 @@ public class GoogleMetadata
|
||||
* A plural version of resolveMetadata for aggregate fields.
|
||||
*
|
||||
* @param configFilter
|
||||
* list of DC metadata fields separated by "|" characters
|
||||
* @return Aggregate of all matching metadata fields configured in the first
|
||||
* option field-set to return any number of filter matches.
|
||||
*/
|
||||
@@ -328,7 +331,9 @@ public class GoogleMetadata
|
||||
* configuration filter.
|
||||
*
|
||||
* @param configFilter
|
||||
* list of DC metadata fields separated by "|" characters
|
||||
* @param returnType
|
||||
* GoogleMetadata.SINGLE / GoogleMetadata.MULTI / GoogleMetadata.ALL_FIELDS_IN_OPTION
|
||||
* @return Array of configuration to item-field matches
|
||||
*/
|
||||
protected ArrayList<MetadataValue> resolveMetadata(String configFilter,
|
||||
@@ -350,8 +355,7 @@ public class GoogleMetadata
|
||||
|
||||
if (log.isDebugEnabled())
|
||||
{
|
||||
log
|
||||
.debug("Resolved Fields For This Item Per Configuration Filter:");
|
||||
log.debug("Resolved Fields For This Item Per Configuration Filter:");
|
||||
for (int i = 0; i < parsedOptions.size(); i++)
|
||||
{
|
||||
ArrayList<String> optionFields = parsedOptions.get(i);
|
||||
@@ -445,6 +449,7 @@ public class GoogleMetadata
|
||||
* configuration.
|
||||
*
|
||||
* @param configFilter
|
||||
* list of DC metadata fields separated by "|" characters
|
||||
* @return array of parsed options or null
|
||||
*/
|
||||
protected ArrayList<ArrayList<String>> parseOptions(String configFilter)
|
||||
@@ -1004,7 +1009,7 @@ public class GoogleMetadata
|
||||
* is in the default content bundle, and that the item only has one public bitstream
|
||||
* and it is a PDF.
|
||||
*
|
||||
* @param item
|
||||
* @param item item to get PDF URL from
|
||||
* @return URL that the PDF can be directly downloaded from
|
||||
*/
|
||||
protected String getPDFSimpleUrl(Item item)
|
||||
@@ -1045,7 +1050,9 @@ public class GoogleMetadata
|
||||
* <li>the primary bitstream</li>
|
||||
* </ul>
|
||||
* Additionally, this bitstream must be publicly viewable.
|
||||
*
|
||||
* @param item
|
||||
* bitstream's parent item
|
||||
* @return a linkable bitstream or null if none found
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
@@ -1071,6 +1078,13 @@ public class GoogleMetadata
|
||||
return bestSoFar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find out whether bitstream is readable by the public.
|
||||
*
|
||||
* @param bitstream
|
||||
* the target bitstream
|
||||
* @return whether bitstream is readable by the Anonymous group
|
||||
*/
|
||||
protected boolean isPublic(Bitstream bitstream) {
|
||||
if (bitstream == null) {
|
||||
return false;
|
||||
@@ -1122,6 +1136,7 @@ public class GoogleMetadata
|
||||
/**
|
||||
* If metadata field contains multiple values, then add each value to the map separately
|
||||
* @param FIELD
|
||||
* metadata field
|
||||
*/
|
||||
protected void addMultipleValues(String FIELD)
|
||||
{
|
||||
@@ -1201,6 +1216,7 @@ public class GoogleMetadata
|
||||
* metadata practice.
|
||||
*
|
||||
* @param dConfig
|
||||
* configured fields (from google-metadata.properties)
|
||||
* @return item matches configuration
|
||||
*/
|
||||
protected boolean identifyItemType(String dConfig)
|
||||
|
@@ -281,7 +281,9 @@ public class OpenSearchServiceImpl implements OpenSearchService, InitializingBea
|
||||
|
||||
/**
|
||||
* Converts a JDOM document to a W3C one
|
||||
*
|
||||
* @param jdomDoc
|
||||
* jDOM document to convert
|
||||
* @return W3C Document object
|
||||
* @throws IOException if IO error
|
||||
*/
|
||||
|
@@ -39,7 +39,7 @@ public class SubmissionStepConfig implements Serializable
|
||||
|
||||
/**
|
||||
* the id for this step ('id' only exists if this step is defined in the
|
||||
* <step-definitions> section)
|
||||
* <step-definitions> section)
|
||||
*/
|
||||
private String id = null;
|
||||
|
||||
|
@@ -13,13 +13,15 @@ import java.net.Inet6Address;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Quickly tests whether a given IP address matches an IP range. An
|
||||
* {@code IPMatcher} is initialized with a particular IP range specification.
|
||||
* Calls to {@link IPMatcher#match(String) match} method will then quickly
|
||||
* determine whether a given IP falls within that range.
|
||||
* </p>
|
||||
* <p>
|
||||
* Supported range specifications are:
|
||||
* <p>
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>Full IPv4 address, e.g. {@code 12.34.56.78}</li>
|
||||
* <li>Full IPv6 address, e.g. {@code 2001:18e8:3:171:218:8bff:fe2a:56a4}</li>
|
||||
|
@@ -242,8 +242,9 @@ public class AuthorityValue {
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a string that will allow 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 {@link com.atmire.org.dspace.authority.AuthorityValueGenerator#generateRaw(java.lang.String, java.lang.String) AuthorityValueGenerator#generateRaw(java.lang.String, java.lang.String)} for more details.
|
||||
* Provides a string that will allow this AuthorityType to be recognized and
|
||||
* provides information to create a new instance to be created using {@link #newInstance(String)}.
|
||||
* See the implementation of {@link org.dspace.authority.AuthorityValueServiceImpl#generateRaw(java.lang.String, java.lang.String, java.lang.String)} for more details.
|
||||
* @return see {@link org.dspace.authority.service.AuthorityValueService#GENERATE AuthorityValueService.GENERATE}
|
||||
*/
|
||||
public String generateString() {
|
||||
|
@@ -37,6 +37,7 @@ public class AuthorizeException extends Exception
|
||||
* create an exception with only a message
|
||||
*
|
||||
* @param message
|
||||
* Exception message
|
||||
*/
|
||||
public AuthorizeException(String message)
|
||||
{
|
||||
|
@@ -664,16 +664,22 @@ public class AuthorizeServiceImpl implements AuthorizeService
|
||||
* have right on the collection. E.g., if the anonymous can access the collection policies are assigned to anonymous.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param embargoDate
|
||||
* embargo end date
|
||||
* @param reason
|
||||
* embargo reason
|
||||
* @param dso
|
||||
* DSpace object
|
||||
* @param owningCollection
|
||||
* collection to get group policies from
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
*/
|
||||
@Override
|
||||
public void generateAutomaticPolicies(Context context, Date embargoDate,
|
||||
String reason, DSpaceObject dso, Collection owningCollection) throws SQLException, AuthorizeException
|
||||
String reason, DSpaceObject dso, Collection owningCollection)
|
||||
throws SQLException, AuthorizeException
|
||||
{
|
||||
|
||||
if (embargoDate != null || (embargoDate == null && dso instanceof Bitstream))
|
||||
|
@@ -34,7 +34,8 @@ public class FixDefaultPolicies
|
||||
{
|
||||
/**
|
||||
* Command line interface to setPolicies - run to see arguments
|
||||
* @param argv arguments
|
||||
*
|
||||
* @param argv the command line arguments given
|
||||
* @throws Exception if error
|
||||
*/
|
||||
public static void main(String[] argv) throws Exception
|
||||
|
@@ -43,7 +43,8 @@ public class PolicySet
|
||||
|
||||
/**
|
||||
* Command line interface to setPolicies - run to see arguments
|
||||
* @param argv arguments
|
||||
*
|
||||
* @param argv the command line arguments given
|
||||
* @throws Exception if error
|
||||
*/
|
||||
public static void main(String[] argv) throws Exception
|
||||
@@ -130,17 +131,30 @@ public class PolicySet
|
||||
/**
|
||||
*
|
||||
* @param c
|
||||
* current context
|
||||
* @param containerType
|
||||
* type, Constants.ITEM or Constants.COLLECTION
|
||||
* @param containerID
|
||||
* ID of container (DB primary key)
|
||||
* @param contentType
|
||||
* ID of container (DB primary key)
|
||||
* @param actionID
|
||||
* action ID (e.g. Constants.READ)
|
||||
* @param groupID
|
||||
* group ID (database key)
|
||||
* @param isReplace
|
||||
* if <code>true</code>, existing policies are removed first,
|
||||
* otherwise add to existing policies
|
||||
* @param clearOnly
|
||||
* if non-null, only process bitstreams whose names contain filter
|
||||
* @param name
|
||||
* policy name
|
||||
* @param description
|
||||
* policy descrption
|
||||
* @param startDate
|
||||
* policy start date
|
||||
* @param endDate
|
||||
* policy end date
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
*/
|
||||
@@ -166,7 +180,7 @@ public class PolicySet
|
||||
* @param contentType
|
||||
* type (BUNDLE, ITEM, or BITSTREAM)
|
||||
* @param actionID
|
||||
* action ID
|
||||
* action ID (e.g. Constants.READ)
|
||||
* @param groupID
|
||||
* group ID (database key)
|
||||
* @param isReplace
|
||||
@@ -214,9 +228,13 @@ public class PolicySet
|
||||
* @param filter
|
||||
* if non-null, only process bitstreams whose names contain filter
|
||||
* @param name
|
||||
* policy name
|
||||
* @param description
|
||||
* policy description
|
||||
* @param startDate
|
||||
* policy start date
|
||||
* @param endDate
|
||||
* policy end date
|
||||
* @throws SQLException if database error
|
||||
* if database problem
|
||||
* @throws AuthorizeException if authorization error
|
||||
|
@@ -96,6 +96,7 @@ public class ResourcePolicy implements ReloadableEntity<Integer> {
|
||||
* Return true if this object equals obj, false otherwise.
|
||||
*
|
||||
* @param obj
|
||||
* object to compare (eperson, group, start date, end date, ...)
|
||||
* @return true if ResourcePolicy objects are equal
|
||||
*/
|
||||
@Override
|
||||
@@ -156,7 +157,6 @@ public class ResourcePolicy implements ReloadableEntity<Integer> {
|
||||
hash = 19 * hash + this.getEPerson().hashCode();
|
||||
} else {
|
||||
hash = 19 * hash + -1;
|
||||
|
||||
}
|
||||
|
||||
hash = 19 * hash + (this.getStartDate() != null ? this.getStartDate().hashCode() : 0);
|
||||
@@ -185,7 +185,7 @@ public class ResourcePolicy implements ReloadableEntity<Integer> {
|
||||
/**
|
||||
* set the action this policy authorizes
|
||||
*
|
||||
* @param myid action ID from <code>org.dspace.core.Constants</code>
|
||||
* @param myid action ID from {@link org.dspace.core.Constants#Constants Constants}
|
||||
*/
|
||||
public void setAction(int myid)
|
||||
{
|
||||
|
@@ -47,7 +47,8 @@ public interface AuthorizeService {
|
||||
* <code>org.dspace.core.Constants</code>
|
||||
* @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
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public void authorizeAnyOf(Context c, DSpaceObject o, int[] actions) throws AuthorizeException, SQLException;
|
||||
|
||||
@@ -59,8 +60,11 @@ public interface AuthorizeService {
|
||||
* @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
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public void authorizeAction(Context c, DSpaceObject o, int action) throws AuthorizeException, SQLException;
|
||||
|
||||
@@ -75,8 +79,11 @@ public interface AuthorizeService {
|
||||
* 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 the user is denied
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public void authorizeAction(Context c, DSpaceObject o, int action, boolean useInheritance)
|
||||
throws AuthorizeException, SQLException;
|
||||
@@ -93,8 +100,11 @@ public interface AuthorizeService {
|
||||
* 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 the user is denied
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public void authorizeAction(Context c, EPerson e, DSpaceObject o, int action, boolean useInheritance)
|
||||
throws AuthorizeException, SQLException;
|
||||
@@ -109,7 +119,8 @@ public interface AuthorizeService {
|
||||
* <code>org.dspace.core.Constants</code>
|
||||
* @return {@code true} if the current user in the context is
|
||||
* authorized to perform the given action on the given object
|
||||
* @throws SQLException if database error
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public boolean authorizeActionBoolean(Context c, DSpaceObject o, int a) throws SQLException;
|
||||
|
||||
@@ -126,7 +137,8 @@ public interface AuthorizeService {
|
||||
* object can be used
|
||||
* @return {@code true} if the current user in the context is
|
||||
* authorized to perform the given action on the given object
|
||||
* @throws SQLException if database error
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public boolean authorizeActionBoolean(Context c, DSpaceObject o, int a, boolean useInheritance) throws SQLException;
|
||||
|
||||
@@ -144,7 +156,8 @@ public interface AuthorizeService {
|
||||
* object can be used
|
||||
* @return {@code true} if the requested user is
|
||||
* authorized to perform the given action on the given object
|
||||
* @throws SQLException if database error
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public boolean authorizeActionBoolean(Context c, EPerson e, DSpaceObject o, int a, boolean useInheritance) throws SQLException;
|
||||
|
||||
@@ -163,7 +176,8 @@ public interface AuthorizeService {
|
||||
* method
|
||||
* @return {@code true} if user has administrative privileges on the
|
||||
* given DSpace object
|
||||
* @throws SQLException if database error
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public boolean isAdmin(Context c, DSpaceObject o) throws SQLException;
|
||||
|
||||
@@ -176,7 +190,8 @@ public interface AuthorizeService {
|
||||
* @param c current context
|
||||
* @return {@code true} if user is an admin or ignore authorization
|
||||
* flag set
|
||||
* @throws SQLException if database error
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public boolean isAdmin(Context c) throws SQLException;
|
||||
|
||||
@@ -437,6 +452,7 @@ public interface AuthorizeService {
|
||||
* specified object to the new action (toPolicy)
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param dso
|
||||
* the dspace object
|
||||
* @param fromAction
|
||||
@@ -444,7 +460,10 @@ public interface AuthorizeService {
|
||||
* @param toAction
|
||||
* the new action to set
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
void switchPoliciesAction(Context context, DSpaceObject dso, int fromAction, int toAction)
|
||||
throws SQLException, AuthorizeException;
|
||||
|
@@ -155,6 +155,7 @@ public interface BrowseDAO
|
||||
* to only items or values within items that appear in the given container.
|
||||
*
|
||||
* @param containerID
|
||||
* community/collection internal ID (UUID)
|
||||
*/
|
||||
public void setContainerID(UUID containerID);
|
||||
|
||||
@@ -234,7 +235,7 @@ public interface BrowseDAO
|
||||
* normal browse operations can be completed without it. The default is -1, which
|
||||
* means do not offset.
|
||||
*
|
||||
* @return the offset
|
||||
* @return paging offset
|
||||
*/
|
||||
public int getOffset();
|
||||
|
||||
@@ -245,6 +246,7 @@ public interface BrowseDAO
|
||||
* means do not offset.
|
||||
*
|
||||
* @param offset
|
||||
* paging offset
|
||||
*/
|
||||
public void setOffset(int offset);
|
||||
|
||||
|
@@ -139,6 +139,7 @@ public class BrowseInfo
|
||||
* set the number of metadata fields at which to truncate with "et al"
|
||||
*
|
||||
* @param etAl
|
||||
* the number of metadata fields at which to truncate with "et al"
|
||||
*/
|
||||
public void setEtAl(int etAl)
|
||||
{
|
||||
|
@@ -83,7 +83,6 @@ public class DailyReportEmailer
|
||||
* Allows users to have email sent to them. The default is to send all
|
||||
* reports in one email
|
||||
*
|
||||
* @param args
|
||||
* <dl>
|
||||
* <dt>-h</dt>
|
||||
* <dd>help</dd>
|
||||
@@ -99,6 +98,7 @@ public class DailyReportEmailer
|
||||
* <dd>Send all reports in one email</dd>
|
||||
* </dl>
|
||||
*
|
||||
* @param args the command line arguments given
|
||||
*/
|
||||
public static void main(String[] args)
|
||||
{
|
||||
@@ -110,25 +110,17 @@ public class DailyReportEmailer
|
||||
Options options = new Options();
|
||||
|
||||
options.addOption("h", "help", false, "Help");
|
||||
options
|
||||
.addOption("d", "Deleted", false,
|
||||
options.addOption("d", "Deleted", false,
|
||||
"Send E-mail report for all bitstreams set as deleted for today");
|
||||
options
|
||||
.addOption("m", "Missing", false,
|
||||
options.addOption("m", "Missing", false,
|
||||
"Send E-mail report for all bitstreams not found in assetstore for today");
|
||||
options
|
||||
.addOption(
|
||||
"c",
|
||||
"Changed",
|
||||
false,
|
||||
options.addOption("c", "Changed", false,
|
||||
"Send E-mail report for all bitstreams where checksum has been changed for today");
|
||||
options.addOption("a", "All", false, "Send all E-mail reports");
|
||||
|
||||
options.addOption("a", "All", false,
|
||||
"Send all E-mail reports");
|
||||
options.addOption("u", "Unchecked", false,
|
||||
"Send the Unchecked bitstream report");
|
||||
|
||||
options
|
||||
.addOption("n", "Not Processed", false,
|
||||
options.addOption("n", "Not Processed", false,
|
||||
"Send E-mail report for all bitstreams set to longer be processed for today");
|
||||
|
||||
try
|
||||
@@ -147,19 +139,11 @@ public class DailyReportEmailer
|
||||
HelpFormatter myhelp = new HelpFormatter();
|
||||
|
||||
myhelp.printHelp("Checksum Reporter\n", options);
|
||||
System.out
|
||||
.println("\nSend Deleted bitstream email report: DailyReportEmailer -d");
|
||||
System.out
|
||||
.println("\nSend Missing bitstreams email report: DailyReportEmailer -m");
|
||||
System.out
|
||||
.println("\nSend Checksum Changed email report: DailyReportEmailer -c");
|
||||
|
||||
System.out
|
||||
.println("\nSend bitstream not to be processed email report: DailyReportEmailer -n");
|
||||
|
||||
System.out
|
||||
.println("\nSend Un-checked bitstream report: DailyReportEmailer -u");
|
||||
|
||||
System.out.println("\nSend Deleted bitstream email report: DailyReportEmailer -d");
|
||||
System.out.println("\nSend Missing bitstreams email report: DailyReportEmailer -m");
|
||||
System.out.println("\nSend Checksum Changed email report: DailyReportEmailer -c");
|
||||
System.out.println("\nSend bitstream not to be processed email report: DailyReportEmailer -n");
|
||||
System.out.println("\nSend Un-checked bitstream report: DailyReportEmailer -u");
|
||||
System.out.println("\nSend All email reports: DailyReportEmailer");
|
||||
System.exit(0);
|
||||
}
|
||||
@@ -208,27 +192,17 @@ public class DailyReportEmailer
|
||||
|
||||
if ((line.hasOption("a")) || (line.getOptions().length == 0))
|
||||
{
|
||||
writer
|
||||
.write("\n--------------------------------- Begin Reporting ------------------------\n\n");
|
||||
numBitstreams += reporter.getDeletedBitstreamReport(context, yesterday,
|
||||
tomorrow, writer);
|
||||
writer
|
||||
.write("\n--------------------------------- Report Spacer ---------------------------\n\n");
|
||||
numBitstreams += reporter.getChangedChecksumReport(context, yesterday,
|
||||
tomorrow, writer);
|
||||
writer
|
||||
.write("\n--------------------------------- Report Spacer ---------------------------\n\n");
|
||||
numBitstreams += reporter.getBitstreamNotFoundReport(context, yesterday,
|
||||
tomorrow, writer);
|
||||
writer
|
||||
.write("\n--------------------------------- Report Spacer ---------------------------\n\n");
|
||||
numBitstreams += reporter.getNotToBeProcessedReport(context, yesterday,
|
||||
tomorrow, writer);
|
||||
writer
|
||||
.write("\n--------------------------------- Report Spacer ---------------------------\n\n");
|
||||
writer.write("\n--------------------------------- Begin Reporting ------------------------\n\n");
|
||||
numBitstreams += reporter.getDeletedBitstreamReport(context, yesterday, tomorrow, writer);
|
||||
writer.write("\n--------------------------------- Report Spacer ---------------------------\n\n");
|
||||
numBitstreams += reporter.getChangedChecksumReport(context, yesterday, tomorrow, writer);
|
||||
writer.write("\n--------------------------------- Report Spacer ---------------------------\n\n");
|
||||
numBitstreams += reporter.getBitstreamNotFoundReport(context, yesterday, tomorrow, writer);
|
||||
writer.write("\n--------------------------------- Report Spacer ---------------------------\n\n");
|
||||
numBitstreams += reporter.getNotToBeProcessedReport(context, yesterday, tomorrow, writer);
|
||||
writer.write("\n--------------------------------- Report Spacer ---------------------------\n\n");
|
||||
numBitstreams += reporter.getUncheckedBitstreamsReport(context, writer);
|
||||
writer
|
||||
.write("\n--------------------------------- End Report ---------------------------\n\n");
|
||||
writer.write("\n--------------------------------- End Report ---------------------------\n\n");
|
||||
writer.flush();
|
||||
writer.close();
|
||||
emailer.sendReport(report, numBitstreams);
|
||||
@@ -237,8 +211,7 @@ public class DailyReportEmailer
|
||||
{
|
||||
if (line.hasOption("d"))
|
||||
{
|
||||
writer
|
||||
.write("\n--------------------------------- Begin Reporting ------------------------\n\n");
|
||||
writer.write("\n--------------------------------- Begin Reporting ------------------------\n\n");
|
||||
numBitstreams += reporter.getDeletedBitstreamReport(context,
|
||||
yesterday, tomorrow, writer);
|
||||
writer.flush();
|
||||
@@ -248,8 +221,7 @@ public class DailyReportEmailer
|
||||
|
||||
if (line.hasOption("m"))
|
||||
{
|
||||
writer
|
||||
.write("\n--------------------------------- Begin Reporting ------------------------\n\n");
|
||||
writer.write("\n--------------------------------- Begin Reporting ------------------------\n\n");
|
||||
numBitstreams += reporter.getBitstreamNotFoundReport(context,
|
||||
yesterday, tomorrow, writer);
|
||||
writer.flush();
|
||||
@@ -259,8 +231,7 @@ public class DailyReportEmailer
|
||||
|
||||
if (line.hasOption("c"))
|
||||
{
|
||||
writer
|
||||
.write("\n--------------------------------- Begin Reporting ------------------------\n\n");
|
||||
writer.write("\n--------------------------------- Begin Reporting ------------------------\n\n");
|
||||
numBitstreams += reporter.getChangedChecksumReport(context,
|
||||
yesterday, tomorrow, writer);
|
||||
writer.flush();
|
||||
@@ -270,8 +241,7 @@ public class DailyReportEmailer
|
||||
|
||||
if (line.hasOption("n"))
|
||||
{
|
||||
writer
|
||||
.write("\n--------------------------------- Begin Reporting ------------------------\n\n");
|
||||
writer.write("\n--------------------------------- Begin Reporting ------------------------\n\n");
|
||||
numBitstreams += reporter.getNotToBeProcessedReport(context,
|
||||
yesterday, tomorrow, writer);
|
||||
writer.flush();
|
||||
@@ -281,8 +251,7 @@ public class DailyReportEmailer
|
||||
|
||||
if (line.hasOption("u"))
|
||||
{
|
||||
writer
|
||||
.write("\n--------------------------------- Begin Reporting ------------------------\n\n");
|
||||
writer.write("\n--------------------------------- Begin Reporting ------------------------\n\n");
|
||||
numBitstreams += reporter
|
||||
.getUncheckedBitstreamsReport(context, writer);
|
||||
writer.flush();
|
||||
@@ -294,7 +263,8 @@ public class DailyReportEmailer
|
||||
catch (MessagingException | SQLException | IOException e)
|
||||
{
|
||||
log.fatal(e);
|
||||
} finally
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (context != null && context.isValid())
|
||||
{
|
||||
|
@@ -30,8 +30,11 @@ public interface ChecksumHistoryDAO extends GenericDAO<ChecksumHistory> {
|
||||
* the specified result code.
|
||||
*
|
||||
* @param context
|
||||
* @param retentionDate row must be older than this to be deleted.
|
||||
* @param checksumResultCode row must have this result to be deleted.
|
||||
* The relevant DSpace Context.
|
||||
* @param retentionDate
|
||||
* row must be older than this to be deleted.
|
||||
* @param checksumResultCode
|
||||
* row must have this result to be deleted.
|
||||
* @return number of rows deleted.
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
@@ -41,7 +44,9 @@ public interface ChecksumHistoryDAO extends GenericDAO<ChecksumHistory> {
|
||||
* Delete all ChecksumHistory rows for the given Bitstream.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param bitstream
|
||||
* which bitstream's checksums to delete
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
public void deleteByBitstream(Context context, Bitstream bitstream) throws SQLException;
|
||||
|
@@ -345,6 +345,7 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
* bitstream is uncertain, and the format is set to "unknown."
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param desc
|
||||
* the user's description of the format
|
||||
* @throws SQLException if database error
|
||||
|
@@ -379,12 +379,13 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
||||
* Get the value of a metadata field
|
||||
*
|
||||
* @param collection
|
||||
* which collection to operate on
|
||||
* @param field
|
||||
* the name of the metadata field to get
|
||||
*
|
||||
* @return the value of the metadata field
|
||||
*
|
||||
* @exception IllegalArgumentException
|
||||
* @throws IllegalArgumentException
|
||||
* if the requested metadata field doesn't exist
|
||||
*/
|
||||
@Override
|
||||
|
@@ -594,7 +594,6 @@ public class DCDate
|
||||
* Get a date representing the current instant in time.
|
||||
*
|
||||
* @return a DSpaceDate object representing the current instant.
|
||||
|
||||
*/
|
||||
public static DCDate getCurrent()
|
||||
{
|
||||
@@ -607,9 +606,8 @@ public class DCDate
|
||||
*
|
||||
* @param m
|
||||
* the month number
|
||||
*
|
||||
* @param locale
|
||||
*
|
||||
* which locale to render the month name in
|
||||
* @return the month name.
|
||||
*/
|
||||
public static String getMonthName(int m, Locale locale)
|
||||
|
@@ -149,8 +149,8 @@ public class ItemComparator implements Comparator, Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* @param first
|
||||
* @param second
|
||||
* @param first first operand
|
||||
* @param second second operand
|
||||
* @return true if the first string is equal to the second. Either or both
|
||||
* may be null.
|
||||
*/
|
||||
@@ -224,7 +224,8 @@ public class ItemComparator implements Comparator, Serializable
|
||||
|
||||
/**
|
||||
* Normalize the title of a Metadatum.
|
||||
* @param value
|
||||
*
|
||||
* @param value metadata value
|
||||
* @return normalized title
|
||||
*/
|
||||
protected String normalizeTitle(MetadataValue value)
|
||||
|
@@ -932,10 +932,13 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
||||
|
||||
/**
|
||||
* Check if the item is an inprogress submission
|
||||
*
|
||||
* @param context
|
||||
* @param item
|
||||
* The relevant DSpace Context.
|
||||
* @param item item to check
|
||||
* @return <code>true</code> if the item is an inprogress submission, i.e. a WorkspaceItem or WorkflowItem
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public boolean isInProgressSubmission(Context context, Item item) throws SQLException {
|
||||
return workspaceItemService.findByItem(context, item) != null
|
||||
@@ -943,7 +946,7 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
||||
}
|
||||
|
||||
/*
|
||||
With every finished submission a bunch of resource policy entries with have null value for the dspace_object column are generated in the database.
|
||||
With every finished submission a bunch of resource policy entries which have null value for the dspace_object column are generated in the database.
|
||||
prevent the generation of resource policy entry values with null dspace_object as value
|
||||
|
||||
*/
|
||||
@@ -952,10 +955,16 @@ prevent the generation of resource policy entry values with null dspace_object a
|
||||
* Add the default policies, which have not been already added to the given DSpace object
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param dso
|
||||
* The DSpace Object to add policies to
|
||||
* @param defaultCollectionPolicies
|
||||
* list of policies
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
protected void addDefaultPoliciesNotInPlace(Context context, DSpaceObject dso, List<ResourcePolicy> defaultCollectionPolicies) throws SQLException, AuthorizeException
|
||||
{
|
||||
@@ -983,8 +992,12 @@ prevent the generation of resource policy entry values with null dspace_object a
|
||||
* @param value field value or Item.ANY to match any value
|
||||
* @return an iterator over the items matching that authority value
|
||||
* @throws SQLException if database error
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException if authorization error
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
* @throws IOException if IO error
|
||||
* A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
|
@@ -57,10 +57,15 @@ public class LicenseUtils
|
||||
* LicenseArgumentFormatter based on his type (map key)
|
||||
*
|
||||
* @param locale
|
||||
* Formatter locale
|
||||
* @param collection
|
||||
* collection to get license from
|
||||
* @param item
|
||||
* the item object of the license
|
||||
* @param eperson
|
||||
* EPerson to get firstname, lastname and email from
|
||||
* @param additionalInfo
|
||||
* additional template arguments beyond 0-6
|
||||
* @return the license text obtained substituting the provided argument in
|
||||
* the license template
|
||||
*/
|
||||
@@ -104,9 +109,13 @@ public class LicenseUtils
|
||||
* supplying {@code null} for the additionalInfo argument)
|
||||
*
|
||||
* @param locale
|
||||
* Formatter locale
|
||||
* @param collection
|
||||
* collection to get license from
|
||||
* @param item
|
||||
* the item object of the license
|
||||
* @param eperson
|
||||
* EPerson to get firstname, lastname and email from
|
||||
* @return the license text, with no custom substitutions.
|
||||
*/
|
||||
public static String getLicenseText(Locale locale, Collection collection,
|
||||
|
@@ -27,6 +27,7 @@ public class NonUniqueMetadataException extends Exception
|
||||
* Create an exception with only a message
|
||||
*
|
||||
* @param message
|
||||
* message string
|
||||
*/
|
||||
public NonUniqueMetadataException(String message)
|
||||
{
|
||||
|
@@ -57,6 +57,21 @@ public class CrosswalkMetadataValidator {
|
||||
/**
|
||||
* Scans metadata for elements not defined in this DSpace instance. It then takes action based
|
||||
* on a configurable parameter (fail, ignore, add).
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param schema metadata field schema
|
||||
* @param element metadata field element
|
||||
* @param qualifier metadata field qualifier
|
||||
* @param forceCreate if true, force addinga schema or metadata field
|
||||
* @return metadata field
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
* @throws CrosswalkException
|
||||
* Superclass for more-specific crosswalk exceptions.
|
||||
*/
|
||||
public MetadataField checkMetadata(Context context, String schema, String element, String qualifier, boolean forceCreate) throws SQLException, AuthorizeException, CrosswalkException {
|
||||
if (!validatedBefore(schema, element, qualifier)) {
|
||||
|
@@ -402,9 +402,13 @@ public class METSRightsCrosswalk
|
||||
* Ingest a whole XML document, starting at specified root.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param dso
|
||||
* DSpace object to ingest
|
||||
* @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
|
||||
|
@@ -311,7 +311,7 @@ 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 CrosswalkException if crosswalk error
|
||||
* @throws IOException if IO error
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
|
@@ -32,6 +32,7 @@ public interface ParameterizedDisseminationCrosswalk
|
||||
* <p>
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param dso the DSpace Object whose metadata to export.
|
||||
* @param parameters
|
||||
* names and values of parameters to be passed into the transform.
|
||||
|
@@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory;
|
||||
* Configurable XSLT-driven dissemination Crosswalk
|
||||
* <p>
|
||||
* See the XSLTCrosswalk superclass for details on configuration.
|
||||
* <p>
|
||||
* </p>
|
||||
* <h3>Additional Configuration of Dissemination crosswalk:</h3>
|
||||
* The disseminator also needs to be configured with an XML Namespace
|
||||
* (including prefix and URI) and an XML Schema for output format. This
|
||||
@@ -524,7 +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
|
||||
*
|
||||
* @param argv the command line arguments given
|
||||
* @throws Exception if error
|
||||
*/
|
||||
public static void main(String[] argv) throws Exception
|
||||
|
@@ -293,7 +293,8 @@ public class XSLTIngestionCrosswalk
|
||||
/**
|
||||
* Simple command-line rig for testing the DIM output of a stylesheet.
|
||||
* Usage: {@code java XSLTIngestionCrosswalk <crosswalk-name> <input-file>}
|
||||
* @param argv arguments
|
||||
*
|
||||
* @param argv the command line arguments given
|
||||
* @throws Exception if error
|
||||
*/
|
||||
public static void main(String[] argv) throws Exception
|
||||
|
@@ -15,7 +15,7 @@ import org.dspace.core.GenericDAO;
|
||||
* All DSpaceObject DAO classes should implement this class since it ensures that the T object is of type DSpaceObject
|
||||
*
|
||||
* @author kevinvandevelde at atmire.com
|
||||
* @param <T>
|
||||
* @param <T> some implementation of DSpaceObject
|
||||
*/
|
||||
public interface DSpaceObjectDAO<T extends DSpaceObject> extends GenericDAO<T> {
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ import java.sql.SQLException;
|
||||
* to identify DSpaceObjects prior to DSpace 6.0
|
||||
*
|
||||
* @author kevinvandevelde at atmire.com
|
||||
* @param <T>
|
||||
* @param <T> some implementation of DSpaceObject
|
||||
*/
|
||||
public interface DSpaceObjectLegacySupportDAO<T extends DSpaceObject> extends DSpaceObjectDAO<T> {
|
||||
|
||||
|
@@ -106,6 +106,7 @@ public abstract class AbstractMETSIngester extends AbstractPackageIngester
|
||||
protected final WorkspaceItemService workspaceItemService = ContentServiceFactory.getInstance().getWorkspaceItemService();
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* An instance of ZipMdrefManager holds the state needed to retrieve the
|
||||
* contents of an external metadata stream referenced by an
|
||||
* <code>mdRef</code> element in a Zipped up METS manifest.
|
||||
@@ -1547,7 +1548,8 @@ public abstract class AbstractMETSIngester extends AbstractPackageIngester
|
||||
*
|
||||
* @param context the DSpace context
|
||||
* @param dso DSpace Object
|
||||
* @param manifest the METSManifest
|
||||
* @param manifest
|
||||
* the METSManifest
|
||||
* @param callback
|
||||
* the MdrefManager (manages all external metadata files
|
||||
* referenced by METS <code>mdref</code> elements)
|
||||
@@ -1555,6 +1557,7 @@ public abstract class AbstractMETSIngester extends AbstractPackageIngester
|
||||
* array of Elements, each a METS <code>dmdSec</code> that
|
||||
* applies to the Item as a whole.
|
||||
* @param params
|
||||
* Packager Parameters
|
||||
* @throws CrosswalkException if crosswalk error
|
||||
* @throws PackageValidationException if package validation error
|
||||
* @throws IOException if IO error
|
||||
@@ -1590,6 +1593,7 @@ public abstract class AbstractMETSIngester extends AbstractPackageIngester
|
||||
* @param license
|
||||
* optional user-supplied Deposit License text (may be null)
|
||||
* @param params
|
||||
* Packager Parameters
|
||||
* @throws PackageValidationException if package validation error
|
||||
* @throws IOException if IO error
|
||||
* @throws SQLException if database error
|
||||
|
@@ -454,6 +454,7 @@ public class DSpaceAIPDisseminator extends AbstractMETSDisseminator
|
||||
* @throws IOException if IO error
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @throws MetsException
|
||||
* METS Java toolkit exception class.
|
||||
*/
|
||||
@Override
|
||||
public void addStructMap(Context context, DSpaceObject dso,
|
||||
|
@@ -95,6 +95,21 @@ public class DSpaceAIPIngester
|
||||
* 3. If (1) or (2) succeeds, crosswalk it and ignore all other DMDs with
|
||||
* same GROUPID<br>
|
||||
* 4. Crosswalk remaining DMDs not eliminated already.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param dso
|
||||
* DSpace object
|
||||
* @param manifest
|
||||
* the METSManifest
|
||||
* @param callback
|
||||
* the MdrefManager (manages all external metadata files
|
||||
* referenced by METS <code>mdref</code> elements)
|
||||
* @param dmds
|
||||
* array of Elements, each a METS <code>dmdSec</code> that
|
||||
* applies to the Item as a whole.
|
||||
* @param params
|
||||
* Packager Parameters
|
||||
* @throws PackageValidationException validation error
|
||||
* @throws CrosswalkException if crosswalk error
|
||||
* @throws IOException if IO error
|
||||
@@ -198,6 +213,15 @@ public class DSpaceAIPIngester
|
||||
* license supplied by explicit argument next, else use collection's
|
||||
* default deposit license.
|
||||
* Normally the rightsMD crosswalks should provide a license.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param item
|
||||
* item to add license to
|
||||
* @param collection
|
||||
* collection to get the default license from
|
||||
* @param params
|
||||
* Packager Parameters
|
||||
* @throws PackageValidationException validation error
|
||||
* @throws IOException if IO error
|
||||
* @throws SQLException if database error
|
||||
@@ -233,19 +257,30 @@ public class DSpaceAIPIngester
|
||||
|
||||
/**
|
||||
* Last change to fix up a DSpace Object.
|
||||
* <P>
|
||||
* <p>
|
||||
* For AIPs, if the object is an Item, we may want to make sure all of its
|
||||
* metadata fields already exist in the database (otherwise, the database
|
||||
* will throw errors when we attempt to save/update the Item)
|
||||
* </p>
|
||||
*
|
||||
* @param context DSpace Context
|
||||
* @param dso DSpace object
|
||||
* @param params Packager Parameters
|
||||
* @throws org.dspace.content.packager.PackageValidationException
|
||||
* @throws java.sql.SQLException
|
||||
* @throws org.dspace.content.crosswalk.CrosswalkException
|
||||
* @throws java.io.IOException
|
||||
* @throws org.dspace.authorize.AuthorizeException
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param dso
|
||||
* DSpace object
|
||||
* @param params
|
||||
* Packager Parameters
|
||||
* @throws PackageValidationException
|
||||
* Failure when importing or exporting a package
|
||||
* caused by invalid unacceptable package format or contents
|
||||
* @throws CrosswalkException
|
||||
* Superclass for more-specific crosswalk exceptions.
|
||||
* @throws IOException
|
||||
* A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
@Override
|
||||
public void finishObject(Context context, DSpaceObject dso, PackageParameters params)
|
||||
|
@@ -8,15 +8,18 @@
|
||||
package org.dspace.content.packager;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* This represents a failure when importing or exporting a package
|
||||
* caused by invalid unacceptable package format or contents; for
|
||||
* example, missing files that were mentioned in the manifest, or
|
||||
* extra files not in manifest, or lack of a manifest.
|
||||
* </p>
|
||||
* <p>
|
||||
* When throwing a PackageValidationException, be sure the message
|
||||
* includes enough specific information to let the end user diagnose
|
||||
* the problem, i.e. what files appear to be missing from the manifest
|
||||
* or package, or the details of a checksum error on a file.
|
||||
* </p>
|
||||
*
|
||||
* @author Larry Stone
|
||||
* @version $Revision$
|
||||
|
@@ -430,6 +430,7 @@ public class RoleIngester implements PackageIngester
|
||||
* @param context DSpace Context
|
||||
* @param parent the Parent DSpaceObject
|
||||
* @param params package params
|
||||
* @param stream input stream with the roles
|
||||
* @throws PackageException if packaging error
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
|
@@ -77,8 +77,11 @@ public interface CollectionService extends DSpaceObjectService<Collection>, DSpa
|
||||
/**
|
||||
* Get all collections in the system. Adds support for limit and offset.
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param limit
|
||||
* paging limit
|
||||
* @param offset
|
||||
* paging offset
|
||||
* @return List of Collections
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
|
@@ -104,7 +104,7 @@ public interface CommunityService extends DSpaceObjectService<Community>, DSpace
|
||||
*
|
||||
* @return the value of the metadata field
|
||||
*
|
||||
* @exception IllegalArgumentException
|
||||
* @throws IllegalArgumentException
|
||||
* if the requested metadata field doesn't exist
|
||||
* @deprecated
|
||||
*/
|
||||
@@ -123,9 +123,9 @@ public interface CommunityService extends DSpaceObjectService<Community>, DSpace
|
||||
* @param value
|
||||
* value to set the field to
|
||||
*
|
||||
* @exception IllegalArgumentException
|
||||
* @throws IllegalArgumentException
|
||||
* if the requested metadata field doesn't exist
|
||||
* @exception java.util.MissingResourceException
|
||||
* @throws MissingResourceException if resource missing
|
||||
* @throws SQLException if database error
|
||||
* @deprecated
|
||||
*/
|
||||
@@ -192,7 +192,12 @@ public interface CommunityService extends DSpaceObjectService<Community>, DSpace
|
||||
/**
|
||||
* Return an array of parent communities of this collection.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param collection
|
||||
* collection to check
|
||||
* @return an array of parent communities
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
public List<Community> getAllParents(Context context, Collection collection) throws SQLException;
|
||||
|
||||
|
@@ -181,7 +181,7 @@ public interface DSpaceObjectService<T extends DSpaceObject> {
|
||||
*
|
||||
* @return the value of the metadata field (or null if the column is an SQL NULL)
|
||||
*
|
||||
* @exception IllegalArgumentException
|
||||
* @throws IllegalArgumentException
|
||||
* if the requested metadata field doesn't exist
|
||||
*/
|
||||
public String getMetadata(T dSpaceObject, String value);
|
||||
|
@@ -53,7 +53,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param collection Collection (parent)
|
||||
* @return Item
|
||||
* @return empty template item for this collection
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
*/
|
||||
@@ -96,8 +96,10 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
|
||||
/**
|
||||
* Retrieve the list of items submitted by eperson, ordered by recently submitted, optionally limitable
|
||||
* @param context context
|
||||
* @param eperson eperson
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param eperson
|
||||
* the submitter
|
||||
* @param limit a positive integer to limit, -1 or null for unlimited
|
||||
* @return an iterator over the items submitted by eperson
|
||||
* @throws SQLException if database error
|
||||
@@ -128,7 +130,8 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
|
||||
/**
|
||||
* Get all Items installed or withdrawn, discoverable, and modified since a Date.
|
||||
* @param context context
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param since earliest interesting last-modified date, or null for no date test.
|
||||
* @return an iterator over the items in the collection.
|
||||
* @throws SQLException if database error
|
||||
@@ -148,7 +151,8 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
|
||||
/**
|
||||
* See whether this Item is contained by a given Collection.
|
||||
* @param item Item
|
||||
*
|
||||
* @param item item to check
|
||||
* @param collection Collection (parent
|
||||
* @return true if {@code collection} contains this Item.
|
||||
* @throws SQLException if database error
|
||||
@@ -161,7 +165,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* communities of the owning collections.
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to check
|
||||
* @return the communities this item is in.
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
@@ -171,7 +175,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
/**
|
||||
* Get the bundles matching a bundle name (name corresponds roughly to type)
|
||||
*
|
||||
* @param item Item
|
||||
* @param item item to check
|
||||
* @param name
|
||||
* name of bundle (ORIGINAL/TEXT/THUMBNAIL)
|
||||
* @throws SQLException if database error
|
||||
@@ -184,7 +188,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* Add an existing bundle to this item. This has immediate effect.
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to add the bundle to
|
||||
* @param bundle
|
||||
* the bundle to add
|
||||
* @throws SQLException if database error
|
||||
@@ -210,9 +214,10 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
/**
|
||||
* Remove all bundles linked to this item. This may result in the bundle being deleted, if the
|
||||
* bundle is orphaned.
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item
|
||||
* the item from which to remove our bundles
|
||||
* the item from which to remove all bundles
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @throws IOException if IO error
|
||||
@@ -224,7 +229,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* method for the most common use.
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to create bitstream on
|
||||
* @param is
|
||||
* the stream to create the new bitstream from
|
||||
* @param name
|
||||
@@ -241,7 +246,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* Convenience method, calls createSingleBitstream() with name "ORIGINAL"
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to create bitstream on
|
||||
* @param is
|
||||
* InputStream
|
||||
* @return created bitstream
|
||||
@@ -256,8 +261,9 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* Get all non-internal bitstreams in the item. This is mainly used for
|
||||
* auditing for provenance messages and adding format.* DC values. The order
|
||||
* is indeterminate.
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to check
|
||||
* @return non-internal bitstreams.
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
@@ -271,7 +277,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* This method is used by the org.dspace.submit.step.LicenseStep class
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to remove DSpace license from
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @throws IOException if IO error
|
||||
@@ -283,7 +289,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* Remove all licenses from an item - it was rejected
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to remove all licenses from
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @throws IOException if IO error
|
||||
@@ -295,7 +301,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* and metadata are not deleted, but it is not publicly accessible.
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to withdraw
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
*/
|
||||
@@ -306,7 +312,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* Reinstate a withdrawn item
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item withdrawn item to reinstate
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
*/
|
||||
@@ -315,7 +321,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
/**
|
||||
* Return true if this Collection 'owns' this item
|
||||
*
|
||||
* @param item Item
|
||||
* @param item item to check
|
||||
* @param collection
|
||||
* Collection
|
||||
* @return true if this Collection owns this item
|
||||
@@ -327,7 +333,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* policies
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to replace policies on
|
||||
* @param newpolicies -
|
||||
* this will be all of the new policies for the item and its
|
||||
* contents
|
||||
@@ -342,7 +348,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* them with a new list of policies
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to replace policies on
|
||||
* @param newpolicies -
|
||||
* this will be all of the new policies for the bundle and
|
||||
* bitstream contents
|
||||
@@ -358,7 +364,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* to a given Group
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to remove group policies from
|
||||
* @param group
|
||||
* Group referenced by policies that needs to be removed
|
||||
* @throws SQLException if database error
|
||||
@@ -372,7 +378,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* the collection.
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to reset policies on
|
||||
* @param collection
|
||||
* Collection
|
||||
* @throws SQLException if database error
|
||||
@@ -392,7 +398,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* Moves the item from one collection to another one
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to move
|
||||
* @param from Collection to move from
|
||||
* @param to Collection to move to
|
||||
* @throws SQLException if database error
|
||||
@@ -405,7 +411,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* Moves the item from one collection to another one
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to move
|
||||
* @param from Collection to move from
|
||||
* @param to Collection to move to
|
||||
* @param inheritDefaultPolicies whether to inherit policies from new collection
|
||||
@@ -418,7 +424,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
/**
|
||||
* Check the bundle ORIGINAL to see if there are any uploaded files
|
||||
*
|
||||
* @param item Item
|
||||
* @param item item to check
|
||||
* @return true if there is a bundle named ORIGINAL with one or more
|
||||
* bitstreams inside
|
||||
* @throws SQLException if database error
|
||||
@@ -429,7 +435,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* Get the collections this item is not in.
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to check
|
||||
* @return the collections this item is not in, if any.
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
@@ -439,7 +445,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* return TRUE if context's user can edit item, false otherwise
|
||||
*
|
||||
* @param context DSpace context object
|
||||
* @param item Item
|
||||
* @param item item to check
|
||||
* @return boolean true = current user can edit item
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
@@ -448,8 +454,10 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
/**
|
||||
* return TRUE if context's user can create new version of the item, false
|
||||
* otherwise.
|
||||
* @param context DSpace context object
|
||||
* @param item item to check
|
||||
* @return boolean true = current user can create new version of the item
|
||||
* @throws SQLException
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
public boolean canCreateNewVersion(Context context, Item item) throws SQLException;
|
||||
|
||||
@@ -500,7 +508,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
* Service method for knowing if this Item should be visible in the item list.
|
||||
* Items only show up in the "item list" if the user has READ permission
|
||||
* and if the Item isn't flagged as unlisted.
|
||||
* @param context context
|
||||
* @param context DSpace context object
|
||||
* @param item item
|
||||
* @return true or false
|
||||
*/
|
||||
@@ -519,7 +527,7 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
/**
|
||||
* Find all Items modified since a Date.
|
||||
*
|
||||
* @param context context
|
||||
* @param context DSpace context object
|
||||
* @param last Earliest interesting last-modified date.
|
||||
* @return iterator over items
|
||||
* @throws SQLException if database error
|
||||
@@ -566,9 +574,10 @@ public interface ItemService extends DSpaceObjectService<Item>, DSpaceObjectLega
|
||||
|
||||
/**
|
||||
* Check if the supplied item is an inprogress submission
|
||||
* @param context
|
||||
* @param item
|
||||
* @param context DSpace context object
|
||||
* @param item item to check
|
||||
* @return <code>true</code> if the item is linked to a workspaceitem or workflowitem
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
boolean isInProgressSubmission(Context context, Item item) throws SQLException;
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ public interface MetadataFieldService {
|
||||
* @return new MetadataField
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @throws SQLException if database error
|
||||
* @throws NonUniqueMetadataException
|
||||
* @throws NonUniqueMetadataException if an existing field with an identical element and qualifier is already present
|
||||
*/
|
||||
public MetadataField create(Context context, MetadataSchema metadataSchema, String element, String qualifier, String scopeNote)
|
||||
throws AuthorizeException, SQLException, NonUniqueMetadataException;
|
||||
@@ -102,7 +102,7 @@ public interface MetadataFieldService {
|
||||
* @param metadataField metadata field
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @throws NonUniqueMetadataException
|
||||
* @throws NonUniqueMetadataException if an existing field with an identical element and qualifier is already present
|
||||
* @throws IOException if IO error
|
||||
*/
|
||||
public void update(Context context, MetadataField metadataField)
|
||||
|
@@ -33,7 +33,7 @@ public interface MetadataSchemaService {
|
||||
* @return new MetadataSchema
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @throws NonUniqueMetadataException
|
||||
* @throws NonUniqueMetadataException if an existing field with an identical element and qualifier is already present
|
||||
*/
|
||||
public MetadataSchema create(Context context, String name, String namespace) throws SQLException, AuthorizeException, NonUniqueMetadataException;
|
||||
|
||||
@@ -54,7 +54,7 @@ public interface MetadataSchemaService {
|
||||
* @param metadataSchema metadata schema
|
||||
* @throws SQLException if database error
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @throws NonUniqueMetadataException
|
||||
* @throws NonUniqueMetadataException if an existing field with an identical element and qualifier is already present
|
||||
*/
|
||||
public void update(Context context, MetadataSchema metadataSchema) throws SQLException, AuthorizeException, NonUniqueMetadataException;
|
||||
|
||||
|
@@ -43,7 +43,7 @@ public interface MetadataValueService {
|
||||
* @param context dspace context
|
||||
* @param valueId database key id of value
|
||||
* @return recalled metadata value
|
||||
* @throws java.io.IOException
|
||||
* @throws IOException if IO error
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
public MetadataValue find(Context context, int valueId)
|
||||
@@ -89,7 +89,7 @@ public interface MetadataValueService {
|
||||
/**
|
||||
* Get the minimum value of a given metadata field across all objects.
|
||||
*
|
||||
* @param context
|
||||
* @param context dspace context
|
||||
* @param metadataFieldId unique identifier of the interesting field.
|
||||
* @return the minimum value of the metadata field
|
||||
* @throws SQLException if database error
|
||||
|
@@ -143,6 +143,7 @@ public interface WorkspaceItemService extends InProgressSubmissionService<Worksp
|
||||
/**
|
||||
* The map entry returned contains stage reached as the key and count of items in that stage as a value
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @return the map
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
|
@@ -94,7 +94,9 @@ public abstract class AbstractHibernateDAO<T> implements GenericDAO<T> {
|
||||
* Execute a JPA Criteria query and return a collection of results.
|
||||
*
|
||||
* @param context
|
||||
* @param query JPQL query string
|
||||
* The relevant DSpace Context.
|
||||
* @param query
|
||||
* JPQL query string
|
||||
* @return list of DAOs specified by the query string
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
@@ -134,7 +136,7 @@ public abstract class AbstractHibernateDAO<T> implements GenericDAO<T> {
|
||||
* Retrieve a unique result from the query. If multiple results CAN be
|
||||
* retrieved an exception will be thrown,
|
||||
* so only use when the criteria state uniqueness in the database.
|
||||
* @param criteria
|
||||
* @param criteria JPA criteria
|
||||
* @return a DAO specified by the criteria
|
||||
*/
|
||||
public T uniqueResult(Criteria criteria)
|
||||
@@ -147,7 +149,7 @@ public abstract class AbstractHibernateDAO<T> implements GenericDAO<T> {
|
||||
/**
|
||||
* Retrieve a single result from the query. Best used if you expect a
|
||||
* single result, but this isn't enforced on the database.
|
||||
* @param criteria
|
||||
* @param criteria JPA criteria
|
||||
* @return a DAO specified by the criteria
|
||||
*/
|
||||
public T singleResult(Criteria criteria)
|
||||
|
@@ -40,8 +40,11 @@ public abstract class AbstractHibernateDSODAO<T extends DSpaceObject> extends Ab
|
||||
* The identifier of the join will be the toString() representation of the metadata field.
|
||||
* The joineded metadata fields can then be used to query or sort.
|
||||
* @param query
|
||||
* partial SQL query (to be appended)
|
||||
* @param tableIdentifier
|
||||
* DB table to join with
|
||||
* @param metadataFields
|
||||
* a collection of metadata fields
|
||||
*/
|
||||
protected void addMetadataLeftJoin(StringBuilder query, String tableIdentifier, Collection<MetadataField> metadataFields)
|
||||
{
|
||||
|
@@ -130,7 +130,7 @@ public class Context
|
||||
/**
|
||||
* Initializes a new context object.
|
||||
*
|
||||
* @exception SQLException
|
||||
* @throws SQLException
|
||||
* if there was an error obtaining a database connection
|
||||
*/
|
||||
private void init()
|
||||
@@ -337,7 +337,7 @@ public class Context
|
||||
* Calling complete() on a Context which is no longer valid (isValid()==false),
|
||||
* is a no-op.
|
||||
*
|
||||
* @exception SQLException
|
||||
* @throws SQLException
|
||||
* if there was an error completing the database transaction
|
||||
* or closing the connection
|
||||
*/
|
||||
@@ -448,6 +448,7 @@ public class Context
|
||||
* Add an event to be dispatched when this context is committed.
|
||||
*
|
||||
* @param event
|
||||
* event to be dispatched
|
||||
*/
|
||||
public void addEvent(Event event)
|
||||
{
|
||||
@@ -630,10 +631,9 @@ public class Context
|
||||
|
||||
|
||||
/**
|
||||
* Returns the size of the cache of all object that have been read from the database so far. A larger number
|
||||
* means that more memory is consumed by the cache. This also has a negative impact on the query performance. In
|
||||
* that case you should consider clearing the cache (see {@link Context#clearCache() clearCache}).
|
||||
* Returns the size of the cache of all object that have been read from the database so far.
|
||||
*
|
||||
* @return connection cache size
|
||||
* @throws SQLException When connecting to the active cache fails.
|
||||
*/
|
||||
public long getCacheSize() throws SQLException {
|
||||
|
@@ -48,13 +48,20 @@ public interface DBConnection<T> {
|
||||
|
||||
/**
|
||||
* Reload a DSpace object from the database. This will make sure the object is valid and stored in the cache.
|
||||
* @param <E> the type of entity.
|
||||
* @param entity The DSpace object to reload
|
||||
* @return the reloaded entity.
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public <E extends ReloadableEntity> E reloadEntity(E entity) throws SQLException;
|
||||
|
||||
/**
|
||||
* Remove a DSpace object from the cache when batch processing a large number of objects.
|
||||
* @param <E> the type of entity.
|
||||
* @param entity The DSpace object to reload
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public <E extends ReloadableEntity> void uncacheEntity(E entity) throws SQLException ;
|
||||
}
|
@@ -42,25 +42,28 @@ import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
|
||||
/**
|
||||
* Class representing an e-mail message, also used to send e-mails.
|
||||
* <P>
|
||||
* <p>
|
||||
* Typical use:
|
||||
* <P>
|
||||
* </p>
|
||||
* <p>
|
||||
* <code>Email email = new Email();</code><br>
|
||||
* <code>email.addRecipient("foo@bar.com");</code><br>
|
||||
* <code>email.addArgument("John");</code><br>
|
||||
* <code>email.addArgument("On the Testing of DSpace");</code><br>
|
||||
* <code>email.send();</code><br>
|
||||
* <P>
|
||||
* </p>
|
||||
* <p>
|
||||
* <code>name</code> is the name of an email template in
|
||||
* <code>dspace-dir/config/emails/</code> (which also includes the subject.)
|
||||
* <code>arg0</code> and <code>arg1</code> are arguments to fill out the
|
||||
* message with.
|
||||
* <P>
|
||||
* </p>
|
||||
* <p>
|
||||
* Emails are formatted using <code>java.text.MessageFormat.</code>
|
||||
* Additionally, comment lines (starting with '#') are stripped, and if a line
|
||||
* starts with "Subject:" the text on the right of the colon is used for the
|
||||
* subject line. For example:
|
||||
* <P>
|
||||
* </p>
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
@@ -77,10 +80,10 @@ import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* <P>
|
||||
* <p>
|
||||
* If the example code above was used to send this mail, the resulting mail
|
||||
* would have the subject <code>Example e-mail</code> and the body would be:
|
||||
* <P>
|
||||
* </p>
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
@@ -91,9 +94,10 @@ import org.dspace.services.factory.DSpaceServicesFactory;
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* <P>
|
||||
* <p>
|
||||
* Note that parameters like <code>{0}</code> cannot be placed in the subject
|
||||
* of the e-mail; they won't get filled out.
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author Robert Tansley
|
||||
@@ -295,7 +299,8 @@ public class Email
|
||||
message.setText(fullMessage);
|
||||
}
|
||||
}
|
||||
else{
|
||||
else
|
||||
{
|
||||
Multipart multipart = new MimeMultipart();
|
||||
// create the first part of the email
|
||||
BodyPart messageBodyPart = new MimeBodyPart();
|
||||
@@ -320,7 +325,13 @@ public class Email
|
||||
InputStreamAttachment isa = iter.next();
|
||||
// add the stream
|
||||
messageBodyPart = new MimeBodyPart();
|
||||
messageBodyPart.setDataHandler(new DataHandler(new InputStreamDataSource(isa.name,isa.mimetype,isa.is)));
|
||||
messageBodyPart.setDataHandler(
|
||||
new DataHandler(new InputStreamDataSource(
|
||||
isa.name,
|
||||
isa.mimetype,
|
||||
isa.is)
|
||||
)
|
||||
);
|
||||
messageBodyPart.setFileName(isa.name);
|
||||
multipart.addBodyPart(messageBodyPart);
|
||||
}
|
||||
@@ -459,7 +470,7 @@ public class Email
|
||||
/**
|
||||
* Test method to send an email to check email server settings
|
||||
*
|
||||
* @param args Command line options
|
||||
* @param args the command line arguments given
|
||||
*/
|
||||
public static void main(String[] args)
|
||||
{
|
||||
@@ -497,7 +508,9 @@ public class Email
|
||||
System.err.println("\nPlease see the DSpace documentation for assistance.\n");
|
||||
System.err.println("\n");
|
||||
System.exit(1);
|
||||
}catch (IOException e1) {
|
||||
}
|
||||
catch (IOException e1)
|
||||
{
|
||||
System.err.println("\nError sending email:");
|
||||
System.err.println(" - Error: " + e1);
|
||||
System.err.println("\nPlease see the DSpace documentation for assistance.\n");
|
||||
|
@@ -33,6 +33,7 @@ public interface GenericDAO<T>
|
||||
* Fetch all persisted instances of a given object type.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param clazz the desired type.
|
||||
* @return list of DAOs of the same type as clazz
|
||||
* @throws SQLException if database error
|
||||
@@ -43,6 +44,7 @@ public interface GenericDAO<T>
|
||||
* Execute a JPQL query returning a unique result.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param query JPQL query string
|
||||
* @return a DAO specified by the query string
|
||||
* @throws SQLException if database error
|
||||
@@ -57,6 +59,7 @@ public interface GenericDAO<T>
|
||||
* Execute a JPQL query and return a collection of results.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param query JPQL query string
|
||||
* @return list of DAOs specified by the query string
|
||||
* @throws SQLException if database error
|
||||
|
@@ -23,38 +23,43 @@ import org.dspace.services.ConfigurationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* The Legacy Plugin Service is a very simple component container (based on the
|
||||
* legacy PluginManager class from 5.x or below). It reads defined "plugins" (interfaces)
|
||||
* from config file(s) and makes them available to the API. (TODO: Someday, this
|
||||
* entire "plugin" framework needs to be replaced by Spring Beans.)
|
||||
* </p>
|
||||
* <p>
|
||||
* It creates and organizes components (plugins), and helps select a plugin in
|
||||
* the cases where there are many possible choices. It also gives some limited
|
||||
* control over the lifecycle of a plugin. It manages three different types
|
||||
* (usage patterns) of plugins:
|
||||
* <p>
|
||||
* <ol><li> Singleton Plugin
|
||||
* <br> There is only one implementation class for the plugin. It is indicated
|
||||
* </p>
|
||||
* <ol>
|
||||
* <li>Singleton Plugin<br>
|
||||
* There is only one implementation class for the plugin. It is indicated
|
||||
* in the configuration. This type of plugin chooses an implementations of
|
||||
* a service, for the entire system, at configuration time. Your
|
||||
* application just fetches the plugin for that interface and gets the
|
||||
* configured-in choice.
|
||||
* configured-in choice.</li>
|
||||
*
|
||||
* <p><li> Sequence Plugins
|
||||
* <br> You need a sequence or series of plugins, to implement a mechanism like
|
||||
* <li>Sequence Plugins<br>
|
||||
* You need a sequence or series of plugins, to implement a mechanism like
|
||||
* StackableAuthenticationMethods or a pipeline, where each plugin is
|
||||
* called in order to contribute its implementation of a process to the
|
||||
* whole.
|
||||
* <p><li> Named Plugins
|
||||
* <br> Use a named plugin when the application has to choose one plugin
|
||||
* whole.</li>
|
||||
* <li>Named Plugins<br>
|
||||
* Use a named plugin when the application has to choose one plugin
|
||||
* implementation out of many available ones. Each implementation is bound
|
||||
* to one or more names (symbolic identifiers) in the configuration.
|
||||
* </ol><p>
|
||||
* to one or more names (symbolic identifiers) in the configuration.</li>
|
||||
* </ol>
|
||||
* <p>
|
||||
* The name is just a <code>String</code> to be associated with the
|
||||
* combination of implementation class and interface. It may contain
|
||||
* any characters except for comma (,) and equals (=). It may contain
|
||||
* embedded spaces. Comma is a special character used to separate
|
||||
* names in the configuration entry.
|
||||
* </p>
|
||||
*
|
||||
* @author Larry Stone
|
||||
* @author Tim Donohue (turned old PluginManager into a PluginService)
|
||||
@@ -122,7 +127,7 @@ public class LegacyPluginServiceImpl implements PluginService
|
||||
*
|
||||
* @param interfaceClass interface Class object
|
||||
* @return instance of plugin
|
||||
* @throws PluginConfigurationError
|
||||
* @throws PluginConfigurationError if no matching singleton plugin is configured.
|
||||
*/
|
||||
@Override
|
||||
public Object getSinglePlugin(Class interfaceClass)
|
||||
@@ -713,7 +718,8 @@ public class LegacyPluginServiceImpl implements PluginService
|
||||
* Invoking this class from the command line just runs
|
||||
* <code>checkConfiguration</code> and shows the results.
|
||||
* There are no command-line options.
|
||||
* @param argv arguments
|
||||
*
|
||||
* @param argv the command line arguments given
|
||||
* @throws Exception if error
|
||||
*/
|
||||
public void main(String[] argv) throws Exception
|
||||
|
@@ -42,9 +42,10 @@ public interface NewsService {
|
||||
public String getNewsFilePath();
|
||||
|
||||
/**
|
||||
* Check if the newsName is a valid one
|
||||
* Check if the newsName is an acceptable file name
|
||||
*
|
||||
* @param newsName
|
||||
* news name
|
||||
* @return true
|
||||
* if the newsName is valid
|
||||
*/
|
||||
|
@@ -113,7 +113,10 @@ public class BasicLinkChecker extends AbstractCurationTask
|
||||
/**
|
||||
* Check the URL and perform appropriate reporting
|
||||
*
|
||||
* @param url The URL to check
|
||||
* @param url
|
||||
* The URL to check
|
||||
* @param results
|
||||
* Result string with HTTP status codes
|
||||
* @return If the URL was OK or not
|
||||
*/
|
||||
protected boolean checkURL(String url, StringBuilder results)
|
||||
|
@@ -113,6 +113,8 @@ public class BitstreamsIntoMetadata extends AbstractCurationTask
|
||||
* @param item The item
|
||||
* @param bitstream The bitstream
|
||||
* @param type The type of bitstream
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
protected void addMetadata(Item item, Bitstream bitstream, String type) throws SQLException {
|
||||
String value = bitstream.getFormat(Curator.curationContext()).getMIMEType() + "##";
|
||||
|
@@ -156,6 +156,9 @@ public class ClamScan extends AbstractCurationTask
|
||||
/** openSession
|
||||
*
|
||||
* This method opens a session.
|
||||
*
|
||||
* @throws IOException
|
||||
* A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
*/
|
||||
|
||||
protected void openSession() throws IOException
|
||||
|
@@ -149,7 +149,7 @@ public class Curator
|
||||
*
|
||||
* @param reporter name of reporting stream. The name '-'
|
||||
* causes reporting to standard out.
|
||||
* @return the Curator instance
|
||||
* @return return self (Curator instance) with reporter set
|
||||
*/
|
||||
public Curator setReporter(String reporter)
|
||||
{
|
||||
@@ -166,6 +166,9 @@ public class Curator
|
||||
* entire performance is complete, and a scope of 'object'
|
||||
* will commit for each object (e.g. item) encountered in
|
||||
* a given execution.
|
||||
*
|
||||
* @param scope transactional scope
|
||||
* @return return self (Curator instance) with given scope set
|
||||
*/
|
||||
public Curator setTransactionScope(TxScope scope)
|
||||
{
|
||||
@@ -358,11 +361,13 @@ public class Curator
|
||||
/**
|
||||
* Returns the context object used in the current curation thread.
|
||||
* This is primarily a utility method to allow tasks access to the context when necessary.
|
||||
* <P>
|
||||
* <p>
|
||||
* If the context is null or not set, then this just returns
|
||||
* a brand new Context object representing an Anonymous User.
|
||||
*
|
||||
* @return curation thread's Context object (or a new, anonymous Context if no curation Context exists)
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public static Context curationContext() throws SQLException
|
||||
{
|
||||
@@ -502,6 +507,9 @@ public class Curator
|
||||
/**
|
||||
* Record a 'visit' to a DSpace object and enforce any policies set
|
||||
* on this curator.
|
||||
* @param dso the DSpace object
|
||||
* @throws IOException
|
||||
* A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
*/
|
||||
protected void visit(DSpaceObject dso) throws IOException
|
||||
{
|
||||
|
@@ -114,6 +114,7 @@ public class ResolvedTask
|
||||
/**
|
||||
* Returns whether task should be distributed through containers
|
||||
*
|
||||
* @return whether task should be distributed through containers
|
||||
*/
|
||||
public boolean isDistributive()
|
||||
{
|
||||
@@ -123,6 +124,7 @@ public class ResolvedTask
|
||||
/**
|
||||
* Returns whether task alters (mutates) it's target objects
|
||||
*
|
||||
* @return whether task alters (mutates) it's target objects
|
||||
*/
|
||||
public boolean isMutative()
|
||||
{
|
||||
@@ -139,6 +141,11 @@ public class ResolvedTask
|
||||
return codes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether task is not scripted (curation task)
|
||||
*
|
||||
* @return true if this task is not scripted
|
||||
*/
|
||||
private boolean unscripted()
|
||||
{
|
||||
return sTask == null;
|
||||
|
@@ -27,9 +27,13 @@ public final class TaskQueueEntry
|
||||
* TaskQueueEntry constructor with enumerated field values.
|
||||
*
|
||||
* @param epersonId
|
||||
* task owner
|
||||
* @param submitTime
|
||||
* time the task was submitted (System.currentTimeMillis())
|
||||
* @param taskNames
|
||||
* list of task names
|
||||
* @param objId
|
||||
* usually a handle or workflow id
|
||||
*/
|
||||
public TaskQueueEntry(String epersonId, long submitTime,
|
||||
List<String> taskNames, String objId)
|
||||
|
@@ -120,8 +120,8 @@ public class Utils
|
||||
/**
|
||||
* Performs a buffered copy from one file into another.
|
||||
*
|
||||
* @param inFile
|
||||
* @param outFile
|
||||
* @param inFile input file
|
||||
* @param outFile output file
|
||||
* @throws IOException if IO error
|
||||
*/
|
||||
public static void copy(File inFile, File outFile) throws IOException
|
||||
|
@@ -79,6 +79,7 @@ public class WorkflowCuratorServiceImpl implements WorkflowCuratorService
|
||||
* Ensures the configurationService is injected, so that we can read the
|
||||
* settings from configuration
|
||||
* Called by "init-method" in Spring config.
|
||||
* @throws Exception ...
|
||||
*/
|
||||
public void init() throws Exception {
|
||||
File cfgFile = new File(configurationService.getProperty("dspace.dir") +
|
||||
|
@@ -46,8 +46,12 @@ public interface WorkflowCuratorService {
|
||||
/**
|
||||
* Determines and executes curation of a Workflow item.
|
||||
*
|
||||
* @param curator the Curator object
|
||||
* @param c the user context
|
||||
* @param wfId the workflow id
|
||||
* @return true if curation was completed or not required,
|
||||
* false if no workflow item found for id
|
||||
* or item was rejected
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @throws IOException if IO error
|
||||
* @throws SQLException if database error
|
||||
@@ -55,6 +59,18 @@ public interface WorkflowCuratorService {
|
||||
public boolean curate(Curator curator, Context c, String wfId)
|
||||
throws AuthorizeException, IOException, SQLException;
|
||||
|
||||
/**
|
||||
* Determines and executes curation of a Workflow item.
|
||||
*
|
||||
* @param curator the Curator object
|
||||
* @param c the user context
|
||||
* @param wfi the workflow item
|
||||
* @return true if curation was completed or not required,
|
||||
* false if item was rejected
|
||||
* @throws AuthorizeException if authorization error
|
||||
* @throws IOException if IO error
|
||||
* @throws SQLException if database error
|
||||
*/
|
||||
public boolean curate(Curator curator, Context c, BasicWorkflowItem wfi)
|
||||
throws AuthorizeException, IOException, SQLException;
|
||||
}
|
||||
|
@@ -40,12 +40,17 @@ public class DiscoverHitHighlightingField {
|
||||
* field containing a matching hit. e.g. If maxChars = 200
|
||||
* and a hit is found in the full-text the 200 chars
|
||||
* surrounding the hit will be shown
|
||||
*
|
||||
* @return max number of characters shown for a hit
|
||||
*/
|
||||
public int getMaxChars()
|
||||
{
|
||||
return maxChars;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return max number of result snippets
|
||||
*/
|
||||
public int getMaxSnippets()
|
||||
{
|
||||
return maxSnippets;
|
||||
|
@@ -41,12 +41,15 @@ public class IndexClient {
|
||||
* from the whole index
|
||||
*
|
||||
* @param args the command-line arguments, none used
|
||||
* @throws java.io.IOException
|
||||
* @throws SQLException if database error
|
||||
*
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
* @throws IOException
|
||||
* A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws SearchServiceException if something went wrong with querying the solr server
|
||||
*/
|
||||
public static void main(String[] args) throws SQLException, IOException, SearchServiceException {
|
||||
|
||||
public static void main(String[] args)
|
||||
throws SQLException, IOException, SearchServiceException
|
||||
{
|
||||
Context context = new Context();
|
||||
context.turnOffAuthorisationSystem();
|
||||
|
||||
@@ -55,46 +58,49 @@ public class IndexClient {
|
||||
HelpFormatter formatter = new HelpFormatter();
|
||||
CommandLine line = null;
|
||||
|
||||
options
|
||||
.addOption(OptionBuilder
|
||||
options.addOption(OptionBuilder
|
||||
.withArgName("handle to remove")
|
||||
.hasArg(true)
|
||||
.withDescription(
|
||||
"remove an Item, Collection or Community from index based on its handle")
|
||||
.create("r"));
|
||||
|
||||
options
|
||||
.addOption(OptionBuilder
|
||||
options.addOption(OptionBuilder
|
||||
.withArgName("handle to add or update")
|
||||
.hasArg(true)
|
||||
.withDescription(
|
||||
"add or update an Item, Collection or Community based on its handle")
|
||||
.create("i"));
|
||||
|
||||
options
|
||||
.addOption(OptionBuilder
|
||||
options.addOption(OptionBuilder
|
||||
.isRequired(false)
|
||||
.withDescription(
|
||||
"clean existing index removing any documents that no longer exist in the db")
|
||||
.create("c"));
|
||||
|
||||
options.addOption(OptionBuilder.isRequired(false).withDescription(
|
||||
"(re)build index, wiping out current one if it exists").create(
|
||||
"b"));
|
||||
options.addOption(OptionBuilder
|
||||
.isRequired(false)
|
||||
.withDescription(
|
||||
"(re)build index, wiping out current one if it exists")
|
||||
.create("b"));
|
||||
|
||||
options.addOption(OptionBuilder.isRequired(false).withDescription(
|
||||
"Rebuild the spellchecker, can be combined with -b and -f.").create(
|
||||
"s"));
|
||||
options.addOption(OptionBuilder
|
||||
.isRequired(false)
|
||||
.withDescription(
|
||||
"Rebuild the spellchecker, can be combined with -b and -f.")
|
||||
.create("s"));
|
||||
|
||||
options
|
||||
.addOption(OptionBuilder
|
||||
options.addOption(OptionBuilder
|
||||
.isRequired(false)
|
||||
.withDescription(
|
||||
"if updating existing index, force each handle to be reindexed even if uptodate")
|
||||
.create("f"));
|
||||
|
||||
options.addOption(OptionBuilder.isRequired(false).withDescription(
|
||||
"print this help message").create("h"));
|
||||
options.addOption(OptionBuilder
|
||||
.isRequired(false)
|
||||
.withDescription(
|
||||
"print this help message")
|
||||
.create("h"));
|
||||
|
||||
options.addOption(OptionBuilder.isRequired(false).withDescription(
|
||||
"optimize search core").create("o"));
|
||||
@@ -118,7 +124,10 @@ public class IndexClient {
|
||||
* new DSpace.getServiceManager().getServiceByName("org.dspace.discovery.SolrIndexer");
|
||||
*/
|
||||
|
||||
IndexingService indexer = DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(IndexingService.class.getName(),IndexingService.class);
|
||||
IndexingService indexer = DSpaceServicesFactory.getInstance().getServiceManager().getServiceByName(
|
||||
IndexingService.class.getName(),
|
||||
IndexingService.class
|
||||
);
|
||||
|
||||
if (line.hasOption("r")) {
|
||||
log.info("Removing " + line.getOptionValue("r") + " from Index");
|
||||
@@ -160,11 +169,27 @@ public class IndexClient {
|
||||
|
||||
/**
|
||||
* Indexes the given object and all children, if applicable.
|
||||
*
|
||||
* @param indexingService
|
||||
*
|
||||
* @param itemService
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param dso
|
||||
* DSpace object to index recursively
|
||||
* @throws IOException
|
||||
* A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws SearchServiceException in case of a solr exception
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
private static long indexAll(final IndexingService indexingService,
|
||||
final ItemService itemService,
|
||||
final Context context,
|
||||
final DSpaceObject dso) throws IOException, SearchServiceException, SQLException {
|
||||
final DSpaceObject dso)
|
||||
throws IOException, SearchServiceException, SQLException
|
||||
{
|
||||
long count = 0;
|
||||
|
||||
indexingService.indexContent(context, dso, true, true);
|
||||
@@ -194,11 +219,27 @@ public class IndexClient {
|
||||
|
||||
/**
|
||||
* Indexes all items in the given collection.
|
||||
*
|
||||
* @param indexingService
|
||||
*
|
||||
* @param itemService
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param collection
|
||||
* collection to index
|
||||
* @throws IOException
|
||||
* A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws SearchServiceException in case of a solr exception
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
private static long indexItems(final IndexingService indexingService,
|
||||
final ItemService itemService,
|
||||
final Context context,
|
||||
final Collection collection) throws IOException, SearchServiceException, SQLException {
|
||||
final Collection collection)
|
||||
throws IOException, SearchServiceException, SQLException
|
||||
{
|
||||
long count = 0;
|
||||
|
||||
final Iterator<Item> itemIterator = itemService.findByCollection(context, collection);
|
||||
@@ -220,7 +261,9 @@ public class IndexClient {
|
||||
* @param indexer the solr indexer
|
||||
* @throws SearchServiceException in case of a solr exception
|
||||
*/
|
||||
protected static void checkRebuildSpellCheck(CommandLine line, IndexingService indexer) throws SearchServiceException {
|
||||
protected static void checkRebuildSpellCheck(CommandLine line, IndexingService indexer)
|
||||
throws SearchServiceException
|
||||
{
|
||||
if (line.hasOption("s")) {
|
||||
log.info("Rebuilding spell checker.");
|
||||
indexer.buildSpellCheck();
|
||||
|
@@ -34,6 +34,7 @@ public interface SearchService {
|
||||
* DSpace Context object.
|
||||
* @param query
|
||||
* the discovery query object.
|
||||
* @return discovery search result object
|
||||
* @throws SearchServiceException if search error
|
||||
*/
|
||||
DiscoverResult search(Context context, DiscoverQuery query)
|
||||
@@ -50,6 +51,7 @@ public interface SearchService {
|
||||
* within this object)
|
||||
* @param query
|
||||
* the discovery query object
|
||||
* @return discovery search result object
|
||||
* @throws SearchServiceException if search error
|
||||
*/
|
||||
DiscoverResult search(Context context, DSpaceObject dso, DiscoverQuery query)
|
||||
@@ -64,6 +66,7 @@ public interface SearchService {
|
||||
* @param includeWithdrawn
|
||||
* use <code>true</code> to include in the results also withdrawn
|
||||
* items that match the query.
|
||||
* @return discovery search result object
|
||||
* @throws SearchServiceException if search error
|
||||
*/
|
||||
DiscoverResult search(Context context, DiscoverQuery query,
|
||||
@@ -81,7 +84,7 @@ public interface SearchService {
|
||||
* @param includeWithdrawn
|
||||
* use <code>true</code> to include in the results also withdrawn
|
||||
* items that match the query
|
||||
*
|
||||
* @return discovery search result object
|
||||
* @throws SearchServiceException if search error
|
||||
*/
|
||||
DiscoverResult search(Context context, DSpaceObject dso, DiscoverQuery query, boolean includeWithdrawn) throws SearchServiceException;
|
||||
@@ -97,11 +100,14 @@ public interface SearchService {
|
||||
|
||||
/**
|
||||
* Transforms the given string field and value into a filter query
|
||||
* @param context the DSpace context
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param field the field of the filter query
|
||||
* @param operator equals/notequals/notcontains/authority/notauthority
|
||||
* @param value the filter query value
|
||||
* @return a filter query
|
||||
* @throws SQLException if database error
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
DiscoverFilterQuery toFilterQuery(Context context, String field, String operator, String value) throws SQLException;
|
||||
|
||||
@@ -118,21 +124,27 @@ public interface SearchService {
|
||||
* communities/collections only.
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
* The relevant DSpace Context.
|
||||
* @return query string specific to the user's rights
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
String createLocationQueryForAdministrableItems(Context context) throws SQLException;
|
||||
|
||||
/**
|
||||
* Transforms the metadata field of the given sort configuration into the indexed field which we can then use in our solr queries
|
||||
* Transforms the metadata field of the given sort configuration into the indexed field which we can then use in our Solr queries.
|
||||
*
|
||||
* @param metadataField the metadata field
|
||||
* @param type see {@link org.dspace.discovery.configuration.DiscoveryConfigurationParameters}
|
||||
* @return the indexed field
|
||||
*/
|
||||
String toSortFieldIndex(String metadataField, String type);
|
||||
|
||||
/**
|
||||
* Utility method to escape any special characters in a user's query
|
||||
*
|
||||
* @param query
|
||||
* User's query to escape.
|
||||
* @return query with any special characters escaped
|
||||
*/
|
||||
String escapeQueryChars(String query);
|
||||
|
@@ -73,8 +73,11 @@ public class SearchUtils {
|
||||
/**
|
||||
* Method that retrieves a list of all the configuration objects from the given item
|
||||
* A configuration object can be returned for each parent community/collection
|
||||
*
|
||||
* @param item the DSpace item
|
||||
* @return a list of configuration objects
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public static List<DiscoveryConfiguration> getAllDiscoveryConfigurations(Item item) throws SQLException {
|
||||
Map<String, DiscoveryConfiguration> result = new HashMap<String, DiscoveryConfiguration>();
|
||||
|
@@ -79,7 +79,7 @@ import org.dspace.eperson.factory.EPersonServiceFactory;
|
||||
* that cron.
|
||||
*
|
||||
* The SolrServiceImpl is registered as a Service in the ServiceManager via
|
||||
* a spring configuration file located under
|
||||
* a Spring configuration file located under
|
||||
* classpath://spring/spring-dspace-applicationContext.xml
|
||||
*
|
||||
* Its configuration is Autowired by the ApplicationContext
|
||||
@@ -257,6 +257,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
* unIndex removes an Item, Collection, or Community
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param dso DSpace Object, can be Community, Item, or Collection
|
||||
* @throws SQLException if database error
|
||||
* @throws IOException if IO error
|
||||
@@ -271,6 +272,7 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
* unIndex removes an Item, Collection, or Community
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param dso DSpace Object, can be Community, Item, or Collection
|
||||
* @param commit if <code>true</code> force an immediate commit on SOLR
|
||||
* @throws SQLException if database error
|
||||
@@ -761,9 +763,12 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
/**
|
||||
* Write the document to the index under the appropriate handle.
|
||||
*
|
||||
* @param doc the solr document to be written to the server
|
||||
* @param doc
|
||||
* the solr document to be written to the server
|
||||
* @param streams
|
||||
* @throws IOException IO exception
|
||||
* list of bitstream content streams
|
||||
* @throws IOException
|
||||
* A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
*/
|
||||
protected void writeDocument(SolrInputDocument doc, List<BitstreamContentStream> streams) throws IOException {
|
||||
|
||||
@@ -811,6 +816,8 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
/**
|
||||
* Build a solr document for a DSpace Community.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param community Community to be indexed
|
||||
* @throws SQLException if database error
|
||||
* @throws IOException if IO error
|
||||
@@ -859,6 +866,8 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
/**
|
||||
* Build a solr document for a DSpace Collection.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param collection Collection to be indexed
|
||||
* @throws SQLException sql exception
|
||||
* @throws IOException IO exception
|
||||
@@ -915,8 +924,10 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
/**
|
||||
* Add the metadata value of the community/collection to the solr document
|
||||
* IF needed highlighting is added !
|
||||
*
|
||||
* @param doc the solr document
|
||||
* @param highlightedMetadataFields the list of metadata fields that CAN be highlighted
|
||||
* @param toIgnoreMetadataFields the list of metadata fields to skip adding to Solr
|
||||
* @param metadataField the metadata field added
|
||||
* @param value the value (can be NULL !)
|
||||
*/
|
||||
@@ -1472,10 +1483,15 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
/**
|
||||
* Create Lucene document with all the shared fields initialized.
|
||||
*
|
||||
* @param type Type of DSpace Object
|
||||
* @param type
|
||||
* Type of DSpace Object
|
||||
* @param id
|
||||
* internal identifier
|
||||
* @param handle
|
||||
* @param locations @return
|
||||
* handle string
|
||||
* @param locations
|
||||
* list of collection/community internal identifiers
|
||||
* @return initialized Lucene document
|
||||
*/
|
||||
protected SolrInputDocument buildDocument(int type, UUID id, String handle,
|
||||
List<String> locations)
|
||||
@@ -1987,6 +2003,17 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find DSpace object by type and UUID or by handle from given Solr document
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param doc
|
||||
* the solr document
|
||||
* @return DSpace object
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
protected DSpaceObject findDSpaceObject(Context context, SolrDocument doc) throws SQLException {
|
||||
|
||||
Integer type = (Integer) doc.getFirstValue(RESOURCE_TYPE_FIELD);
|
||||
@@ -2005,7 +2032,15 @@ public class SolrServiceImpl implements SearchService, IndexingService {
|
||||
}
|
||||
|
||||
|
||||
/** Simple means to return the search result as an InputStream */
|
||||
/**
|
||||
* Simple means to return the search result as an InputStream
|
||||
*
|
||||
* @param query discovery query
|
||||
* @return input stream
|
||||
* @throws IOException
|
||||
* A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws SearchServiceException if something went wrong with querying the solr server
|
||||
*/
|
||||
public java.io.InputStream searchAsInputStream(DiscoverQuery query) throws SearchServiceException, java.io.IOException {
|
||||
if (getSolr() == null)
|
||||
{
|
||||
|
@@ -55,6 +55,8 @@ public class DiscoveryHitHighlightFieldConfiguration
|
||||
|
||||
/**
|
||||
* Get the maximum number of highlighted snippets to generate per field
|
||||
*
|
||||
* @return maximum number of highlighted snippets to generate per field
|
||||
*/
|
||||
public int getSnippets()
|
||||
{
|
||||
|
@@ -62,10 +62,11 @@ public class EmbargoCLITool {
|
||||
* <dt>-q,--quiet</dt>
|
||||
* <dd> No output except upon error.</dd>
|
||||
* </dl>
|
||||
*
|
||||
* @param argv the command line arguments given
|
||||
*/
|
||||
public static void main(String argv[])
|
||||
{
|
||||
|
||||
int status = 0;
|
||||
|
||||
Options options = new Options();
|
||||
|
@@ -28,8 +28,17 @@ public interface EmbargoLifter
|
||||
* (access control) by (for example) turning on default read access to all
|
||||
* Bitstreams.
|
||||
*
|
||||
* @param context the DSpace context
|
||||
* @param item the Item on which to lift the embargo
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param item
|
||||
* the Item on which to lift the embargo
|
||||
* @throws IOException
|
||||
* A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
public void liftEmbargo(Context context, Item item)
|
||||
throws SQLException, AuthorizeException, IOException;
|
||||
|
@@ -171,6 +171,8 @@ public class EmbargoServiceImpl implements EmbargoService
|
||||
* Ensures the configurationService is injected, so that we can
|
||||
* get plugins and MD field settings from config.
|
||||
* Called by "init-method" in Spring config.
|
||||
*
|
||||
* @throws Exception on generic exception
|
||||
*/
|
||||
public void init() throws Exception
|
||||
{
|
||||
|
@@ -42,6 +42,11 @@ public interface EmbargoSetter
|
||||
* @param item the item to embargo
|
||||
* @param terms value of the metadata field configured as embargo terms, if any.
|
||||
* @return absolute date on which the embargo is to be lifted, or null if none
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
public DCDate parseTerms(Context context, Item item, String terms)
|
||||
throws SQLException, AuthorizeException;
|
||||
@@ -52,6 +57,11 @@ public interface EmbargoSetter
|
||||
*
|
||||
* @param context the DSpace context
|
||||
* @param item the item to embargo
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
public void setEmbargo(Context context, Item item)
|
||||
throws SQLException, AuthorizeException;
|
||||
@@ -68,6 +78,13 @@ public interface EmbargoSetter
|
||||
*
|
||||
* @param context the DSpace context
|
||||
* @param item the item to embargo
|
||||
* @throws IOException
|
||||
* A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
public void checkEmbargo(Context context, Item item)
|
||||
throws SQLException, AuthorizeException, IOException;
|
||||
|
@@ -51,6 +51,11 @@ public interface EmbargoService {
|
||||
*
|
||||
* @param context the DSpace context
|
||||
* @param item the item to embargo
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
public void setEmbargo(Context context, Item item)
|
||||
throws SQLException, AuthorizeException;
|
||||
@@ -69,6 +74,11 @@ public interface EmbargoService {
|
||||
* @param context the DSpace context
|
||||
* @param item the item to embargo
|
||||
* @return lift date on which the embargo is to be lifted, or null if none
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
public DCDate getEmbargoTermsAsDate(Context context, Item item)
|
||||
throws SQLException, AuthorizeException;
|
||||
@@ -80,6 +90,13 @@ public interface EmbargoService {
|
||||
*
|
||||
* @param context the DSpace context
|
||||
* @param item the item on which to lift the embargo
|
||||
* @throws IOException
|
||||
* A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
public void liftEmbargo(Context context, Item item)
|
||||
throws SQLException, AuthorizeException, IOException;
|
||||
|
@@ -107,7 +107,7 @@ public class AccountServiceImpl implements AccountService
|
||||
* @param token
|
||||
* Account token
|
||||
* @return The EPerson corresponding to token, or null.
|
||||
* @exception SQLException
|
||||
* @throws SQLException
|
||||
* If the token or eperson cannot be retrieved from the
|
||||
* database.
|
||||
*/
|
||||
@@ -161,7 +161,7 @@ public class AccountServiceImpl implements AccountService
|
||||
* DSpace context
|
||||
* @param token
|
||||
* The token to delete
|
||||
* @exception SQLException
|
||||
* @throws SQLException
|
||||
* If a database error occurs
|
||||
*/
|
||||
@Override
|
||||
@@ -171,7 +171,7 @@ public class AccountServiceImpl implements AccountService
|
||||
registrationDataService.deleteByToken(context, token);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* THIS IS AN INTERNAL METHOD. THE SEND PARAMETER ALLOWS IT TO BE USED FOR
|
||||
* TESTING PURPOSES.
|
||||
*
|
||||
@@ -179,15 +179,18 @@ public class AccountServiceImpl implements AccountService
|
||||
* is TRUE, this is registration email; otherwise, it is forgot-password
|
||||
* email. If send is TRUE, the email is sent; otherwise it is skipped.
|
||||
*
|
||||
* Potential error conditions: No EPerson with that email (returns null)
|
||||
* Cannot create registration data in database (throws SQLException) Error
|
||||
* sending email (throws MessagingException) Error reading email template
|
||||
* (throws IOException) Authorization error (throws AuthorizeException)
|
||||
* Potential error conditions:
|
||||
* @return null if no EPerson with that email found
|
||||
* @throws SQLException Cannot create registration data in database
|
||||
* @throws MessagingException Error sending email
|
||||
* @throws IOException Error reading email template
|
||||
* @throws AuthorizeException Authorization error
|
||||
*
|
||||
* @param context DSpace context @param email Email address to send the
|
||||
* forgot-password email to @param isRegister If true, this is for
|
||||
* registration; otherwise, it is for forgot-password @param send If true,
|
||||
* send email; otherwise do not send any email
|
||||
* @param context DSpace context
|
||||
* @param email Email address to send the forgot-password email to
|
||||
* @param isRegister If true, this is for registration; otherwise, it is
|
||||
* for forgot-password
|
||||
* @param send If true, send email; otherwise do not send any email
|
||||
*/
|
||||
protected RegistrationData sendInfo(Context context, String email,
|
||||
boolean isRegister, boolean send) throws SQLException, IOException,
|
||||
@@ -234,6 +237,8 @@ public class AccountServiceImpl implements AccountService
|
||||
* If isRegister is <code>true</code>, this is registration email;
|
||||
* otherwise, it is a forgot-password email.
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param email
|
||||
* The email address to mail to
|
||||
* @param isRegister
|
||||
@@ -241,10 +246,12 @@ public class AccountServiceImpl implements AccountService
|
||||
* forgot-password email.
|
||||
* @param rd
|
||||
* The RDBMS row representing the registration data.
|
||||
* @exception MessagingException
|
||||
* @throws MessagingException
|
||||
* If an error occurs while sending email
|
||||
* @exception IOException
|
||||
* If an error occurs while reading the email template.
|
||||
* @throws IOException
|
||||
* A general class of exceptions produced by failed or interrupted I/O operations.
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
protected void sendEmail(Context context, String email, boolean isRegister, RegistrationData rd)
|
||||
throws MessagingException, IOException, SQLException
|
||||
|
@@ -104,8 +104,8 @@ public class EPerson extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
/**
|
||||
* Return true if this object equals obj, false otherwise.
|
||||
*
|
||||
* @param obj
|
||||
* @return true if ResourcePolicy objects are equal
|
||||
* @param obj another EPerson.
|
||||
* @return true if EPerson objects are equal in ID, email, and full name
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
@@ -165,8 +165,12 @@ public class EPerson extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
* Locale specification of the form {language} or {language}_{territory},
|
||||
* e.g. "en", "en_US", "pt_BR" (the latter is Brazilian Portugese).
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param language
|
||||
* language code
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public void setLanguage(Context context, String language) throws SQLException {
|
||||
getePersonService().setMetadataSingleValue(context, this, "eperson", "language", null, null, language);
|
||||
@@ -253,8 +257,12 @@ public class EPerson extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
/**
|
||||
* Set the eperson's first name
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param firstname
|
||||
* the person's first name
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public void setFirstName(Context context, String firstname) throws SQLException {
|
||||
getePersonService().setMetadataSingleValue(context, this, "eperson", "firstname", null, null, firstname);
|
||||
@@ -274,8 +282,12 @@ public class EPerson extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
/**
|
||||
* Set the eperson's last name
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param lastname
|
||||
* the person's last name
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
public void setLastName(Context context, String lastname) throws SQLException {
|
||||
getePersonService().setMetadataSingleValue(context, this, "eperson", "lastname", null, null, lastname);
|
||||
@@ -369,7 +381,7 @@ public class EPerson extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
}
|
||||
|
||||
/**
|
||||
* return type found in Constants
|
||||
* @return type found in Constants, see {@link org.dspace.core.Constants#Constants Constants}
|
||||
*/
|
||||
@Override
|
||||
public int getType()
|
||||
|
@@ -45,6 +45,15 @@ public class EPersonCLITool {
|
||||
|
||||
/**
|
||||
* Tool for manipulating user accounts.
|
||||
*
|
||||
* @param argv the command line arguments given
|
||||
* @throws ParseException
|
||||
* Base for Exceptions thrown during parsing of a command-line.
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
* @throws AuthorizeException
|
||||
* Exception indicating the current user of the context does not have permission
|
||||
* to perform a particular action.
|
||||
*/
|
||||
public static void main(String argv[])
|
||||
throws ParseException, SQLException, AuthorizeException {
|
||||
|
@@ -50,7 +50,9 @@ public class EPersonConsumer implements Consumer
|
||||
* Consume the event
|
||||
*
|
||||
* @param context
|
||||
* The relevant DSpace Context.
|
||||
* @param event
|
||||
* Which Event to consume
|
||||
* @throws Exception if error
|
||||
*/
|
||||
@Override
|
||||
@@ -116,6 +118,7 @@ public class EPersonConsumer implements Consumer
|
||||
* Handle the end of the event
|
||||
*
|
||||
* @param ctx
|
||||
* The relevant DSpace Context.
|
||||
* @throws Exception if error
|
||||
*/
|
||||
@Override
|
||||
@@ -129,6 +132,7 @@ public class EPersonConsumer implements Consumer
|
||||
* Finish the event
|
||||
*
|
||||
* @param ctx
|
||||
* The relevant DSpace Context.
|
||||
*/
|
||||
@Override
|
||||
public void finish(Context ctx)
|
||||
|
@@ -39,6 +39,10 @@ public class Groomer
|
||||
private static final EPersonService ePersonService = EPersonServiceFactory.getInstance().getEPersonService();
|
||||
/**
|
||||
* Command line tool for "grooming" the EPerson collection.
|
||||
*
|
||||
* @param argv the command line arguments given
|
||||
* @throws SQLException
|
||||
* An exception that provides information on a database access error or other errors.
|
||||
*/
|
||||
static public void main(String[] argv)
|
||||
throws SQLException
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user