DS-3154: Fix some of the Javadocs errors in dspace-api

This commit is contained in:
Tim Donohue
2016-04-29 09:04:36 -05:00
parent 842f61999f
commit ca78a45532
257 changed files with 2028 additions and 1285 deletions

View File

@@ -36,7 +36,7 @@ public interface ExtractingParams {
/** /**
* The param prefix for mapping Tika metadata to Solr fields. * The param prefix for mapping Tika metadata to Solr fields.
* <p/> * <p>
* To map a field, add a name like: * To map a field, add a name like:
* <pre>fmap.title=solr.title</pre> * <pre>fmap.title=solr.title</pre>
* *
@@ -48,7 +48,7 @@ public interface ExtractingParams {
/** /**
* The boost value for the name of the field. The boost can be specified by a name mapping. * The boost value for the name of the field. The boost can be specified by a name mapping.
* <p/> * <p>
* For example * For example
* <pre> * <pre>
* map.title=solr.title * map.title=solr.title
@@ -73,9 +73,9 @@ public interface ExtractingParams {
* Restrict the extracted parts of a document to be indexed * Restrict the extracted parts of a document to be indexed
* by passing in an XPath expression. All content that satisfies the XPath expr. * 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 SolrContentHandler}.
* <p/> * <p>
* See Tika's docs for what the extracted document looks like. * See Tika's docs for what the extracted document looks like.
* <p/> * <p>
* @see #CAPTURE_ELEMENTS * @see #CAPTURE_ELEMENTS
*/ */
public static final String XPATH_EXPRESSION = "xpath"; public static final String XPATH_EXPRESSION = "xpath";
@@ -104,11 +104,11 @@ public interface ExtractingParams {
/** /**
* Capture the specified fields (and everything included below it that isn't capture by some other capture field) separately from the default. This is different * 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. * then the case of passing in an XPath expression.
* <p/> * <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 SolrContentHandler}
* by Tika, not to be confused by the mapped field. The field name can then * by Tika, not to be confused by the mapped field. The field name can then
* be mapped into the index schema. * be mapped into the index schema.
* <p/> * <p>
* For instance, a Tika document may look like: * For instance, a Tika document may look like:
* <pre> * <pre>
* &lt;html&gt; * &lt;html&gt;

View File

@@ -46,6 +46,11 @@ public class CommunityFiliator
handleService = HandleServiceFactory.getInstance().getHandleService(); handleService = HandleServiceFactory.getInstance().getHandleService();
} }
/**
*
* @param argv arguments
* @throws Exception if error
*/
public static void main(String[] argv) throws Exception public static void main(String[] argv) throws Exception
{ {
// create an options object and populate it // create an options object and populate it
@@ -174,6 +179,15 @@ public class CommunityFiliator
} }
} }
/**
*
* @param c context
* @param parent parent Community
* @param child child community
* @throws SQLException if database error
* @throws AuthorizeException if authorize error
* @throws IOException if IO error
*/
public void filiate(Context c, Community parent, Community child) public void filiate(Context c, Community parent, Community child)
throws SQLException, AuthorizeException, IOException throws SQLException, AuthorizeException, IOException
{ {
@@ -212,6 +226,15 @@ public class CommunityFiliator
+ "' is parent of community: '" + child.getID() + "'"); + "' is parent of community: '" + child.getID() + "'");
} }
/**
*
* @param c context
* @param parent parent Community
* @param child child community
* @throws SQLException if database error
* @throws AuthorizeException if authorize error
* @throws IOException if IO error
*/
public void defiliate(Context c, Community parent, Community child) public void defiliate(Context c, Community parent, Community child)
throws SQLException, AuthorizeException, IOException throws SQLException, AuthorizeException, IOException
{ {
@@ -250,6 +273,13 @@ public class CommunityFiliator
+ "'"); + "'");
} }
/**
* Find a community by ID
* @param c context
* @param communityID community ID
* @return Community object
* @throws SQLException if database error
*/
protected Community resolveCommunity(Context c, String communityID) protected Community resolveCommunity(Context c, String communityID)
throws SQLException throws SQLException
{ {

View File

@@ -59,6 +59,7 @@ public final class CreateAdministrator
* *
* @param argv * @param argv
* command-line arguments * command-line arguments
* @throws Exception if error
*/ */
public static void main(String[] argv) public static void main(String[] argv)
throws Exception throws Exception
@@ -92,7 +93,7 @@ public final class CreateAdministrator
/** /**
* constructor, which just creates and object with a ready context * constructor, which just creates and object with a ready context
* *
* @throws Exception * @throws Exception if error
*/ */
protected CreateAdministrator() protected CreateAdministrator()
throws Exception throws Exception
@@ -106,7 +107,7 @@ public final class CreateAdministrator
* Method which will negotiate with the user via the command line to * Method which will negotiate with the user via the command line to
* obtain the administrator's details * obtain the administrator's details
* *
* @throws Exception * @throws Exception if error
*/ */
protected void negotiateAdministratorDetails() protected void negotiateAdministratorDetails()
throws Exception throws Exception
@@ -228,7 +229,7 @@ public final class CreateAdministrator
* @param language preferred language * @param language preferred language
* @param pw desired password * @param pw desired password
* *
* @throws Exception * @throws Exception if error
*/ */
protected void createAdministrator(String email, String first, String last, protected void createAdministrator(String email, String first, String last,
String language, String pw) String language, String pw)

View File

@@ -39,13 +39,14 @@ import org.xml.sax.SAXException;
* from the metadata schemas for the repository. * from the metadata schemas for the repository.
* *
* The form of the XML is as follows * The form of the XML is as follows
* * {@code
* <metadata-schemas> * <metadata-schemas>
* <schema> * <schema>
* <name>dc</name> * <name>dc</name>
* <namespace>http://dublincore.org/documents/dcmi-terms/</namespace> * <namespace>http://dublincore.org/documents/dcmi-terms/</namespace>
* </schema> * </schema>
* </metadata-schemas> * </metadata-schemas>
* }
*/ */
public class MetadataExporter public class MetadataExporter
{ {
@@ -54,12 +55,12 @@ public class MetadataExporter
protected static MetadataFieldService metadataFieldService = ContentServiceFactory.getInstance().getMetadataFieldService(); protected static MetadataFieldService metadataFieldService = ContentServiceFactory.getInstance().getMetadataFieldService();
/** /**
* @param args * @param args commandline arguments
* @throws ParseException * @throws ParseException if parser error
* @throws SAXException * @throws SAXException if XML parse error
* @throws IOException * @throws IOException if IO error
* @throws SQLException * @throws SQLException if database error
* @throws RegistryExportException * @throws RegistryExportException if export error
*/ */
public static void main(String[] args) throws ParseException, SQLException, IOException, SAXException, RegistryExportException public static void main(String[] args) throws ParseException, SQLException, IOException, SAXException, RegistryExportException
{ {
@@ -91,6 +92,15 @@ public class MetadataExporter
saveRegistry(file, schema); saveRegistry(file, schema);
} }
/**
* Save a registry to a filepath
* @param file filepath
* @param schema schema definition to save
* @throws SQLException if database error
* @throws IOException if IO error
* @throws SAXException if XML error
* @throws RegistryExportException if export error
*/
public static void saveRegistry(String file, String schema) throws SQLException, IOException, SAXException, RegistryExportException public static void saveRegistry(String file, String schema) throws SQLException, IOException, SAXException, RegistryExportException
{ {
// create a context // create a context
@@ -145,12 +155,12 @@ public class MetadataExporter
/** /**
* Serialize the schema registry. If the parameter 'schema' is null or empty, save all schemas * Serialize the schema registry. If the parameter 'schema' is null or empty, save all schemas
* @param context * @param context DSpace Context
* @param xmlSerializer * @param xmlSerializer XML serializer
* @param schema * @param schema schema (may be null to save all)
* @throws SQLException * @throws SQLException if database error
* @throws SAXException * @throws SAXException if XML error
* @throws RegistryExportException * @throws RegistryExportException if export error
*/ */
public static void saveSchema(Context context, XMLSerializer xmlSerializer, String schema) throws SQLException, SAXException, RegistryExportException public static void saveSchema(Context context, XMLSerializer xmlSerializer, String schema) throws SQLException, SAXException, RegistryExportException
{ {
@@ -176,10 +186,10 @@ public class MetadataExporter
/** /**
* Serialize a single schema (namespace) registry entry * Serialize a single schema (namespace) registry entry
* *
* @param xmlSerializer * @param xmlSerializer XML serializer
* @param mdSchema * @param mdSchema DSpace metadata schema
* @throws SAXException * @throws SAXException if XML error
* @throws RegistryExportException * @throws RegistryExportException if export error
*/ */
private static void saveSchema(XMLSerializer xmlSerializer, MetadataSchema mdSchema) throws SAXException, RegistryExportException private static void saveSchema(XMLSerializer xmlSerializer, MetadataSchema mdSchema) throws SAXException, RegistryExportException
{ {
@@ -223,13 +233,13 @@ public class MetadataExporter
/** /**
* Serialize a single metadata field registry entry to xml * Serialize a single metadata field registry entry to xml
* *
* @param context * @param context DSpace context
* @param xmlSerializer * @param xmlSerializer xml serializer
* @param mdField * @param mdField DSpace metadata field
* @throws SAXException * @throws SAXException if XML error
* @throws RegistryExportException * @throws RegistryExportException if export error
* @throws SQLException * @throws SQLException if database error
* @throws IOException * @throws IOException if IO error
*/ */
private static void saveType(Context context, XMLSerializer xmlSerializer, MetadataField mdField) throws SAXException, RegistryExportException, SQLException, IOException private static void saveType(Context context, XMLSerializer xmlSerializer, MetadataField mdField) throws SAXException, RegistryExportException, SQLException, IOException
{ {
@@ -291,11 +301,16 @@ public class MetadataExporter
xmlSerializer.endElement("dc-type"); xmlSerializer.endElement("dc-type");
} }
static Map<Integer, String> schemaMap = new HashMap<Integer, String>();
/** /**
* Helper method to retrieve a schema name for the field. * Helper method to retrieve a schema name for the field.
* Caches the name after looking up the id. * Caches the name after looking up the id.
* @param context DSpace Context
* @param mdField DSpace metadata field
* @return name of schema
* @throws SQLException if database error
* @throws RegistryExportException if export error
*/ */
static Map<Integer, String> schemaMap = new HashMap<Integer, String>();
private static String getSchemaName(Context context, MetadataField mdField) throws SQLException, RegistryExportException private static String getSchemaName(Context context, MetadataField mdField) throws SQLException, RegistryExportException
{ {
// Get name from cache // Get name from cache

View File

@@ -47,6 +47,7 @@ import org.xml.sax.SAXException;
* *
* The format of the XML file is as follows: * The format of the XML file is as follows:
* *
* {@code
* <dspace-dc-types> * <dspace-dc-types>
* <dc-type> * <dc-type>
* <schema>icadmin</schema> * <schema>icadmin</schema>
@@ -58,6 +59,7 @@ import org.xml.sax.SAXException;
* [....] * [....]
* *
* </dspace-dc-types> * </dspace-dc-types>
* }
*/ */
public class MetadataImporter public class MetadataImporter
{ {
@@ -67,9 +69,19 @@ public class MetadataImporter
/** logging category */ /** logging category */
private static final Logger log = LoggerFactory.getLogger(MetadataImporter.class); private static final Logger log = LoggerFactory.getLogger(MetadataImporter.class);
/** /**
* main method for reading user input from the command line * main method for reading user input from the command line
*/ * @param args arguments
* @throws ParseException if parse error
* @throws SQLException if database error
* @throws IOException if IO error
* @throws TransformerException if transformer error
* @throws ParserConfigurationException if config error
* @throws AuthorizeException if authorization error
* @throws SAXException if parser error
* @throws NonUniqueMetadataException if duplicate metadata
* @throws RegistryImportException if import fails
**/
public static void main(String[] args) public static void main(String[] args)
throws ParseException, SQLException, IOException, TransformerException, throws ParseException, SQLException, IOException, TransformerException,
ParserConfigurationException, AuthorizeException, SAXException, ParserConfigurationException, AuthorizeException, SAXException,
@@ -103,6 +115,15 @@ public class MetadataImporter
* Load the data from the specified file path into the database * Load the data from the specified file path into the database
* *
* @param file the file path containing the source data * @param file the file path containing the source data
* @param forceUpdate whether to force update
* @throws SQLException if database error
* @throws IOException if IO error
* @throws TransformerException if transformer error
* @throws ParserConfigurationException if config error
* @throws AuthorizeException if authorization error
* @throws SAXException if parser error
* @throws NonUniqueMetadataException if duplicate metadata
* @throws RegistryImportException if import fails
*/ */
public static void loadRegistry(String file, boolean forceUpdate) public static void loadRegistry(String file, boolean forceUpdate)
throws SQLException, IOException, TransformerException, ParserConfigurationException, throws SQLException, IOException, TransformerException, ParserConfigurationException,
@@ -158,7 +179,12 @@ public class MetadataImporter
* DSpace context object * DSpace context object
* @param node * @param node
* the node in the DOM tree * the node in the DOM tree
* @throws NonUniqueMetadataException * @throws SQLException if database error
* @throws IOException if IO error
* @throws TransformerException if transformer error
* @throws AuthorizeException if authorization error
* @throws NonUniqueMetadataException if duplicate metadata
* @throws RegistryImportException if import fails
*/ */
private static void loadSchema(Context context, Node node, boolean updateExisting) private static void loadSchema(Context context, Node node, boolean updateExisting)
throws SQLException, IOException, TransformerException, throws SQLException, IOException, TransformerException,
@@ -221,7 +247,12 @@ public class MetadataImporter
* DSpace context object * DSpace context object
* @param node * @param node
* the node in the DOM tree * the node in the DOM tree
* @throws NonUniqueMetadataException * @throws SQLException if database error
* @throws IOException if IO error
* @throws TransformerException if transformer error
* @throws AuthorizeException if authorization error
* @throws NonUniqueMetadataException if duplicate metadata
* @throws RegistryImportException if import fails
*/ */
private static void loadType(Context context, Node node) private static void loadType(Context context, Node node)
throws SQLException, IOException, TransformerException, throws SQLException, IOException, TransformerException,

View File

@@ -25,7 +25,7 @@ public class RegistryExportException extends Exception
/** /**
* create an exception with only a message * create an exception with only a message
* *
* @param message * @param message exception message
*/ */
public RegistryExportException(String message) public RegistryExportException(String message)
{ {
@@ -35,8 +35,8 @@ public class RegistryExportException extends Exception
/** /**
* create an exception with an inner exception and a message * create an exception with an inner exception and a message
* *
* @param message * @param message exception message
* @param e * @param e reference to Throwable
*/ */
public RegistryExportException(String message, Throwable e) public RegistryExportException(String message, Throwable e)
{ {
@@ -46,7 +46,7 @@ public class RegistryExportException extends Exception
/** /**
* create an exception with an inner exception * create an exception with an inner exception
* *
* @param e * @param e reference to Throwable
*/ */
public RegistryExportException(Throwable e) public RegistryExportException(Throwable e)
{ {

View File

@@ -25,7 +25,7 @@ public class RegistryImportException extends Exception
/** /**
* create an exception with only a message * create an exception with only a message
* *
* @param message * @param message error message
*/ */
public RegistryImportException(String message) public RegistryImportException(String message)
{ {
@@ -35,8 +35,8 @@ public class RegistryImportException extends Exception
/** /**
* create an exception with an inner exception and a message * create an exception with an inner exception and a message
* *
* @param message * @param message error message
* @param e * @param e throwable
*/ */
public RegistryImportException(String message, Throwable e) public RegistryImportException(String message, Throwable e)
{ {
@@ -46,7 +46,7 @@ public class RegistryImportException extends Exception
/** /**
* create an exception with an inner exception * create an exception with an inner exception
* *
* @param e * @param e throwable
*/ */
public RegistryImportException(Throwable e) public RegistryImportException(Throwable e)
{ {

View File

@@ -40,6 +40,9 @@ public class RegistryImporter
* the filename to load from * the filename to load from
* *
* @return the DOM representation of the XML file * @return the DOM representation of the XML file
* @throws IOException if IO error
* @throws ParserConfigurationException if configuration parse error
* @throws SAXException if XML parse error
*/ */
public static Document loadXML(String filename) public static Document loadXML(String filename)
throws IOException, ParserConfigurationException, SAXException throws IOException, ParserConfigurationException, SAXException
@@ -68,7 +71,7 @@ public class RegistryImporter
* the element, whose child element you want the CDATA from * the element, whose child element you want the CDATA from
* @param childName * @param childName
* the name of the element you want the CDATA from * the name of the element you want the CDATA from
* * @throws TransformerException if error
* @return the CDATA as a <code>String</code> * @return the CDATA as a <code>String</code>
*/ */
public static String getElementData(Node parentElement, String childName) public static String getElementData(Node parentElement, String childName)
@@ -116,7 +119,7 @@ public class RegistryImporter
* the element, whose child element you want the CDATA from * the element, whose child element you want the CDATA from
* @param childName * @param childName
* the name of the element you want the CDATA from * the name of the element you want the CDATA from
* * @throws TransformerException if error
* @return the CDATA as a <code>String</code> * @return the CDATA as a <code>String</code>
*/ */
public static String[] getRepeatedElementData(Node parentElement, public static String[] getRepeatedElementData(Node parentElement,

View File

@@ -56,6 +56,7 @@ public class RegistryLoader
* *
* @param argv * @param argv
* command-line arguments * command-line arguments
* @throws Exception if error
*/ */
public static void main(String[] argv) throws Exception public static void main(String[] argv) throws Exception
{ {
@@ -121,6 +122,12 @@ public class RegistryLoader
* DSpace context object * DSpace context object
* @param filename * @param filename
* the filename of the XML file to load * the filename of the XML file to load
* @throws SQLException if database error
* @throws IOException if IO error
* @throws TransformerException if transformer error
* @throws ParserConfigurationException if config error
* @throws AuthorizeException if authorization error
* @throws SAXException if parser error
*/ */
public static void loadBitstreamFormats(Context context, String filename) public static void loadBitstreamFormats(Context context, String filename)
throws SQLException, IOException, ParserConfigurationException, throws SQLException, IOException, ParserConfigurationException,
@@ -151,6 +158,10 @@ public class RegistryLoader
* DSpace context object * DSpace context object
* @param node * @param node
* the node in the DOM tree * the node in the DOM tree
* @throws SQLException if database error
* @throws IOException if IO error
* @throws TransformerException if transformer error
* @throws AuthorizeException if authorization error
*/ */
private static void loadFormat(Context context, Node node) private static void loadFormat(Context context, Node node)
throws SQLException, IOException, TransformerException, throws SQLException, IOException, TransformerException,
@@ -206,7 +217,9 @@ public class RegistryLoader
* *
* @param filename * @param filename
* the filename to load from * the filename to load from
* * @throws IOException if IO error
* @throws ParserConfigurationException if config error
* @throws SAXException if parser error
* @return the DOM representation of the XML file * @return the DOM representation of the XML file
*/ */
private static Document loadXML(String filename) throws IOException, private static Document loadXML(String filename) throws IOException,
@@ -234,7 +247,7 @@ public class RegistryLoader
* the element, whose child element you want the CDATA from * the element, whose child element you want the CDATA from
* @param childName * @param childName
* the name of the element you want the CDATA from * the name of the element you want the CDATA from
* * @throws TransformerException if transformer error
* @return the CDATA as a <code>String</code> * @return the CDATA as a <code>String</code>
*/ */
private static String getElementData(Node parentElement, String childName) private static String getElementData(Node parentElement, String childName)
@@ -282,7 +295,7 @@ public class RegistryLoader
* the element, whose child element you want the CDATA from * the element, whose child element you want the CDATA from
* @param childName * @param childName
* the name of the element you want the CDATA from * the name of the element you want the CDATA from
* * @throws TransformerException if transformer error
* @return the CDATA as a <code>String</code> * @return the CDATA as a <code>String</code>
*/ */
private static String[] getRepeatedElementData(Node parentElement, private static String[] getRepeatedElementData(Node parentElement,

View File

@@ -46,7 +46,7 @@ import org.xml.sax.SAXException;
* an XML file. * an XML file.
* *
* The XML file structure needs to be: * The XML file structure needs to be:
* * {@code
* <import_structure> * <import_structure>
* <community> * <community>
* <name>....</name> * <name>....</name>
@@ -56,7 +56,7 @@ import org.xml.sax.SAXException;
* </collection> * </collection>
* </community> * </community>
* </import_structure> * </import_structure>
* * }
* it can be arbitrarily deep, and supports all the metadata elements * it can be arbitrarily deep, and supports all the metadata elements
* that make up the community and collection metadata. See the system * that make up the community and collection metadata. See the system
* documentation for more details * documentation for more details
@@ -88,10 +88,12 @@ public class StructBuilder
* *
* This is of the form: * This is of the form:
* *
* StructBuilder -f [xml source] -e [administrator email] -o [output file] * {@code StructBuilder -f [xml source] -e [administrator email] -o [output file]}
* *
* The output file will contain exactly the same as the source xml document, but * 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. * with the handle for each imported item added as an attribute.
* @param argv commandline arguments
* @throws Exception if an error occurs
*/ */
public static void main(String[] argv) public static void main(String[] argv)
throws Exception throws Exception
@@ -203,7 +205,7 @@ public class StructBuilder
* fails it generates an error and ceases execution * fails it generates an error and ceases execution
* *
* @param document the XML document object * @param document the XML document object
* @throws TransformerException * @throws TransformerException if transformer error
* *
*/ */
private static void validate(org.w3c.dom.Document document) private static void validate(org.w3c.dom.Document document)

View File

@@ -150,7 +150,7 @@ public class DSpaceCSVLine implements Serializable
* Write this line out as a CSV formatted string, in the order given by the headings provided * Write this line out as a CSV formatted string, in the order given by the headings provided
* *
* @param headings The headings which define the order the elements must be presented in * @param headings The headings which define the order the elements must be presented in
* @param fieldSeparator * @param fieldSeparator field separator
* @return The CSV formatted String * @return The CSV formatted String
*/ */
protected String toCSV(List<String> headings, String fieldSeparator) protected String toCSV(List<String> headings, String fieldSeparator)
@@ -179,7 +179,7 @@ public class DSpaceCSVLine implements Serializable
* Internal method to create a CSV formatted String joining a given set of elements * Internal method to create a CSV formatted String joining a given set of elements
* *
* @param values The values to create the string from * @param values The values to create the string from
* @param valueSeparator * @param valueSeparator value separator
* @return The line as a CSV formatted String * @return The line as a CSV formatted String
*/ */
protected String valueToCSV(List<String> values, String valueSeparator) protected String valueToCSV(List<String> values, String valueSeparator)

View File

@@ -86,11 +86,12 @@ public class MetadataExport
/** /**
* Build an array list of item ids that are in a community (include sub-communities and collections) * Build an array list of item ids that are in a community (include sub-communities and collections)
* *
* @param context DSpace context
* @param community The community to build from * @param community The community to build from
* @param itemIDs The itemID (used for recursion - use an empty ArrayList) * @param itemIDs The itemID (used for recursion - use an empty ArrayList)
* @param indent How many spaces to use when writing out the names of items added * @param indent How many spaces to use when writing out the names of items added
* @return The list of item ids * @return The list of item ids
* @throws SQLException * @throws SQLException if database error
*/ */
protected Iterator<Item> buildFromCommunity(Context context, Community community, List<Integer> itemIDs, int indent) protected Iterator<Item> buildFromCommunity(Context context, Community community, List<Integer> itemIDs, int indent)
throws SQLException throws SQLException
@@ -176,6 +177,7 @@ public class MetadataExport
* main method to run the metadata exporter * main method to run the metadata exporter
* *
* @param argv the command line arguments given * @param argv the command line arguments given
* @throws Exception if error occurs
*/ */
public static void main(String[] argv) throws Exception public static void main(String[] argv) throws Exception
{ {

View File

@@ -420,8 +420,7 @@ public class MetadataImport
* @param change Whether or not to make the update * @param change Whether or not to make the update
* @param md The element to compare * @param md The element to compare
* @param changes The changes object to populate * @param changes The changes object to populate
* * @param line line in CSV file
* @param line
* @throws SQLException if there is a problem accessing a Collection from the database, from its handle * @throws SQLException if there is a problem accessing a Collection from the database, from its handle
* @throws AuthorizeException if there is an authorization problem with permissions * @throws AuthorizeException if there is an authorization problem with permissions
*/ */

View File

@@ -41,6 +41,7 @@ public class MetadataImportInvalidHeadingException extends Exception
* *
* @param message the error message * @param message the error message
* @param theType the type of the error * @param theType the type of the error
* @param theColumn column number
*/ */
public MetadataImportInvalidHeadingException(String message, int theType, int theColumn) public MetadataImportInvalidHeadingException(String message, int theType, int theColumn)
{ {

View File

@@ -9,7 +9,6 @@
/** /**
* <p>The DSpace Batch Metadata Editor, which uses a CSV file to export/import * <p>The DSpace Batch Metadata Editor, which uses a CSV file to export/import
* item metadata.</p> * item metadata.</p>
* <p>
* <ul> * <ul>
* <li>works on items, communities, collections or the whole site</li> * <li>works on items, communities, collections or the whole site</li>
* <li>can also create new items, delete items and withdraw/restore them</li> * <li>can also create new items, delete items and withdraw/restore them</li>

View File

@@ -29,7 +29,7 @@ import org.dspace.core.Utils;
/** /**
* Command line access to the checksum checker. Options are listed in the * Command line access to the checksum checker. Options are listed in the
* documentation for the main method.</p> * documentation for the main method.
* *
* @author Jim Downing * @author Jim Downing
* @author Grace Carpenter * @author Grace Carpenter
@@ -72,6 +72,7 @@ public final class ChecksumChecker
* <dt>-p</dt> * <dt>-p</dt>
* <dd>Don't prune results before running checker</dd> * <dd>Don't prune results before running checker</dd>
* </dl> * </dl>
* @throws SQLException if error
*/ */
public static void main(String[] args) throws SQLException { public static void main(String[] args) throws SQLException {
// set up command line parser // set up command line parser

View File

@@ -34,8 +34,8 @@ import java.util.*;
* core in RDF schema / contents - text file, listing one file per line / file1 * core in RDF schema / contents - text file, listing one file per line / file1
* - files contained in the item / file2 / ... * - files contained in the item / file2 / ...
* <P> * <P>
* issues -doesn't handle special characters in metadata (needs to turn &'s into * issues -doesn't handle special characters in metadata (needs to turn {@code &'s} into
* &amp;, etc.) * {@code &amp;}, etc.)
* <P> * <P>
* Modified by David Little, UCSD Libraries 12/21/04 to allow the registration * Modified by David Little, UCSD Libraries 12/21/04 to allow the registration
* of files (bitstreams) into DSpace. * of files (bitstreams) into DSpace.

View File

@@ -57,8 +57,8 @@ import org.springframework.beans.factory.annotation.Autowired;
* core in RDF schema / contents - text file, listing one file per line / file1 * core in RDF schema / contents - text file, listing one file per line / file1
* - files contained in the item / file2 / ... * - files contained in the item / file2 / ...
* <P> * <P>
* issues -doesn't handle special characters in metadata (needs to turn &'s into * issues -doesn't handle special characters in metadata (needs to turn {@code &'s} into
* &amp;, etc.) * {@code &amp;}, etc.)
* <P> * <P>
* Modified by David Little, UCSD Libraries 12/21/04 to allow the registration * Modified by David Little, UCSD Libraries 12/21/04 to allow the registration
* of files (bitstreams) into DSpace. * of files (bitstreams) into DSpace.
@@ -180,10 +180,11 @@ public class ItemExportServiceImpl implements ItemExportService
* Discover the different schemas in use and output a separate metadata XML * Discover the different schemas in use and output a separate metadata XML
* file for each schema. * file for each schema.
* *
* @param c * @param c DSpace context
* @param i * @param i DSpace Item
* @param destDir * @param destDir destination directory
* @throws Exception * @param migrate Whether to use the migrate option or not
* @throws Exception if error
*/ */
protected void writeMetadata(Context c, Item i, File destDir, boolean migrate) protected void writeMetadata(Context c, Item i, File destDir, boolean migrate)
throws Exception throws Exception
@@ -202,7 +203,15 @@ public class ItemExportServiceImpl implements ItemExportService
} }
} }
// output the item's dublin core into the item directory /**
* output the item's dublin core into the item directory
* @param c DSpace context
* @param schema schema
* @param i DSpace Item
* @param destDir destination directory
* @param migrate Whether to use the migrate option or not
* @throws Exception if error
*/
protected void writeMetadata(Context c, String schema, Item i, protected void writeMetadata(Context c, String schema, Item i,
File destDir, boolean migrate) throws Exception File destDir, boolean migrate) throws Exception
{ {
@@ -318,7 +327,13 @@ public class ItemExportServiceImpl implements ItemExportService
} }
} }
// create the file 'handle' which contains the handle assigned to the item /**
* create the file 'handle' which contains the handle assigned to the item
* @param c DSpace Context
* @param i DSpace Item
* @param destDir destination directory
* @throws Exception if error
*/
protected void writeHandle(Context c, Item i, File destDir) protected void writeHandle(Context c, Item i, File destDir)
throws Exception throws Exception
{ {
@@ -358,7 +373,9 @@ public class ItemExportServiceImpl implements ItemExportService
* the item being exported * the item being exported
* @param destDir * @param destDir
* the item's export directory * the item's export directory
* @throws Exception * @param excludeBitstreams
* whether to exclude bitstreams
* @throws Exception if error
* if there is any problem writing to the export directory * if there is any problem writing to the export directory
*/ */
protected void writeBitstreams(Context c, Item i, File destDir, protected void writeBitstreams(Context c, Item i, File destDir,
@@ -531,7 +548,8 @@ public class ItemExportServiceImpl implements ItemExportService
* - the dspace context * - the dspace context
* @param additionalEmail * @param additionalEmail
* - email address to cc in addition the the current user email * - email address to cc in addition the the current user email
* @throws Exception * @param toMigrate Whether to use the migrate option or not
* @throws Exception if error
*/ */
protected void processDownloadableExport(List<DSpaceObject> dsObjects, protected void processDownloadableExport(List<DSpaceObject> dsObjects,
Context context, final String additionalEmail, boolean toMigrate) throws Exception Context context, final String additionalEmail, boolean toMigrate) throws Exception
@@ -868,6 +886,13 @@ public class ItemExportServiceImpl implements ItemExportService
return file.length(); return file.length();
} }
/**
* Attempt to find an EPerson based on string ID
* @param context DSpace context
* @param strID string identifier
* @return EPerson object (if found)
* @throws SQLException if database error
*/
protected EPerson getEPersonFromString(Context context, String strID) throws SQLException { protected EPerson getEPersonFromString(Context context, String strID) throws SQLException {
EPerson eperson; EPerson eperson;
try{ try{
@@ -1105,6 +1130,14 @@ public class ItemExportServiceImpl implements ItemExportService
} }
} }
/**
*
* @param cpFile file
* @param strSource source location
* @param strTarget target location
* @param cpZipOutputStream current zip outputstream
* @throws Exception if error
*/
protected void zipFiles(File cpFile, String strSource, protected void zipFiles(File cpFile, String strSource,
String strTarget, ZipOutputStream cpZipOutputStream) String strTarget, ZipOutputStream cpZipOutputStream)
throws Exception throws Exception
@@ -1158,6 +1191,11 @@ public class ItemExportServiceImpl implements ItemExportService
} }
} }
/**
* Delete a directory
* @param path directory path
* @return true if successful, false otherwise
*/
protected boolean deleteDirectory(File path) protected boolean deleteDirectory(File path)
{ {
if (path.exists()) if (path.exists())

View File

@@ -30,8 +30,8 @@ import java.util.List;
* core in RDF schema / contents - text file, listing one file per line / file1 * core in RDF schema / contents - text file, listing one file per line / file1
* - files contained in the item / file2 / ... * - files contained in the item / file2 / ...
* <P> * <P>
* issues -doesn't handle special characters in metadata (needs to turn &'s into * issues -doesn't handle special characters in metadata (needs to turn {@code &'s} into
* &amp;, etc.) * {@code &amp;}, etc.)
* <P> * <P>
* Modified by David Little, UCSD Libraries 12/21/04 to allow the registration * Modified by David Little, UCSD Libraries 12/21/04 to allow the registration
* of files (bitstreams) into DSpace. * of files (bitstreams) into DSpace.
@@ -59,7 +59,8 @@ public interface ItemExportService {
* @param zipFileName The name to save the zip file as * @param zipFileName The name to save the zip file as
* @param seqStart The first number in the sequence * @param seqStart The first number in the sequence
* @param migrate Whether to use the migrate option or not * @param migrate Whether to use the migrate option or not
* @throws Exception * @param excludeBitstreams Whether to exclude bitstreams or not
* @throws Exception if error
*/ */
public void exportAsZip(Context context, Iterator<Item> items, public void exportAsZip(Context context, Iterator<Item> items,
String destDirName, String zipFileName, String destDirName, String zipFileName,
@@ -74,7 +75,8 @@ public interface ItemExportService {
* - the dspace object to export * - the dspace object to export
* @param context * @param context
* - the dspace context * - the dspace context
* @throws Exception * @param migrate Whether to use the migrate option or not
* @throws Exception if error
*/ */
public void createDownloadableExport(DSpaceObject dso, public void createDownloadableExport(DSpaceObject dso,
Context context, boolean migrate) throws Exception; Context context, boolean migrate) throws Exception;
@@ -87,7 +89,8 @@ public interface ItemExportService {
* - List containing dspace objects * - List containing dspace objects
* @param context * @param context
* - the dspace context * - the dspace context
* @throws Exception * @param migrate Whether to use the migrate option or not
* @throws Exception if error
*/ */
public void createDownloadableExport(List<DSpaceObject> dsObjects, public void createDownloadableExport(List<DSpaceObject> dsObjects,
Context context, boolean migrate) throws Exception; Context context, boolean migrate) throws Exception;
@@ -102,7 +105,8 @@ public interface ItemExportService {
* - the dspace context * - the dspace context
* @param additionalEmail * @param additionalEmail
* - cc email to use * - cc email to use
* @throws Exception * @param migrate Whether to use the migrate option or not
* @throws Exception if error
*/ */
public void createDownloadableExport(DSpaceObject dso, public void createDownloadableExport(DSpaceObject dso,
Context context, String additionalEmail, boolean migrate) throws Exception; Context context, String additionalEmail, boolean migrate) throws Exception;
@@ -117,7 +121,8 @@ public interface ItemExportService {
* - the dspace context * - the dspace context
* @param additionalEmail * @param additionalEmail
* - cc email to use * - cc email to use
* @throws Exception * @param migrate Whether to use the migrate option or not
* @throws Exception if error
*/ */
public void createDownloadableExport(List<DSpaceObject> dsObjects, public void createDownloadableExport(List<DSpaceObject> dsObjects,
Context context, String additionalEmail, boolean migrate) throws Exception; Context context, String additionalEmail, boolean migrate) throws Exception;
@@ -126,13 +131,14 @@ public interface ItemExportService {
/** /**
* Create a file name based on the date and eperson * Create a file name based on the date and eperson
* *
* @param type Type of object (as string)
* @param eperson * @param eperson
* - eperson who requested export and will be able to download it * - eperson who requested export and will be able to download it
* @param date * @param date
* - the date the export process was created * - the date the export process was created
* @return String representing the file name in the form of * @return String representing the file name in the form of
* 'export_yyy_MMM_dd_count_epersonID' * 'export_yyy_MMM_dd_count_epersonID'
* @throws Exception * @throws Exception if error
*/ */
public String assembleFileName(String type, EPerson eperson, public String assembleFileName(String type, EPerson eperson,
Date date) throws Exception; Date date) throws Exception;
@@ -146,7 +152,7 @@ public interface ItemExportService {
* - the eperson who requested export archive * - the eperson who requested export archive
* @return String representing a directory in the form of * @return String representing a directory in the form of
* org.dspace.app.itemexport.download.dir/epersonID * org.dspace.app.itemexport.download.dir/epersonID
* @throws Exception * @throws Exception if error
*/ */
public String getExportDownloadDirectory(EPerson ePerson) public String getExportDownloadDirectory(EPerson ePerson)
throws Exception; throws Exception;
@@ -157,7 +163,7 @@ public interface ItemExportService {
* *
* @return String representing config file entry for * @return String representing config file entry for
* org.dspace.app.itemexport.work.dir * org.dspace.app.itemexport.work.dir
* @throws Exception * @throws Exception if error
*/ */
public String getExportWorkDirectory() throws Exception; public String getExportWorkDirectory() throws Exception;
@@ -169,7 +175,7 @@ public interface ItemExportService {
* @param eperson * @param eperson
* the eperson requesting the download * the eperson requesting the download
* @return an input stream of the file to be downloaded * @return an input stream of the file to be downloaded
* @throws Exception * @throws Exception if error
*/ */
public InputStream getExportDownloadInputStream(String fileName, public InputStream getExportDownloadInputStream(String fileName,
EPerson eperson) throws Exception; EPerson eperson) throws Exception;
@@ -177,12 +183,24 @@ public interface ItemExportService {
/** /**
* Get the file size of the export archive represented by the file name. * Get the file size of the export archive represented by the file name.
* *
* @param context DSpace context
* @param fileName * @param fileName
* name of the file to get the size. * name of the file to get the size.
* @throws Exception * @throws Exception if error
* @return size as long
*/ */
public long getExportFileSize(Context context, String fileName) throws Exception; public long getExportFileSize(Context context, String fileName) throws Exception;
/**
* Get the last modified date of the export archive represented by the file name.
*
* @param context DSpace context
* @param fileName
* name of the file to get the size.
* @return date as long
* @see java.io.File#lastModified()
* @throws Exception if error
*/
public long getExportFileLastModified(Context context, String fileName) public long getExportFileLastModified(Context context, String fileName)
throws Exception; throws Exception;
@@ -203,10 +221,10 @@ public interface ItemExportService {
* Reads the download directory for the eperson to see if any export * Reads the download directory for the eperson to see if any export
* archives are available * archives are available
* *
* @param eperson * @param eperson EPerson object
* @return a list of file names representing export archives that have been * @return a list of file names representing export archives that have been
* processed * processed
* @throws Exception * @throws Exception if error
*/ */
public List<String> getExportsAvailable(EPerson eperson) public List<String> getExportsAvailable(EPerson eperson)
throws Exception; throws Exception;
@@ -218,7 +236,7 @@ public interface ItemExportService {
* *
* @param eperson * @param eperson
* - the eperson to clean up * - the eperson to clean up
* @throws Exception * @throws Exception if error
*/ */
public void deleteOldExportArchives(EPerson eperson) throws Exception; public void deleteOldExportArchives(EPerson eperson) throws Exception;
@@ -228,7 +246,7 @@ public interface ItemExportService {
* determine if the current exports are too old and need purgeing * determine if the current exports are too old and need purgeing
* Removes all old exports, not just those for the person doing the export. * Removes all old exports, not just those for the person doing the export.
* *
* @throws Exception * @throws Exception if error
*/ */
public void deleteOldExportArchives() throws Exception; public void deleteOldExportArchives() throws Exception;
@@ -245,7 +263,7 @@ public interface ItemExportService {
* @param fileName * @param fileName
* - the file name to be downloaded. It is added to the url in * - the file name to be downloaded. It is added to the url in
* the email * the email
* @throws MessagingException * @throws MessagingException if error
*/ */
public void emailSuccessMessage(Context context, EPerson eperson, public void emailSuccessMessage(Context context, EPerson eperson,
String fileName) throws MessagingException; String fileName) throws MessagingException;
@@ -260,11 +278,17 @@ public interface ItemExportService {
* - EPerson to send the error message to * - EPerson to send the error message to
* @param error * @param error
* - the error message * - the error message
* @throws MessagingException * @throws MessagingException if error
*/ */
public void emailErrorMessage(EPerson eperson, String error) public void emailErrorMessage(EPerson eperson, String error)
throws MessagingException; throws MessagingException;
/**
* Zip source to target
* @param strSource source file
* @param target target file
* @throws Exception if error
*/
public void zip(String strSource, String target) throws Exception; public void zip(String strSource, String target) throws Exception;
} }

View File

@@ -20,7 +20,7 @@ import java.util.Map;
/** /**
* This class acts as a Service in the procedure ot batch import using the Biblio-Transformation-Engine * This class acts as a Service in the procedure to batch import using the Biblio-Transformation-Engine
*/ */
public class BTEBatchImportService public class BTEBatchImportService
{ {
@@ -39,7 +39,7 @@ public class BTEBatchImportService
/** /**
* Setter method for dataLoaders parameter * Setter method for dataLoaders parameter
* @param dataLoaders * @param dataLoaders map of data loaders
*/ */
public void setDataLoaders(Map<String, DataLoader> dataLoaders) public void setDataLoaders(Map<String, DataLoader> dataLoaders)
{ {
@@ -47,7 +47,7 @@ public class BTEBatchImportService
} }
/** /**
* * Get data loaders
* @return the map of DataLoaders * @return the map of DataLoaders
*/ */
public Map<String, DataLoader> getDataLoaders() public Map<String, DataLoader> getDataLoaders()
@@ -56,7 +56,7 @@ public class BTEBatchImportService
} }
/** /**
* * Get output map
* @return the outputMapping * @return the outputMapping
*/ */
public Map<String, String> getOutputMap() { public Map<String, String> getOutputMap() {
@@ -65,20 +65,32 @@ public class BTEBatchImportService
/** /**
* Setter method for the outputMapping * Setter method for the outputMapping
* @param outputMapping * @param outputMap the output mapping
*/ */
public void setOutputMap(Map<String, String> outputMap) { public void setOutputMap(Map<String, String> outputMap) {
this.outputMap = outputMap; this.outputMap = outputMap;
} }
/**
* Get transformation engine
* @return transformation engine
*/
public TransformationEngine getTransformationEngine() { public TransformationEngine getTransformationEngine() {
return transformationEngine; return transformationEngine;
} }
/**
* set transformation engine
* @param transformationEngine transformation engine
*/
public void setTransformationEngine(TransformationEngine transformationEngine) { public void setTransformationEngine(TransformationEngine transformationEngine) {
this.transformationEngine = transformationEngine; this.transformationEngine = transformationEngine;
} }
/**
* Getter of file data loaders
* @return List of file data loaders
*/
public List<String> getFileDataLoaders(){ public List<String> getFileDataLoaders(){
List<String> result = new ArrayList<String>(); List<String> result = new ArrayList<String>();

View File

@@ -7,9 +7,7 @@
*/ */
package org.dspace.app.itemimport; package org.dspace.app.itemimport;
import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader; import java.io.FileReader;
import java.io.IOException; import java.io.IOException;
import java.io.LineNumberReader; import java.io.LineNumberReader;
@@ -19,7 +17,6 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.GregorianCalendar; import java.util.GregorianCalendar;
import java.util.List; import java.util.List;
import java.util.Scanner;
/** /**
* @author kstamatis * @author kstamatis
@@ -37,7 +34,8 @@ public class BatchUpload {
private String errorMsgHTML = ""; private String errorMsgHTML = "";
/** /**
* * Initialize with directory
* @param dirPath directory path
*/ */
public BatchUpload(String dirPath) { public BatchUpload(String dirPath) {
@@ -45,13 +43,20 @@ public class BatchUpload {
} }
/**
* Initialize with directory
* @param dir directory path
*/
public BatchUpload(File dir) { public BatchUpload(File dir) {
this.initializeWithFile(dir); this.initializeWithFile(dir);
} }
/**
* Initialize with directory
* @param dir directory path
*/
private void initializeWithFile(File dir){ private void initializeWithFile(File dir){
this.dir = dir; this.dir = dir;
@@ -89,6 +94,12 @@ public class BatchUpload {
} }
} }
/**
* Count lines in file
* @param filename file name
* @return lines in file
* @throws IOException if IO error
*/
private int countLines(String filename) throws IOException { private int countLines(String filename) throws IOException {
LineNumberReader reader = new LineNumberReader(new FileReader(filename)); LineNumberReader reader = new LineNumberReader(new FileReader(filename));
int cnt = 0; int cnt = 0;
@@ -106,6 +117,11 @@ public class BatchUpload {
return cnt; return cnt;
} }
/**
* Read a file
* @param filename file name
* @throws IOException if IO error
*/
private void readFile(String filename) throws IOException { private void readFile(String filename) throws IOException {
LineNumberReader reader = new LineNumberReader(new FileReader(filename)); LineNumberReader reader = new LineNumberReader(new FileReader(filename));
String lineRead = ""; String lineRead = "";
@@ -125,40 +141,76 @@ public class BatchUpload {
reader.close(); reader.close();
} }
/**
* Get date
* @return Date
*/
public Date getDate() { public Date getDate() {
return date; return date;
} }
/**
* Get path to directory
* @return directory
*/
public File getDir() { public File getDir() {
return dir; return dir;
} }
/**
* Whether successulf
* @return true or false
*/
public boolean isSuccessful() { public boolean isSuccessful() {
return successful; return successful;
} }
/**
* Get items imported
* @return number of items
*/
public int getItemsImported() { public int getItemsImported() {
return itemsImported; return itemsImported;
} }
/**
* Get total items
* @return total
*/
public int getTotalItems() { public int getTotalItems() {
return totalItems; return totalItems;
} }
/**
* Get formatted date (DD/MM/YY)
* @return date as string
*/
public String getDateFormatted(){ public String getDateFormatted(){
SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy - HH:mm"); SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy - HH:mm");
return df.format(date); return df.format(date);
} }
/**
* Get handles of imported files
* @return list of handles
*/
public List<String> getHandlesImported() { public List<String> getHandlesImported() {
return handlesImported; return handlesImported;
} }
/**
* Get error message
* @return error message
*/
public String getErrorMsg() { public String getErrorMsg() {
return errorMsg; return errorMsg;
} }
/**
* Get error message as HTML
* @return error message string as HTML
*/
public String getErrorMsgHTML() { public String getErrorMsgHTML() {
return errorMsgHTML; return errorMsgHTML;
} }

View File

@@ -175,10 +175,10 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
* @param mycollections The collections the items are inserted to * @param mycollections The collections the items are inserted to
* @param sourceDir The filepath to the file to read data from * @param sourceDir The filepath to the file to read data from
* @param mapFile The filepath to mapfile to be generated * @param mapFile The filepath to mapfile to be generated
* @param template * @param template whether to use collection template item as starting point
* @param inputType The type of the input data (bibtex, csv, etc.) * @param inputType The type of the input data (bibtex, csv, etc.)
* @param workingDir The path to create temporary files (for command line or UI based) * @param workingDir The path to create temporary files (for command line or UI based)
* @throws Exception * @throws Exception if error occurs
*/ */
@Override @Override
public void addBTEItems(Context c, List<Collection> mycollections, public void addBTEItems(Context c, List<Collection> mycollections,
@@ -457,10 +457,14 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
/** /**
* item? try and add it to the archive. * item? try and add it to the archive.
* @param c current Context
* @param mycollections - add item to these Collections. * @param mycollections - add item to these Collections.
* @param path - directory containing the item directories. * @param path - directory containing the item directories.
* @param itemname handle - non-null means we have a pre-defined handle already * @param itemname handle - non-null means we have a pre-defined handle already
* @param mapOut - mapfile we're writing * @param mapOut - mapfile we're writing
* @param template whether to use collection template item as starting point
* @return Item
* @throws Exception if error occurs
*/ */
protected Item addItem(Context c, List<Collection> mycollections, String path, protected Item addItem(Context c, List<Collection> mycollections, String path,
String itemname, PrintWriter mapOut, boolean template) throws Exception String itemname, PrintWriter mapOut, boolean template) throws Exception
@@ -765,6 +769,8 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
* @param path The path to the data directory for this item * @param path The path to the data directory for this item
* @param filename The collections file filename. Should be "collections" * @param filename The collections file filename. Should be "collections"
* @return A list of collections in which to insert the item or null * @return A list of collections in which to insert the item or null
* @throws IOException if IO error
* @throws SQLException if database error
*/ */
protected List<Collection> processCollectionFile(Context c, String path, String filename) throws IOException, SQLException protected List<Collection> processCollectionFile(Context c, String path, String filename) throws IOException, SQLException
@@ -827,7 +833,12 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
} }
/** /**
* Read in the handle file or return null if empty or doesn't exist * Read in the handle file contents or return null if empty or doesn't exist
* @param c DSpace context
* @param i DSpace item
* @param path path to handle file
* @param filename name of file
* @return handle file contents or null if doesn't exist
*/ */
protected String processHandleFile(Context c, Item i, String path, String filename) protected String processHandleFile(Context c, Item i, String path, String filename)
{ {
@@ -886,6 +897,14 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
* Given a contents file and an item, stuffing it with bitstreams from the * Given a contents file and an item, stuffing it with bitstreams from the
* contents file Returns a List of Strings with lines from the contents * contents file Returns a List of Strings with lines from the contents
* file that request non-default bitstream permission * file that request non-default bitstream permission
* @param c DSpace Context
* @param i DSpace item
* @param path path as string
* @param filename file name
* @return List of Strings
* @throws SQLException if database error
* @throws IOException if IO error
* @throws AuthorizeException if authorization error
*/ */
protected List<String> processContentsFile(Context c, Item i, String path, protected List<String> processContentsFile(Context c, Item i, String path,
String filename) throws SQLException, IOException, String filename) throws SQLException, IOException,
@@ -1129,14 +1148,15 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
/** /**
* each entry represents a bitstream.... * each entry represents a bitstream....
* @param c * @param c DSpace Context
* @param i * @param i Dspace Item
* @param path * @param path path to file
* @param fileName * @param fileName file name
* @param bundleName * @param bundleName bundle name
* @throws SQLException * @param primary if primary bitstream
* @throws IOException * @throws SQLException if database error
* @throws AuthorizeException * @throws IOException if IO error
* @throws AuthorizeException if authorization error
*/ */
protected void processContentFileEntry(Context c, Item i, String path, protected void processContentFileEntry(Context c, Item i, String path,
String fileName, String bundleName, boolean primary) throws SQLException, String fileName, String bundleName, boolean primary) throws SQLException,
@@ -1209,14 +1229,15 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
/** /**
* Register the bitstream file into DSpace * Register the bitstream file into DSpace
* *
* @param c * @param c DSpace Context
* @param i * @param i DSpace Item
* @param assetstore * @param assetstore assetstore number
* @param bitstreamPath the full filepath expressed in the contents file * @param bitstreamPath the full filepath expressed in the contents file
* @param bundleName * @param bundleName bundle name
* @throws SQLException * @param description bitstream description
* @throws IOException * @throws SQLException if database error
* @throws AuthorizeException * @throws IOException if IO error
* @throws AuthorizeException if authorization error
*/ */
protected void registerBitstream(Context c, Item i, int assetstore, protected void registerBitstream(Context c, Item i, int assetstore,
String bitstreamPath, String bundleName, String description ) String bitstreamPath, String bundleName, String description )
@@ -1281,19 +1302,21 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
* Process the Options to apply to the Item. The options are tab delimited * Process the Options to apply to the Item. The options are tab delimited
* *
* Options: * Options:
* {@code
* 48217870-MIT.pdf permissions: -r 'MIT Users' description: Full printable version (MIT only) * 48217870-MIT.pdf permissions: -r 'MIT Users' description: Full printable version (MIT only)
* permissions:[r|w]-['group name'] * permissions:[r|w]-['group name']
* description: 'the description of the file' * description: 'the description of the file'
* * }
* where: * where:
* {@code
* [r|w] (meaning: read|write) * [r|w] (meaning: read|write)
* ['MIT Users'] (the group name) * ['MIT Users'] (the group name)
* * }
* @param c * @param c DSpace Context
* @param myItem * @param myItem DSpace Item
* @param options * @param options List of option strings
* @throws SQLException * @throws SQLException if database error
* @throws AuthorizeException * @throws AuthorizeException if authorization error
*/ */
protected void processOptions(Context c, Item myItem, List<String> options) protected void processOptions(Context c, Item myItem, List<String> options)
throws SQLException, AuthorizeException throws SQLException, AuthorizeException
@@ -1447,12 +1470,13 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
/** /**
* Set the Permission on a Bitstream. * Set the Permission on a Bitstream.
* *
* @param c * @param c DSpace Context
* @param g * @param g Dspace Group
* @param actionID * @param actionID action identifier
* @param bs * @param bs Bitstream
* @throws SQLException * @see org.dspace.core.Constants
* @throws AuthorizeException * @throws SQLException if database error
* @throws AuthorizeException if authorization error
*/ */
protected void setPermission(Context c, Group g, int actionID, Bitstream bs) protected void setPermission(Context c, Group g, int actionID, Bitstream bs)
throws SQLException, AuthorizeException throws SQLException, AuthorizeException
@@ -1488,9 +1512,9 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
// XML utility methods // XML utility methods
/** /**
* Lookup an attribute from a DOM node. * Lookup an attribute from a DOM node.
* @param n * @param n node
* @param name * @param name attribute name
* @return * @return attribute value
*/ */
private String getAttributeValue(Node n, String name) private String getAttributeValue(Node n, String name)
{ {
@@ -1512,8 +1536,8 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
/** /**
* Return the String value of a Node. * Return the String value of a Node.
* @param node * @param node node
* @return * @return string value
*/ */
protected String getStringValue(Node node) protected String getStringValue(Node node)
{ {
@@ -1539,6 +1563,9 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
* the filename to load from * the filename to load from
* *
* @return the DOM representation of the XML file * @return the DOM representation of the XML file
* @throws IOException if IO error
* @throws ParserConfigurationException if config error
* @throws SAXException if XML error
*/ */
protected Document loadXML(String filename) throws IOException, protected Document loadXML(String filename) throws IOException,
ParserConfigurationException, SAXException ParserConfigurationException, SAXException
@@ -1721,7 +1748,8 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
* @param resumeDir In case of a resume request, the directory that containsthe old mapfile and data * @param resumeDir In case of a resume request, the directory that containsthe old mapfile and data
* @param inputType The input type of the data (bibtex, csv, etc.), in case of local file * @param inputType The input type of the data (bibtex, csv, etc.), in case of local file
* @param context The context * @param context The context
* @throws Exception * @param template whether to use template item
* @throws Exception if error
*/ */
@Override @Override
public void processUIImport(String filepath, Collection owningCollection, String[] otherCollections, String resumeDir, String inputType, Context context, final boolean template) throws Exception public void processUIImport(String filepath, Collection owningCollection, String[] otherCollections, String resumeDir, String inputType, Context context, final boolean template) throws Exception

View File

@@ -36,15 +36,53 @@ import java.util.List;
public interface ItemImportService { public interface ItemImportService {
/**
*
* @param c DSpace Context
* @param mycollections List of Collections
* @param sourceDir source location
* @param mapFile map file
* @param template whether to use template item
* @throws Exception if error
*/
public void addItemsAtomic(Context c, List<Collection> mycollections, String sourceDir, String mapFile, boolean template) throws Exception; public void addItemsAtomic(Context c, List<Collection> mycollections, String sourceDir, String mapFile, boolean template) throws Exception;
/**
* Add items
* @param c DSpace Context
* @param mycollections List of Collections
* @param sourceDir source location
* @param mapFile map file
* @param template whether to use template item
* @throws Exception if error
*/
public void addItems(Context c, List<Collection> mycollections, public void addItems(Context c, List<Collection> mycollections,
String sourceDir, String mapFile, boolean template) throws Exception; String sourceDir, String mapFile, boolean template) throws Exception;
/**
* Unzip a file
* @param zipfile file
* @return unzip location
* @throws IOException if error
*/
public String unzip(File zipfile) throws IOException; public String unzip(File zipfile) throws IOException;
/**
* Unzip a file to a destination
* @param zipfile file
* @param destDir destination directory
* @return unzip location
* @throws IOException if error
*/
public String unzip(File zipfile, String destDir) throws IOException; public String unzip(File zipfile, String destDir) throws IOException;
/**
* Unzip a file in a specific source directory
* @param sourcedir source directory
* @param zipfilename file name
* @return unzip location
* @throws IOException if error
*/
public String unzip(String sourcedir, String zipfilename) throws IOException; public String unzip(String sourcedir, String zipfilename) throws IOException;
/** /**
@@ -54,8 +92,10 @@ public interface ItemImportService {
* @param owningCollection The owning collection the items will belong to * @param owningCollection The owning collection the items will belong to
* @param collections The collections the created items will be inserted to, apart from the owning one * @param collections The collections the created items will be inserted to, apart from the owning one
* @param resumeDir In case of a resume request, the directory that containsthe old mapfile and data * @param resumeDir In case of a resume request, the directory that containsthe old mapfile and data
* @param inputType The input type of the data (bibtex, csv, etc.), in case of local file
* @param context The context * @param context The context
* @throws Exception * @param template whether to use template item
* @throws Exception if error
*/ */
public void processUIImport(String url, Collection owningCollection, String[] collections, String resumeDir, String inputType, Context context, boolean template) throws Exception; public void processUIImport(String url, Collection owningCollection, String[] collections, String resumeDir, String inputType, Context context, boolean template) throws Exception;
@@ -71,7 +111,7 @@ public interface ItemImportService {
* - eperson to send the email to * - eperson to send the email to
* @param fileName * @param fileName
* - the filepath to the mapfile created by the batch import * - the filepath to the mapfile created by the batch import
* @throws javax.mail.MessagingException * @throws MessagingException if error
*/ */
public void emailSuccessMessage(Context context, EPerson eperson, public void emailSuccessMessage(Context context, EPerson eperson,
String fileName) throws MessagingException; String fileName) throws MessagingException;
@@ -86,39 +126,113 @@ public interface ItemImportService {
* - EPerson to send the error message to * - EPerson to send the error message to
* @param error * @param error
* - the error message * - the error message
* @throws MessagingException * @throws MessagingException if error
*/ */
public void emailErrorMessage(EPerson eperson, String error) public void emailErrorMessage(EPerson eperson, String error)
throws MessagingException; throws MessagingException;
/**
* Get imports available for a person
* @param eperson EPerson object
* @return List of batch uploads
* @throws Exception if error
*/
public List<BatchUpload> getImportsAvailable(EPerson eperson) public List<BatchUpload> getImportsAvailable(EPerson eperson)
throws Exception; throws Exception;
/**
* Get import upload directory
* @param ePerson EPerson object
* @return directory
* @throws Exception if error
*/
public String getImportUploadableDirectory(EPerson ePerson) public String getImportUploadableDirectory(EPerson ePerson)
throws Exception; throws Exception;
/**
* Delete a batch by ID
* @param c DSpace Context
* @param uploadId identifier
* @throws Exception if error
*/
public void deleteBatchUpload(Context c, String uploadId) throws Exception; public void deleteBatchUpload(Context c, String uploadId) throws Exception;
/**
* Replace items
* @param c DSpace Context
* @param mycollections List of Collections
* @param sourcedir source directory
* @param mapfile map file
* @param template whether to use template item
* @throws Exception if error
*/
public void replaceItems(Context c, List<Collection> mycollections, String sourcedir, String mapfile, boolean template) throws Exception; public void replaceItems(Context c, List<Collection> mycollections, String sourcedir, String mapfile, boolean template) throws Exception;
/**
* Delete items via mapfile
* @param c DSpace Context
* @param mapfile map file
* @throws Exception if error
*/
public void deleteItems(Context c, String mapfile) throws Exception; public void deleteItems(Context c, String mapfile) throws Exception;
/**
* Add items
* @param c DSpace Context
* @param mycollections List of Collections
* @param sourcedir source directory
* @param mapfile map file
* @param template whether to use template item
* @param bteInputType The input type of the data (bibtex, csv, etc.), in case of local file
* @param workingDir working directory
* @throws Exception if error
*/
public void addBTEItems(Context c, List<Collection> mycollections, String sourcedir, String mapfile, boolean template, String bteInputType, String workingDir) throws Exception; public void addBTEItems(Context c, List<Collection> mycollections, String sourcedir, String mapfile, boolean template, String bteInputType, String workingDir) throws Exception;
/**
* Get temporary work directory
* @return directory as string
*/
public String getTempWorkDir(); public String getTempWorkDir();
/**
* Get temporary work directory (as File)
* @return directory as File
*/
public File getTempWorkDirFile(); public File getTempWorkDirFile();
/**
* Cleanup
*/
public void cleanupZipTemp(); public void cleanupZipTemp();
/**
* Set test flag
* @param isTest true or false
*/
public void setTest(boolean isTest); public void setTest(boolean isTest);
/**
* Set resume flag
* @param isResume true or false
*/
public void setResume(boolean isResume); public void setResume(boolean isResume);
/**
* Set use workflow
* @param useWorkflow whether to enable workflow
*/
public void setUseWorkflow(boolean useWorkflow); public void setUseWorkflow(boolean useWorkflow);
public void setUseWorkflowSendEmail(boolean useWorkflow); /**
* @param useWorkflowSendMail whether to send mail
*/
public void setUseWorkflowSendEmail(boolean useWorkflowSendMail);
/**
* Set quiet flag
* @param isQuiet true or false
*/
public void setQuiet(boolean isQuiet); public void setQuiet(boolean isQuiet);
} }

View File

@@ -24,6 +24,13 @@ public class ActionManager implements Iterable<UpdateAction> {
protected Map<Class<? extends UpdateAction>, UpdateAction> registry protected Map<Class<? extends UpdateAction>, UpdateAction> registry
= new LinkedHashMap<Class<? extends UpdateAction>, UpdateAction>(); = new LinkedHashMap<Class<? extends UpdateAction>, UpdateAction>();
/**
* Get update action
* @param actionClass UpdateAction class
* @return instantiation of UpdateAction class
* @throws InstantiationException if instantiation error
* @throws IllegalAccessException if illegal access error
*/
public UpdateAction getUpdateAction(Class<? extends UpdateAction> actionClass) public UpdateAction getUpdateAction(Class<? extends UpdateAction> actionClass)
throws InstantiationException, IllegalAccessException throws InstantiationException, IllegalAccessException
{ {

View File

@@ -46,17 +46,17 @@ public class AddBitstreamsAction extends UpdateBitstreamsAction {
} }
/** /**
* Adds bitstreams from the archive as listed in the contents file. * Adds bitstreams from the archive as listed in the contents file.
* *
* @param context * @param context DSpace Context
* @param itarch * @param itarch Item Archive
* @param isTest * @param isTest test flag
* @param suppressUndo * @param suppressUndo undo flag
* @throws IllegalArgumentException * @throws IOException if IO error
* @throws ParseException * @throws IllegalArgumentException if arg exception
* @throws IOException * @throws SQLException if database error
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* @throws SQLException * @throws ParseException if parse error
*/ */
@Override @Override
public void execute(Context context, ItemArchive itarch, boolean isTest, public void execute(Context context, ItemArchive itarch, boolean isTest,
@@ -117,6 +117,22 @@ public class AddBitstreamsAction extends UpdateBitstreamsAction {
} }
} }
/**
* Add bitstream
* @param context DSpace Context
* @param itarch Item Archive
* @param item DSpace Item
* @param dir directory
* @param ce contents entry for bitstream
* @param suppressUndo undo flag
* @param isTest test flag
* @return bundle name
* @throws IOException if IO error
* @throws IllegalArgumentException if arg exception
* @throws SQLException if database error
* @throws AuthorizeException if authorization error
* @throws ParseException if parse error
*/
protected String addBitstream(Context context, ItemArchive itarch, Item item, File dir, protected String addBitstream(Context context, ItemArchive itarch, Item item, File dir,
ContentsEntry ce, boolean suppressUndo, boolean isTest) ContentsEntry ce, boolean suppressUndo, boolean isTest)
throws IOException, IllegalArgumentException, SQLException, AuthorizeException, ParseException throws IOException, IllegalArgumentException, SQLException, AuthorizeException, ParseException

View File

@@ -31,14 +31,14 @@ public class AddMetadataAction extends UpdateMetadataAction {
protected MetadataFieldService metadataFieldService = ContentServiceFactory.getInstance().getMetadataFieldService(); protected MetadataFieldService metadataFieldService = ContentServiceFactory.getInstance().getMetadataFieldService();
/** /**
* Adds metadata specified in the source archive * Adds metadata specified in the source archive
* *
* @param context * @param context DSpace Context
* @param itarch * @param itarch item archive
* @param isTest * @param isTest test flag
* @param suppressUndo * @param suppressUndo undo flag
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* @throws SQLException * @throws SQLException if database error
*/ */
@Override @Override
public void execute(Context context, ItemArchive itarch, boolean isTest, public void execute(Context context, ItemArchive itarch, boolean isTest,

View File

@@ -26,16 +26,16 @@ public abstract class BitstreamFilter {
/** /**
* The filter method * The filter method
* *
* @param bitstream * @param bitstream Bitstream
* @return whether the bitstream matches the criteria * @return whether the bitstream matches the criteria
* @throws BitstreamFilterException * @throws BitstreamFilterException if filter error
*/ */
public abstract boolean accept(Bitstream bitstream) throws BitstreamFilterException; public abstract boolean accept(Bitstream bitstream) throws BitstreamFilterException;
/** /**
* *
* @param filepath - The complete path for the properties file * @param filepath - The complete path for the properties file
* @throws IOException * @throws IOException if IO error
*/ */
public void initProperties(String filepath) public void initProperties(String filepath)
throws IOException throws IOException

View File

@@ -29,8 +29,8 @@ public class BitstreamFilterByBundleName extends BitstreamFilter {
/** /**
* Filter bitstream based on bundle name found in properties file * Filter bitstream based on bundle name found in properties file
* *
* @param bitstream * @param bitstream Bitstream
* @throws BitstreamFilterException * @throws BitstreamFilterException if filter error
* @return whether bitstream is in bundle * @return whether bitstream is in bundle
* *
*/ */

View File

@@ -29,7 +29,9 @@ public class BitstreamFilterByFilename extends BitstreamFilter {
* Tests bitstream by matching the regular expression in the * Tests bitstream by matching the regular expression in the
* properties against the bitstream name * properties against the bitstream name
* *
* @return whether bitstream name matches the regular expression * @param bitstream Bitstream
* @return whether bitstream name matches the regular expression
* @exception BitstreamFilterException if filter error
*/ */
@Override @Override
public boolean accept(Bitstream bitstream) throws BitstreamFilterException public boolean accept(Bitstream bitstream) throws BitstreamFilterException

View File

@@ -17,10 +17,18 @@ public class BitstreamFilterException extends Exception
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public BitstreamFilterException() {} public BitstreamFilterException() {}
/**
*
* @param msg exception message
*/
public BitstreamFilterException(String msg) public BitstreamFilterException(String msg)
{ {
super(msg); super(msg);
} }
/**
*
* @param e exception
*/
public BitstreamFilterException(Exception e) public BitstreamFilterException(Exception e)
{ {
super(e); super(e);

View File

@@ -20,10 +20,12 @@ import org.dspace.core.Constants;
* Lacking a spec or full documentation for the file format, * Lacking a spec or full documentation for the file format,
* it looks from the source code that the ordering or elements is not fixed * it looks from the source code that the ordering or elements is not fixed
* *
* e.g.: * e.g.:
* {@code
* 48217870-MIT.pdf\tbundle: bundlename\tpermissions: -r 'MIT Users'\tdescription: Full printable version (MIT only) * 48217870-MIT.pdf\tbundle: bundlename\tpermissions: -r 'MIT Users'\tdescription: Full printable version (MIT only)
* permissions: -[r|w] ['group name'] * permissions: -[r|w] ['group name']
* description: <the description of the file> * description: <the description of the file>
* }
* *
* *
*/ */
@@ -57,9 +59,9 @@ public class ContentsEntry
/** /**
* Factory method parses a line from the Contents Entry file * Factory method parses a line from the Contents Entry file
* *
* @param line * @param line line as string
* @return the parsed ContentsEntry object * @return the parsed ContentsEntry object
* @throws ParseException * @throws ParseException if parse error
*/ */
public static ContentsEntry parse(String line) public static ContentsEntry parse(String line)
throws ParseException throws ParseException

View File

@@ -30,15 +30,15 @@ public class DeleteBitstreamsAction extends UpdateBitstreamsAction
/** /**
* Delete bitstream from item * Delete bitstream from item
* *
* @param context * @param context DSpace Context
* @param itarch * @param itarch item archive
* @param isTest * @param isTest test flag
* @param suppressUndo * @param suppressUndo undo flag
* @throws IllegalArgumentException * @throws IOException if IO error
* @throws ParseException * @throws IllegalArgumentException if arg exception
* @throws IOException * @throws SQLException if database error
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* @throws SQLException * @throws ParseException if parse error
*/ */
@Override @Override
public void execute(Context context, ItemArchive itarch, boolean isTest, public void execute(Context context, ItemArchive itarch, boolean isTest,

View File

@@ -35,7 +35,7 @@ public class DeleteBitstreamsByFilterAction extends UpdateBitstreamsAction {
/** /**
* Set filter * Set filter
* *
* @param filter * @param filter BitstreamFilter
*/ */
public void setBitstreamFilter(BitstreamFilter filter) public void setBitstreamFilter(BitstreamFilter filter)
{ {
@@ -54,15 +54,15 @@ public class DeleteBitstreamsByFilterAction extends UpdateBitstreamsAction {
/** /**
* Delete bitstream * Delete bitstream
* *
* @param context * @param context DSpace Context
* @param itarch * @param itarch item archive
* @param isTest * @param isTest test flag
* @param suppressUndo * @param suppressUndo undo flag
* @throws IllegalArgumentException * @throws IOException if IO error
* @throws ParseException * @throws SQLException if database error
* @throws IOException * @throws AuthorizeException if authorization error
* @throws AuthorizeException * @throws ParseException if parse error
* @throws SQLException * @throws BitstreamFilterException if filter error
*/ */
@Override @Override
public void execute(Context context, ItemArchive itarch, boolean isTest, public void execute(Context context, ItemArchive itarch, boolean isTest,

View File

@@ -28,12 +28,13 @@ public class DeleteMetadataAction extends UpdateMetadataAction {
/** /**
* Delete metadata from item * Delete metadata from item
* *
* @param context * @param context DSpace Context
* @param itarch * @param itarch Item Archive
* @param isTest * @param isTest test flag
* @param suppressUndo * @param suppressUndo undo flag
* @throws ParseException * @throws SQLException if database error
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* @throws ParseException if parse error
*/ */
@Override @Override
public void execute(Context context, ItemArchive itarch, boolean isTest, public void execute(Context context, ItemArchive itarch, boolean isTest,

View File

@@ -16,7 +16,7 @@ import org.dspace.content.Item;
* *
* Adds some utility methods * Adds some utility methods
* *
* Really not at all general enough but supports Dublin Core and the compound form notation <schema>.<element>[.<qualifier>] * Really not at all general enough but supports Dublin Core and the compound form notation {@code <schema>.<element>[.<qualifier>]}
* *
* Does not support wildcard for qualifier * Does not support wildcard for qualifier
* *
@@ -47,8 +47,9 @@ class DtoMetadata
* @param element not null, not empty * @param element not null, not empty
* @param qualifier null; don't allow empty string or * indicating 'any' * @param qualifier null; don't allow empty string or * indicating 'any'
* @param language null or empty * @param language null or empty
* @param value * @param value value
* @return DtoMetadata object * @return DtoMetadata object
* @throws IllegalArgumentException if arg error
*/ */
public static DtoMetadata create(String schema, public static DtoMetadata create(String schema,
String element, String element,
@@ -70,7 +71,9 @@ class DtoMetadata
* *
* @param compoundForm of the form <schema>.<element>[.<qualifier>] * @param compoundForm of the form <schema>.<element>[.<qualifier>]
* @param language null or empty * @param language null or empty
* @param value * @param value value
* @throws ParseException if parse error
* @throws IllegalArgumentException if arg error
*/ */
public static DtoMetadata create(String compoundForm, String language, String value) public static DtoMetadata create(String compoundForm, String language, String value)
throws ParseException, IllegalArgumentException throws ParseException, IllegalArgumentException

View File

@@ -85,6 +85,8 @@ public class ItemArchive {
* @param dir - The directory File in the source archive * @param dir - The directory File in the source archive
* @param itemField - The metadata field in which the Item identifier is located * @param itemField - The metadata field in which the Item identifier is located
* if null, the default is the handle in the dc.identifier.uri field * if null, the default is the handle in the dc.identifier.uri field
* @return ItemArchive object
* @throws Exception if error
* *
*/ */
public static ItemArchive create(Context context, File dir, String itemField) public static ItemArchive create(Context context, File dir, String itemField)
@@ -137,6 +139,11 @@ public class ItemArchive {
return builder; return builder;
} }
/**
* Getter for Transformer
* @return Transformer
* @throws TransformerConfigurationException if config error
*/
protected Transformer getTransformer() protected Transformer getTransformer()
throws TransformerConfigurationException throws TransformerConfigurationException
{ {
@@ -176,7 +183,7 @@ public class ItemArchive {
/** /**
* Add metadata field to undo list * Add metadata field to undo list
* @param dtom * @param dtom DtoMetadata (represents metadata field)
*/ */
public void addUndoMetadataField(DtoMetadata dtom) public void addUndoMetadataField(DtoMetadata dtom)
{ {
@@ -194,7 +201,7 @@ public class ItemArchive {
/** /**
* Add bitstream id to delete contents file * Add bitstream id to delete contents file
* @param bitstreamId * @param bitstreamId bitstream ID
*/ */
public void addUndoDeleteContents(UUID bitstreamId) public void addUndoDeleteContents(UUID bitstreamId)
{ {
@@ -207,7 +214,9 @@ public class ItemArchive {
* This is the default implementation * This is the default implementation
* that uses the dc.identifier.uri metadatafield * that uses the dc.identifier.uri metadatafield
* that contains the item handle as its value * that contains the item handle as its value
* * @param context DSpace Context
* @throws SQLException if database error
* @throws Exception if error
*/ */
private Item itemFromHandleInput(Context context) private Item itemFromHandleInput(Context context)
throws SQLException, Exception throws SQLException, Exception
@@ -250,8 +259,8 @@ public class ItemArchive {
* *
* @param context - the DSpace context * @param context - the DSpace context
* @param itemField - the compound form of the metadata element <schema>.<element>.<qualifier> * @param itemField - the compound form of the metadata element <schema>.<element>.<qualifier>
* @throws SQLException * @throws SQLException if database error
* @throws Exception * @throws Exception if error
*/ */
private Item itemFromMetadataField(Context context, String itemField) private Item itemFromMetadataField(Context context, String itemField)
throws SQLException, AuthorizeException, Exception throws SQLException, AuthorizeException, Exception
@@ -285,7 +294,11 @@ public class ItemArchive {
return item; return item;
} }
/**
* Get DtoMetadata field
* @param compoundForm compound form
* @return DtoMetadata field
*/
private DtoMetadata getMetadataField(String compoundForm) private DtoMetadata getMetadataField(String compoundForm)
{ {
for (DtoMetadata dtom : dtomList) for (DtoMetadata dtom : dtomList)
@@ -301,8 +314,12 @@ public class ItemArchive {
/** /**
* write undo directory and files to Disk in archive format * write undo directory and files to Disk in archive format
* *
*
* @param undoDir - the root directory of the undo archive * @param undoDir - the root directory of the undo archive
* @throws IOException if IO error
* @throws ParserConfigurationException if config error
* @throws TransformerConfigurationException if transformer config error
* @throws TransformerException if transformer error
* @throws FileNotFoundException if file not found
*/ */
public void writeUndo(File undoDir) public void writeUndo(File undoDir)
throws IOException, ParserConfigurationException, TransformerConfigurationException, throws IOException, ParserConfigurationException, TransformerConfigurationException,

View File

@@ -113,7 +113,7 @@ public class ItemUpdate {
/** /**
* *
* @param argv * @param argv commandline args
*/ */
public static void main(String[] argv) public static void main(String[] argv)
{ {
@@ -392,6 +392,16 @@ public class ItemUpdate {
System.exit(status); System.exit(status);
} }
/**
* process an archive
* @param context DSpace Context
* @param sourceDirPath source path
* @param itemField item field
* @param metadataIndexName index name
* @param alterProvenance whether to alter provenance
* @param isTest test flag
* @throws Exception if error
*/
protected void processArchive(Context context, String sourceDirPath, String itemField, protected void processArchive(Context context, String sourceDirPath, String itemField,
String metadataIndexName, boolean alterProvenance, boolean isTest) String metadataIndexName, boolean alterProvenance, boolean isTest)
throws Exception throws Exception
@@ -511,8 +521,8 @@ public class ItemUpdate {
* *
* @param sourceDir - the original source directory * @param sourceDir - the original source directory
* @return the directory of the undo archive * @return the directory of the undo archive
* @throws FileNotFoundException * @throws FileNotFoundException if file doesn't exist
* @throws IOException * @throws IOException if IO error
*/ */
protected File initUndoArchive(File sourceDir) protected File initUndoArchive(File sourceDir)
throws FileNotFoundException, IOException throws FileNotFoundException, IOException
@@ -555,6 +565,12 @@ public class ItemUpdate {
//private void write //private void write
/**
* Set EPerson doing import
* @param context DSpace Context
* @param eperson EPerson obj
* @throws Exception if error
*/
protected void setEPerson(Context context, String eperson) protected void setEPerson(Context context, String eperson)
throws Exception throws Exception
{ {
@@ -589,7 +605,7 @@ public class ItemUpdate {
* poor man's logging * poor man's logging
* As with ItemImport, API logging goes through log4j to the DSpace.log files * 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. * whereas the batch logging goes to the console to be captured there.
* @param s * @param s String
*/ */
static void pr(String s) static void pr(String s)
{ {
@@ -598,7 +614,7 @@ public class ItemUpdate {
/** /**
* print if verbose flag is set * print if verbose flag is set
* @param s * @param s String
*/ */
static void prv(String s) static void prv(String s)
{ {

View File

@@ -48,7 +48,7 @@ import org.dspace.core.ConfigurationManager;
/** /**
* Miscellaneous methods for metadata handling that build on the API * Miscellaneous methods for metadata handling that build on the API
* which might have general utility outside of the specific use * which might have general utility outside of the specific use
* in context in ItemUpdate. * in context in ItemUpdate.
* *
@@ -68,11 +68,11 @@ public class MetadataUtilities {
clear (i.e. delete) all of these DCValues clear (i.e. delete) all of these DCValues
* add them back, minus the one to actually delete * add them back, minus the one to actually delete
* *
* * @param context DSpace Context
* @param item * @param item Item Object
* @param dtom * @param dtom metadata field
* @param isLanguageStrict - * @param isLanguageStrict whether strict or not
* * @throws SQLException if database error
* @return true if metadata field is found with matching value and was deleted * @return true if metadata field is found with matching value and was deleted
*/ */
public static boolean deleteMetadataByValue(Context context, Item item, DtoMetadata dtom, boolean isLanguageStrict) throws SQLException { public static boolean deleteMetadataByValue(Context context, Item item, DtoMetadata dtom, boolean isLanguageStrict) throws SQLException {
@@ -122,11 +122,13 @@ public class MetadataUtilities {
/** /**
* Append text to value metadata field to item * Append text to value metadata field to item
* *
* @param item * @param context DSpace Context
* @param dtom * @param item DSpace Item
* @param isLanguageStrict * @param dtom metadata field
* @param textToAppend * @param isLanguageStrict if strict
* @param textToAppend text to append
* @throws IllegalArgumentException - When target metadata field is not found * @throws IllegalArgumentException - When target metadata field is not found
* @throws SQLException if database error
*/ */
public static void appendMetadata(Context context, Item item, DtoMetadata dtom, boolean isLanguageStrict, public static void appendMetadata(Context context, Item item, DtoMetadata dtom, boolean isLanguageStrict,
String textToAppend) String textToAppend)
@@ -184,15 +186,15 @@ public class MetadataUtilities {
* Modification of method from ItemImporter.loadDublinCore * Modification of method from ItemImporter.loadDublinCore
* as a Factory method * as a Factory method
* *
* @param docBuilder - * @param docBuilder DocumentBuilder
* @param is - InputStream of dublin_core.xml * @param is - InputStream of dublin_core.xml
* @return list of DtoMetadata representing the metadata fields relating to an Item * @return list of DtoMetadata representing the metadata fields relating to an Item
* @throws SQLException * @throws SQLException if database error
* @throws IOException * @throws IOException if IO error
* @throws ParserConfigurationException * @throws ParserConfigurationException if parser config error
* @throws SAXException * @throws SAXException if XML error
* @throws TransformerException * @throws TransformerException if transformer error
* @throws AuthorizeException * @throws AuthorizeException if authorization error
*/ */
public static List<DtoMetadata> loadDublinCore(DocumentBuilder docBuilder, InputStream is) public static List<DtoMetadata> loadDublinCore(DocumentBuilder docBuilder, InputStream is)
throws SQLException, IOException, ParserConfigurationException, throws SQLException, IOException, ParserConfigurationException,
@@ -269,12 +271,12 @@ public class MetadataUtilities {
/** /**
* Write dublin_core.xml * Write dublin_core.xml
* *
* @param docBuilder * @param docBuilder DocumentBuilder
* @param dtomList * @param dtomList List of metadata fields
* @return xml document * @return xml document
* @throws ParserConfigurationException * @throws ParserConfigurationException if parser config error
* @throws TransformerConfigurationException * @throws TransformerConfigurationException if transformer config error
* @throws TransformerException * @throws TransformerException if transformer error
*/ */
public static Document writeDublinCore(DocumentBuilder docBuilder, List<DtoMetadata> dtomList) public static Document writeDublinCore(DocumentBuilder docBuilder, List<DtoMetadata> dtomList)
throws ParserConfigurationException, TransformerConfigurationException, TransformerException throws ParserConfigurationException, TransformerConfigurationException, TransformerException
@@ -313,11 +315,11 @@ public class MetadataUtilities {
/** /**
* write xml document to output stream * write xml document to output stream
* @param doc * @param doc XML Document
* @param transformer * @param transformer XML Transformer
* @param out * @param out OutputStream
* @throws IOException * @throws IOException if IO Error
* @throws TransformerException * @throws TransformerException if Transformer error
*/ */
public static void writeDocument(Document doc, Transformer transformer, OutputStream out) public static void writeDocument(Document doc, Transformer transformer, OutputStream out)
throws IOException, TransformerException throws IOException, TransformerException
@@ -332,9 +334,9 @@ public class MetadataUtilities {
// XML utility methods // XML utility methods
/** /**
* Lookup an attribute from a DOM node. * Lookup an attribute from a DOM node.
* @param n * @param n Node
* @param name * @param name name
* @return * @return attribute value
*/ */
private static String getAttributeValue(Node n, String name) private static String getAttributeValue(Node n, String name)
{ {
@@ -355,8 +357,8 @@ public class MetadataUtilities {
/** /**
* Return the String value of a Node. * Return the String value of a Node.
* @param node * @param node node
* @return * @return string value
*/ */
private static String getStringValue(Node node) private static String getStringValue(Node node)
{ {
@@ -379,7 +381,11 @@ public class MetadataUtilities {
* Rewrite of ItemImport's functionality * Rewrite of ItemImport's functionality
* but just the parsing of the file, not the processing of its elements. * but just the parsing of the file, not the processing of its elements.
* *
* @validate flag to verify matching files in tree * @param f file
* @return list of ContentsEntry
* @throws FileNotFoundException if file doesn't exist
* @throws IOException if IO error
* @throws ParseException if parse error
*/ */
public static List<ContentsEntry> readContentsFile(File f) public static List<ContentsEntry> readContentsFile(File f)
throws FileNotFoundException, IOException, ParseException throws FileNotFoundException, IOException, ParseException
@@ -421,9 +427,10 @@ public class MetadataUtilities {
/** /**
* *
* @param f * @param f file
* @throws FileNotFoundException * @return list of lines as strings
* @throws IOException * @throws FileNotFoundException if file doesn't exist
* @throws IOException if IO Error
*/ */
public static List<String> readDeleteContentsFile(File f) public static List<String> readDeleteContentsFile(File f)
throws FileNotFoundException, IOException throws FileNotFoundException, IOException
@@ -466,7 +473,7 @@ public class MetadataUtilities {
/** /**
* Get display of Metadatum * Get display of Metadatum
* *
* @param dcv * @param dcv MetadataValue
* @return string displaying elements of the Metadatum * @return string displaying elements of the Metadatum
*/ */
public static String getDCValueString(MetadataValue dcv) public static String getDCValueString(MetadataValue dcv)
@@ -478,7 +485,10 @@ public class MetadataUtilities {
} }
/** /**
* * Return compound form of a metadata field (i.e. schema.element.qualifier)
* @param schema schema
* @param element element
* @param qualifier qualifier
* @return a String representation of the two- or three-part form of a metadata element * @return a String representation of the two- or three-part form of a metadata element
* e.g. dc.identifier.uri * e.g. dc.identifier.uri
*/ */
@@ -495,9 +505,10 @@ public class MetadataUtilities {
} }
/** /**
* Parses metadata field given in the form <schema>.<element>[.<qualifier>|.*] * Parses metadata field given in the form {@code <schema>.<element>[.<qualifier>|.*]}
* checks for correct number of elements (2 or 3) and for empty strings * checks for correct number of elements (2 or 3) and for empty strings
* *
* @param compoundForm compound form of metadata field
* @return String Array * @return String Array
* @throws ParseException if validity checks fail * @throws ParseException if validity checks fail
* *

View File

@@ -27,10 +27,10 @@ public class OriginalBitstreamFilter extends BitstreamFilterByBundleName
/** /**
* Tests bitstreams for containment in an ORIGINAL bundle * Tests bitstreams for containment in an ORIGINAL bundle
* * @param bitstream Bitstream
* @return true if the bitstream is in the ORIGINAL bundle * @return true if the bitstream is in the ORIGINAL bundle
* *
* @throws BitstreamFilterException * @throws BitstreamFilterException if filter error
*/ */
@Override @Override
public boolean accept(Bitstream bitstream) public boolean accept(Bitstream bitstream)

View File

@@ -30,8 +30,8 @@ public class OriginalWithDerivativesBitstreamFilter extends BitstreamFilter
/** /**
* Tests bitstream for membership in specified bundles (ORIGINAL, TEXT, THUMBNAIL) * Tests bitstream for membership in specified bundles (ORIGINAL, TEXT, THUMBNAIL)
* *
* @param bitstream * @param bitstream Bitstream
* @throws BitstreamFilterException * @throws BitstreamFilterException if error
* @return true if bitstream is in specified bundles * @return true if bitstream is in specified bundles
*/ */
@Override @Override

View File

@@ -21,13 +21,13 @@ public interface UpdateAction
/** /**
* Action to update item * Action to update item
* *
* @param context * @param context DSpace context
* @param itarch * @param itarch item archive
* @param isTest * @param isTest test flag
* @param suppressUndo * @param suppressUndo undo flag
* @throws Exception * @throws Exception if error
*/ */
public void execute(Context context, ItemArchive itarch, boolean isTest, boolean suppressUndo) public void execute(Context context, ItemArchive itarch, boolean isTest, boolean suppressUndo)
throws Exception; throws Exception;

View File

@@ -27,7 +27,7 @@ public abstract class UpdateBitstreamsAction implements UpdateAction {
/** /**
* Set variable to indicate that the dc.description.provenance field may * Set variable to indicate that the dc.description.provenance field may
* be changed as a result of Bitstream changes by ItemUpdate * be changed as a result of Bitstream changes by ItemUpdate
* @param alterProvenance * @param alterProvenance whether to alter provenance
*/ */
public void setAlterProvenance(boolean alterProvenance) public void setAlterProvenance(boolean alterProvenance)
{ {

View File

@@ -13,7 +13,7 @@ import java.util.Set;
/** /**
* This abstract subclass for metadata actions * This abstract subclass for metadata actions
* maintains a collection for the target metadata fields * maintains a collection for the target metadata fields
* expressed as a string in the compound notation ( <schema>.<element>.<qualifier> ) * expressed as a string in the compound notation ( {@code <schema>.<element>.<qualifier>} )
* on which to apply the action when the method execute is called. * on which to apply the action when the method execute is called.
* *
* Implemented as a Set to avoid problems with duplicates * Implemented as a Set to avoid problems with duplicates
@@ -36,7 +36,7 @@ public abstract class UpdateMetadataAction implements UpdateAction {
/** /**
* Set target fields * Set target fields
* *
* @param targetFields * @param targetFields Set of target fields to update
*/ */
public void addTargetFields(Set<String> targetFields) { public void addTargetFields(Set<String> targetFields) {
for (String tf : targetFields) for (String tf : targetFields)
@@ -48,7 +48,7 @@ public abstract class UpdateMetadataAction implements UpdateAction {
/** /**
* Add array of target fields to update * Add array of target fields to update
* @param targetFields * @param targetFields array of target fields to update
*/ */
public void addTargetFields(String[] targetFields) { public void addTargetFields(String[] targetFields) {
for (String tf : targetFields) for (String tf : targetFields)
@@ -61,7 +61,7 @@ public abstract class UpdateMetadataAction implements UpdateAction {
/** /**
* Add single field to update * Add single field to update
* *
* @param targetField * @param targetField target field to update
*/ */
public void addTargetField(String targetField) { public void addTargetField(String targetField) {
this.targetFields.add(targetField); this.targetFields.add(targetField);

View File

@@ -23,6 +23,12 @@ import org.jdom.Document;
*/ */
public class CommandRunner public class CommandRunner
{ {
/**
*
* @param args commandline args
* @throws IOException if IO error
* @throws FileNotFoundException if file doesn't exist
*/
public static void main(String[] args) public static void main(String[] args)
throws FileNotFoundException, IOException throws FileNotFoundException, IOException
{ {
@@ -46,11 +52,10 @@ public class CommandRunner
/** /**
* Read a file of command lines and execute each in turn. * Read a file of command lines and execute each in turn.
* *
* @param doc details of recognized commands.
* @param script the file of command lines to be executed. * @param script the file of command lines to be executed.
* @return * @return status code
* @throws FileNotFoundException * @throws IOException if IO error
* @throws IOException * @throws FileNotFoundException if file doesn't exist
*/ */
static int runManyCommands(String script) static int runManyCommands(String script)
throws FileNotFoundException, IOException throws FileNotFoundException, IOException

View File

@@ -34,6 +34,8 @@ public class ScriptLauncher
* Execute the DSpace script launcher * Execute the DSpace script launcher
* *
* @param args Any parameters required to be passed to the scripts it executes * @param args Any parameters required to be passed to the scripts it executes
* @throws IOException if IO error
* @throws FileNotFoundException if file doesn't exist
*/ */
public static void main(String[] args) public static void main(String[] args)
throws FileNotFoundException, IOException throws FileNotFoundException, IOException
@@ -90,8 +92,8 @@ public class ScriptLauncher
/** /**
* Recognize and execute a single command. * Recognize and execute a single command.
* @param doc * @param doc Document
* @param args * @param args arguments
*/ */
static int runOneCommand(Document commandConfigs, String[] args) static int runOneCommand(Document commandConfigs, String[] args)
{ {
@@ -275,6 +277,7 @@ public class ScriptLauncher
/** /**
* Display the commands that the current launcher config file knows about * Display the commands that the current launcher config file knows about
* @param commandConfigs configs as Document
*/ */
private static void display(Document commandConfigs) private static void display(Document commandConfigs)
{ {

View File

@@ -7,14 +7,7 @@
*/ */
package org.dspace.app.mediafilter; package org.dspace.app.mediafilter;
import java.awt.Graphics2D;
import java.awt.Color;
import java.awt.image.*; import java.awt.image.*;
import java.awt.RenderingHints;
import java.awt.Transparency;
import java.awt.Font;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream; import java.io.InputStream;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
@@ -29,7 +22,7 @@ import org.dspace.app.mediafilter.JPEGFilter;
* thumbnail.maxwidth, thumbnail.maxheight, the size we want our thumbnail to be * thumbnail.maxwidth, thumbnail.maxheight, the size we want our thumbnail to be
* no bigger than. Creates only JPEGs. * no bigger than. Creates only JPEGs.
* *
* @author Jason Sherman <jsherman@usao.edu> * @author Jason Sherman jsherman@usao.edu
*/ */
public class BrandedPreviewJPEGFilter extends MediaFilter public class BrandedPreviewJPEGFilter extends MediaFilter
{ {

View File

@@ -50,10 +50,13 @@ public interface FormatFilter
public String getDescription(); public String getDescription();
/** /**
* @param item Item
* @param source * @param source
* input stream * input stream
* @param verbose verbosity flag
* *
* @return result of filter's transformation, written out to a bitstream * @return result of filter's transformation, written out to a bitstream
* @throws Exception if error
*/ */
public InputStream getDestinationStream(Item item, InputStream source, boolean verbose) public InputStream getDestinationStream(Item item, InputStream source, boolean verbose)
throws Exception; throws Exception;
@@ -76,6 +79,7 @@ public interface FormatFilter
* *
* @return true if bitstream processing should continue, * @return true if bitstream processing should continue,
* false if this bitstream should be skipped * false if this bitstream should be skipped
* @throws Exception if error
*/ */
public boolean preProcessBitstream(Context c, Item item, Bitstream source, boolean verbose) public boolean preProcessBitstream(Context c, Item item, Bitstream source, boolean verbose)
throws Exception; throws Exception;
@@ -96,6 +100,7 @@ public interface FormatFilter
* @param generatedBitstream * @param generatedBitstream
* the bitstream which was generated by * the bitstream which was generated by
* this filter. * this filter.
* @throws Exception if error
*/ */
public void postProcessBitstream(Context c, Item item, Bitstream generatedBitstream) public void postProcessBitstream(Context c, Item item, Bitstream generatedBitstream)
throws Exception; throws Exception;

View File

@@ -27,7 +27,7 @@ import org.dspace.core.ConfigurationManager;
* thumbnail.maxwidth, thumbnail.maxheight, the size we want our thumbnail to be * thumbnail.maxwidth, thumbnail.maxheight, the size we want our thumbnail to be
* no bigger than. Creates only JPEGs. * no bigger than. Creates only JPEGs.
* *
* @author Jason Sherman <jsherman@usao.edu> * @author Jason Sherman jsherman@usao.edu
*/ */
public class JPEGFilter extends MediaFilter implements SelfRegisterInputFormats public class JPEGFilter extends MediaFilter implements SelfRegisterInputFormats
{ {

View File

@@ -7,13 +7,7 @@
*/ */
package org.dspace.app.mediafilter; package org.dspace.app.mediafilter;
import java.awt.Graphics2D;
import java.awt.Color;
import java.awt.image.*; import java.awt.image.*;
import java.awt.RenderingHints;
import java.awt.Transparency;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream; import java.io.InputStream;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
@@ -22,7 +16,6 @@ import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.rendering.PDFRenderer; import org.apache.pdfbox.rendering.PDFRenderer;
import org.dspace.content.Item; import org.dspace.content.Item;
import org.dspace.core.ConfigurationManager;
import org.dspace.app.mediafilter.JPEGFilter; import org.dspace.app.mediafilter.JPEGFilter;
@@ -33,8 +26,8 @@ import org.dspace.app.mediafilter.JPEGFilter;
* thumbnail.maxwidth, thumbnail.maxheight, the size we want our thumbnail to be * thumbnail.maxwidth, thumbnail.maxheight, the size we want our thumbnail to be
* no bigger than. Creates only JPEGs. * no bigger than. Creates only JPEGs.
* *
* @author Ivan Masár <helix84@centrum.sk> * @author Ivan Masár helix84@centrum.sk
* @author Jason Sherman <jsherman@usao.edu> * @author Jason Sherman jsherman@usao.edu
*/ */
public class PDFBoxThumbnail extends MediaFilter implements SelfRegisterInputFormats public class PDFBoxThumbnail extends MediaFilter implements SelfRegisterInputFormats
{ {

View File

@@ -72,7 +72,7 @@ public interface MediaFilterService {
* already been filtered, and if not or if overWrite is set, invokes the * already been filtered, and if not or if overWrite is set, invokes the
* filter. * filter.
* *
* @param c * @param context
* context * context
* @param item * @param item
* item containing bitstream to process * item containing bitstream to process
@@ -80,7 +80,7 @@ public interface MediaFilterService {
* source bitstream to process * source bitstream to process
* @param formatFilter * @param formatFilter
* FormatFilter to perform filtering * FormatFilter to perform filtering
* * @throws Exception if error occurs
* @return true if new rendition is created, false if rendition already * @return true if new rendition is created, false if rendition already
* exists and overWrite is not set * exists and overWrite is not set
*/ */

View File

@@ -478,12 +478,12 @@ public class Packager
* @param pkgParams Parameters to pass to individual packager instances * @param pkgParams Parameters to pass to individual packager instances
* @param sourceFile location of the source package to ingest * @param sourceFile location of the source package to ingest
* @param parentObjs Parent DSpace object(s) to attach new object to * @param parentObjs Parent DSpace object(s) to attach new object to
* @throws IOException * @throws IOException if IO error
* @throws SQLException * @throws SQLException if database error
* @throws FileNotFoundException * @throws FileNotFoundException if file doesn't exist
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* @throws CrosswalkException * @throws CrosswalkException if crosswalk error
* @throws PackageException * @throws PackageException if packaging error
*/ */
protected void ingest(Context context, PackageIngester sip, PackageParameters pkgParams, String sourceFile, DSpaceObject parentObjs[]) protected void ingest(Context context, PackageIngester sip, PackageParameters pkgParams, String sourceFile, DSpaceObject parentObjs[])
throws IOException, SQLException, FileNotFoundException, AuthorizeException, CrosswalkException, PackageException throws IOException, SQLException, FileNotFoundException, AuthorizeException, CrosswalkException, PackageException
@@ -617,12 +617,12 @@ public class Packager
* @param dso DSpace Object to disseminate as a package * @param dso DSpace Object to disseminate as a package
* @param pkgParams Parameters to pass to individual packager instances * @param pkgParams Parameters to pass to individual packager instances
* @param outputFile File where final package should be saved * @param outputFile File where final package should be saved
* @throws IOException * @throws IOException if IO error
* @throws SQLException * @throws SQLException if database error
* @throws FileNotFoundException * @throws FileNotFoundException if file doesn't exist
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* @throws CrosswalkException * @throws CrosswalkException if crosswalk error
* @throws PackageException * @throws PackageException if packaging error
*/ */
protected void disseminate(Context context, PackageDisseminator dip, protected void disseminate(Context context, PackageDisseminator dip,
DSpaceObject dso, PackageParameters pkgParams, DSpaceObject dso, PackageParameters pkgParams,
@@ -699,12 +699,12 @@ public class Packager
* @param pkgParams Parameters to pass to individual packager instances * @param pkgParams Parameters to pass to individual packager instances
* @param sourceFile location of the source package to ingest as the replacement * @param sourceFile location of the source package to ingest as the replacement
* @param objToReplace DSpace object to replace (may be null if it will be specified in the package itself) * @param objToReplace DSpace object to replace (may be null if it will be specified in the package itself)
* @throws IOException * @throws IOException if IO error
* @throws SQLException * @throws SQLException if database error
* @throws FileNotFoundException * @throws FileNotFoundException if file doesn't exist
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* @throws CrosswalkException * @throws CrosswalkException if crosswalk error
* @throws PackageException * @throws PackageException if packaging error
*/ */
protected void replace(Context context, PackageIngester sip, PackageParameters pkgParams, String sourceFile, DSpaceObject objToReplace) protected void replace(Context context, PackageIngester sip, PackageParameters pkgParams, String sourceFile, DSpaceObject objToReplace)
throws IOException, SQLException, FileNotFoundException, AuthorizeException, CrosswalkException, PackageException throws IOException, SQLException, FileNotFoundException, AuthorizeException, CrosswalkException, PackageException

View File

@@ -16,7 +16,7 @@ import java.sql.SQLException;
/** /**
* Database Access Object interface class for the RequestItem object. * Database Access Object interface class for the RequestItem object.
* The implementation of this class is responsible for all database calls for the RequestItem object and is autowired by spring * The implementation of this class is responsible for all database calls for the RequestItem object and is autowired by spring
* This class should only be accessed from a single service & should never be exposed outside of the API * This class should only be accessed from a single service and should never be exposed outside of the API
* *
* @author kevinvandevelde at atmire.com * @author kevinvandevelde at atmire.com
*/ */

View File

@@ -26,7 +26,7 @@ public interface RequestItemService {
* Generate a request item representing the request and put it into the DB * Generate a request item representing the request and put it into the DB
* @param context * @param context
* @return the token of the request item * @return the token of the request item
* @throws java.sql.SQLException * @throws SQLException if database error
*/ */
public String createRequest(Context context, Bitstream bitstream, Item item, boolean allFiles, String reqEmail, String reqName, String reqMessage) public String createRequest(Context context, Bitstream bitstream, Item item, boolean allFiles, String reqEmail, String reqName, String reqMessage)
throws SQLException; throws SQLException;

View File

@@ -140,7 +140,7 @@ public class SFXFileReaderServiceImpl implements SFXFileReaderService {
* @param e DOM node of the mapping pair in the XML file (field element) * @param e DOM node of the mapping pair in the XML file (field element)
* @param item The item to process, from which metadata values will be taken * @param item The item to process, from which metadata values will be taken
* @return assembled OpenURL query. * @return assembled OpenURL query.
* @throws IOException * @throws IOException if IO error
*/ */
protected String processFields(Node e, Item item) throws IOException { protected String processFields(Node e, Item item) throws IOException {
NodeList cl = e.getChildNodes(); NodeList cl = e.getChildNodes();

View File

@@ -36,7 +36,7 @@ public interface SFXFileReaderService {
* @param item The item to process, from which metadata values will be taken * @param item The item to process, from which metadata values will be taken
* *
* @return the SFX string * @return the SFX string
* @throws java.io.IOException * @throws IOException if IO error
*/ */
public String loadSFXFile(String fileName, Item item) throws IOException; public String loadSFXFile(String fileName, Item item) throws IOException;
@@ -53,7 +53,7 @@ public interface SFXFileReaderService {
* @param node DOM node of the mapping pair in the XML file (field element) * @param node DOM node of the mapping pair in the XML file (field element)
* @param item The item to process, from which metadata values will be taken * @param item The item to process, from which metadata values will be taken
* @return processed fields. * @return processed fields.
* @throws IOException * @throws IOException if IO error
*/ */
public String doNodes(Node node, Item item) throws IOException; public String doNodes(Node node, Item item) throws IOException;
@@ -71,7 +71,7 @@ public interface SFXFileReaderService {
public boolean isEmptyTextNode(Node nd); public boolean isEmptyTextNode(Node nd);
/** /**
* Returns the value of the node's attribute named <name> * Returns the value of the node's attribute named {@code <name>}
*/ */
public String getAttribute(Node e, String name); public String getAttribute(Node e, String name);

View File

@@ -74,7 +74,7 @@ public abstract class AbstractGenerator
/** /**
* Start writing a new sitemap file. * Start writing a new sitemap file.
* *
* @throws IOException * @throws IOException if IO error
* if an error occurs creating the file * if an error occurs creating the file
*/ */
protected void startNewFile() throws IOException protected void startNewFile() throws IOException
@@ -102,7 +102,7 @@ public abstract class AbstractGenerator
* Full URL to add * Full URL to add
* @param lastMod * @param lastMod
* Date URL was last modified, or {@code null} * Date URL was last modified, or {@code null}
* @throws IOException * @throws IOException if IO error
* if an error occurs writing * if an error occurs writing
*/ */
public void addURL(String url, Date lastMod) throws IOException public void addURL(String url, Date lastMod) throws IOException
@@ -130,7 +130,7 @@ public abstract class AbstractGenerator
/** /**
* Finish with the current sitemap file. * Finish with the current sitemap file.
* *
* @throws IOException * @throws IOException if IO error
* if an error occurs writing * if an error occurs writing
*/ */
protected void closeCurrentFile() throws IOException protected void closeCurrentFile() throws IOException
@@ -147,7 +147,7 @@ public abstract class AbstractGenerator
* *
* @return number of sitemap files written. * @return number of sitemap files written.
* *
* @throws IOException * @throws IOException if IO error
* if an error occurs writing * if an error occurs writing
*/ */
public int finish() throws IOException public int finish() throws IOException
@@ -246,7 +246,7 @@ public abstract class AbstractGenerator
* stream to write the index to * stream to write the index to
* @param sitemapCount * @param sitemapCount
* number of sitemaps that were generated * number of sitemaps that were generated
* @throws IOException * @throws IOException if IO error
* if an IO error occurs * if an IO error occurs
*/ */
public abstract void writeIndex(PrintStream output, int sitemapCount) public abstract void writeIndex(PrintStream output, int sitemapCount)

View File

@@ -152,9 +152,9 @@ public class GenerateSitemaps
* if {@code true}, generate an HTML sitemap. * if {@code true}, generate an HTML sitemap.
* @param makeSitemapOrg * @param makeSitemapOrg
* if {@code true}, generate an sitemap.org sitemap. * if {@code true}, generate an sitemap.org sitemap.
* @throws SQLException * @throws SQLException if database error
* if a database error occurs. * if a database error occurs.
* @throws IOException * @throws IOException if IO error
* if IO error occurs. * if IO error occurs.
*/ */
public static void generateSitemaps(boolean makeHTMLMap, public static void generateSitemaps(boolean makeHTMLMap,

View File

@@ -25,9 +25,9 @@ import org.dspace.core.ConfigurationManager;
/** /**
* This class allows the running of the DSpace statistic tools * This class allows the running of the DSpace statistic tools
* *
* Usage: java CreateStatReport -r <statistic to run> * Usage: {@code java CreateStatReport -r <statistic to run>}
* Available: <stat-initial> <stat-general> <stat-monthly> <stat-report-initial> * Available: {@code <stat-initial> <stat-general> <stat-monthly> <stat-report-initial>
* <stat-report-general> <stat-report-monthly> * <stat-report-general> <stat-report-monthly>}
* *
* @author Chris Yates * @author Chris Yates
* *
@@ -145,7 +145,7 @@ public class CreateStatReport {
/** /**
* This method generates a report from the first of the current month to the end of the current month. * This method generates a report from the first of the current month to the end of the current month.
* *
* @throws Exception * @throws Exception if error
*/ */
private static void statMonthly() throws Exception { private static void statMonthly() throws Exception {
@@ -184,7 +184,7 @@ public class CreateStatReport {
/** /**
* This method generates a full report based on the full log period * This method generates a full report based on the full log period
* *
* @throws Exception * @throws Exception if error
*/ */
private static void statGeneral() throws Exception { private static void statGeneral() throws Exception {
@@ -216,7 +216,7 @@ public class CreateStatReport {
* This script starts from the year and month specified below and loops each month until the current month * This script starts from the year and month specified below and loops each month until the current month
* generating a monthly aggregation files for the DStat system. * generating a monthly aggregation files for the DStat system.
* *
* @throws Exception * @throws Exception if error
*/ */
private static void statInitial() throws Exception { private static void statInitial() throws Exception {
@@ -265,7 +265,7 @@ public class CreateStatReport {
/** /**
* This method generates a full report based on the full log period * This method generates a full report based on the full log period
* *
* @throws Exception * @throws Exception if error
*/ */
private static void statReportGeneral() throws Exception { private static void statReportGeneral() throws Exception {
@@ -304,7 +304,7 @@ public class CreateStatReport {
* This script starts from the year and month specified below and loops each month until the current month * This script starts from the year and month specified below and loops each month until the current month
* generating monthly reports from the DStat aggregation files * generating monthly reports from the DStat aggregation files
* *
* @throws Exception * @throws Exception if error
*/ */
private static void statReportInitial() throws Exception { private static void statReportInitial() throws Exception {
@@ -349,7 +349,7 @@ public class CreateStatReport {
/** /**
* This method generates a report from the aggregation files which have been run for the most recent month * This method generates a report from the aggregation files which have been run for the most recent month
* *
* @throws Exception * @throws Exception if error
*/ */
private static void statReportMonthly() throws Exception private static void statReportMonthly() throws Exception
{ {

View File

@@ -334,7 +334,7 @@ public class HTMLReport implements Report
/** /**
* output the report block based on the passed mapping, where the mapping * output the report block based on the passed mapping, where the mapping
* sould be "name of report element" => "value", where both sides of the * should be "name of report element" to "value", where both sides of the
* mapping should be Strings. This class also assumes that the reference * mapping should be Strings. This class also assumes that the reference
* is a linkable URL to the resource * is a linkable URL to the resource
* *

View File

@@ -43,10 +43,10 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param bitstream * @param bitstream
* the bitstream that the policy refer to * the bitstream that the policy refer to
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current context (current user) is not allowed to * if the current context (current user) is not allowed to
* manage the bitstream's policies * manage the bitstream's policies
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void authorizeManageBitstreamPolicy(Context context, public static void authorizeManageBitstreamPolicy(Context context,
@@ -64,10 +64,10 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param bundle * @param bundle
* the bundle that the policy refer to * the bundle that the policy refer to
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current context (current user) is not allowed to * if the current context (current user) is not allowed to
* manage the bundle's policies * manage the bundle's policies
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void authorizeManageBundlePolicy(Context context, public static void authorizeManageBundlePolicy(Context context,
@@ -85,10 +85,10 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param item * @param item
* the item that the policy refer to * the item that the policy refer to
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current context (current user) is not allowed to * if the current context (current user) is not allowed to
* manage the item's policies * manage the item's policies
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void authorizeManageItemPolicy(Context context, Item item) public static void authorizeManageItemPolicy(Context context, Item item)
@@ -124,10 +124,10 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param collection * @param collection
* the collection that the policy refer to * the collection that the policy refer to
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current context (current user) is not allowed to * if the current context (current user) is not allowed to
* manage the collection's policies * manage the collection's policies
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void authorizeManageCollectionPolicy(Context context, public static void authorizeManageCollectionPolicy(Context context,
@@ -159,10 +159,10 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param community * @param community
* the community that the policy refer to * the community that the policy refer to
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current context (current user) is not allowed to * if the current context (current user) is not allowed to
* manage the community's policies * manage the community's policies
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void authorizeManageCommunityPolicy(Context context, public static void authorizeManageCommunityPolicy(Context context,
@@ -185,9 +185,9 @@ public class AuthorizeUtil
* *
* @param context * @param context
* the DSpace Context Object * the DSpace Context Object
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not a System Admin * if the current user is not a System Admin
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void requireAdminRole(Context context) public static void requireAdminRole(Context context)
@@ -208,10 +208,10 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param item * @param item
* the item that the CC License refer to * the item that the CC License refer to
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not allowed to * if the current user is not allowed to
* manage the item's CC License * manage the item's CC License
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void authorizeManageCCLicense(Context context, Item item) public static void authorizeManageCCLicense(Context context, Item item)
@@ -254,10 +254,10 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param collection * @param collection
* the collection * the collection
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not allowed to manage the collection's * if the current user is not allowed to manage the collection's
* template item * template item
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void authorizeManageTemplateItem(Context context, public static void authorizeManageTemplateItem(Context context,
@@ -296,10 +296,10 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param collection * @param collection
* the collection * the collection
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not allowed to manage the collection's * if the current user is not allowed to manage the collection's
* submitters group * submitters group
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void authorizeManageSubmittersGroup(Context context, public static void authorizeManageSubmittersGroup(Context context,
@@ -331,10 +331,10 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param collection * @param collection
* the collection * the collection
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not allowed to manage the collection's * if the current user is not allowed to manage the collection's
* workflow groups * workflow groups
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void authorizeManageWorkflowsGroup(Context context, public static void authorizeManageWorkflowsGroup(Context context,
@@ -368,10 +368,10 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param collection * @param collection
* the collection * the collection
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not allowed to create/edit the * if the current user is not allowed to create/edit the
* collection's admins group * collection's admins group
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void authorizeManageAdminGroup(Context context, public static void authorizeManageAdminGroup(Context context,
@@ -405,10 +405,10 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param collection * @param collection
* the collection * the collection
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not allowed to remove the * if the current user is not allowed to remove the
* collection's admins group * collection's admins group
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void authorizeRemoveAdminGroup(Context context, public static void authorizeRemoveAdminGroup(Context context,
@@ -439,10 +439,10 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param community * @param community
* the community * the community
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not allowed to create/edit the * if the current user is not allowed to create/edit the
* community's admins group * community's admins group
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void authorizeManageAdminGroup(Context context, public static void authorizeManageAdminGroup(Context context,
@@ -470,10 +470,10 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param community * @param community
* the community * the community
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not allowed to remove the * if the current user is not allowed to remove the
* collection's admins group * collection's admins group
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void authorizeRemoveAdminGroup(Context context, public static void authorizeRemoveAdminGroup(Context context,
@@ -505,10 +505,10 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param rp * @param rp
* a resource policy * a resource policy
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current context (current user) is not allowed to * if the current context (current user) is not allowed to
* remove/edit the policy * remove/edit the policy
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
*/ */
public static void authorizeManagePolicy(Context c, ResourcePolicy rp) public static void authorizeManagePolicy(Context c, ResourcePolicy rp)
@@ -546,9 +546,9 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param item * @param item
* the item * the item
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not allowed to perform the item * if the current user is not allowed to perform the item
* withdraw * withdraw
*/ */
@@ -589,9 +589,9 @@ public class AuthorizeUtil
* the DSpace Context Object * the DSpace Context Object
* @param item * @param item
* the item * the item
* @throws SQLException * @throws SQLException if database error
* if a db error occur * if a db error occur
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not allowed to perform the item * if the current user is not allowed to perform the item
* reinstatement * reinstatement
*/ */

View File

@@ -415,12 +415,12 @@ public class DCInput
* The closed attribute of the vocabulary tag for this field as set in * The closed attribute of the vocabulary tag for this field as set in
* input-forms.xml * input-forms.xml
* *
* <code> * {@code
* <field> * <field>
* ..... * .....
* <vocabulary closed="true">nsrc</vocabulary> * <vocabulary closed="true">nsrc</vocabulary>
* </field> * </field>
* </code> * }
* @return the closedVocabulary flags: true if the entry should be restricted * @return the closedVocabulary flags: true if the entry should be restricted
* only to vocabulary terms, false otherwise * only to vocabulary terms, false otherwise
*/ */

View File

@@ -235,7 +235,7 @@ public class DailyFileAppender extends FileAppender
/** /**
* This function is responsible for performing the actual file rollover. * This function is responsible for performing the actual file rollover.
* @param pstrName The name of the new folder based on current system date. * @param pstrName The name of the new folder based on current system date.
* @throws IOException * @throws IOException if IO error
*/ */
private static boolean deletingFiles = false; private static boolean deletingFiles = false;
private void cleanupOldFiles() private void cleanupOldFiles()

View File

@@ -31,10 +31,8 @@ import java.io.File;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set;
import org.dspace.core.Constants; import org.dspace.core.Constants;
import org.dspace.core.Context; import org.dspace.core.Context;
@@ -330,7 +328,7 @@ public class GoogleMetadata
* *
* @param configFilter * @param configFilter
* @param returnType * @param returnType
* @return Array of configuration -> item-field matches * @return Array of configuration to item-field matches
*/ */
protected ArrayList<MetadataValue> resolveMetadata(String configFilter, protected ArrayList<MetadataValue> resolveMetadata(String configFilter,
int returnType) int returnType)
@@ -658,7 +656,7 @@ public class GoogleMetadata
/** /**
* Using metadata field mappings contained in the loaded configuration, * Using metadata field mappings contained in the loaded configuration,
* parse through configured metadata fields, building valid Google metadata * parse through configured metadata fields, building valid Google metadata
* value strings. Field names & values contained in metadataMappings. * value strings. Field names and values contained in metadataMappings.
* *
*/ */
protected void parseItem() protected void parseItem()
@@ -769,8 +767,8 @@ public class GoogleMetadata
* Fetch retaining the order of the values for any given key in which they * Fetch retaining the order of the values for any given key in which they
* where added (like authors). * where added (like authors).
* *
* Usage: GoogleMetadata gmd = new GoogleMetadata(item); for(Entry<String, * Usage: {@code GoogleMetadata gmd = new GoogleMetadata(item); for(Entry<String,
* String> mapping : googlemd.getMappings()) { ... } * String> mapping : googlemd.getMappings()) ...}
* *
* @return Iterable of metadata fields mapped to Google-formatted values * @return Iterable of metadata fields mapped to Google-formatted values
*/ */
@@ -1047,7 +1045,7 @@ public class GoogleMetadata
* Additionally, this bitstream must be publicly viewable. * Additionally, this bitstream must be publicly viewable.
* @param item * @param item
* @return * @return
* @throws SQLException * @throws SQLException if database error
*/ */
protected Bitstream findLinkableFulltext(Item item) throws SQLException { protected Bitstream findLinkableFulltext(Item item) throws SQLException {
Bitstream bestSoFar = null; Bitstream bestSoFar = null;
@@ -1089,9 +1087,9 @@ public class GoogleMetadata
/** /**
* *
* *
* @param FIELD * @param field
* to aggregate all values of in a matching option * to aggregate all values of in a matching option
* @param delim * @param delimiter
* to delimit field values with * to delimit field values with
*/ */
protected void addAggregateValues(String field, String delimiter) protected void addAggregateValues(String field, String delimiter)

View File

@@ -21,10 +21,10 @@ import org.apache.lucene.util.Version;
* so that they can be upgraded to the latest version. * so that they can be upgraded to the latest version.
* <p> * <p>
* You must pass it the full path of the index directory, e.g. * You must pass it the full path of the index directory, e.g.
* [dspace]/solr/statistics/data/index/ * {@code [dspace]/solr/statistics/data/index/}
* <p> * <p>
* The response is simply a version number (e.g. 4.4), as this is utilized by * The response is simply a version number (e.g. 4.4), as this is utilized by
* the "ant update_solr_indexes" target in [src]/dspace/src/main/config/build.xml * the {@code ant update_solr_indexes} target in {@code [src]/dspace/src/main/config/build.xml}
* *
* @author tdonohue * @author tdonohue
*/ */
@@ -106,7 +106,7 @@ public class IndexVersion
* Full path of the Solr/Lucene index directory * Full path of the Solr/Lucene index directory
* @return version as a string (e.g. "4.4"), empty string ("") if index directory is empty, * @return version as a string (e.g. "4.4"), empty string ("") if index directory is empty,
* or null if directory doesn't exist. * or null if directory doesn't exist.
* @throws IOException * @throws IOException if IO error
*/ */
public static String getIndexVersion(String indexDirPath) public static String getIndexVersion(String indexDirPath)
throws IOException throws IOException
@@ -218,14 +218,14 @@ public class IndexVersion
* <P> * <P>
* NOTE: In case it is not obvious, software version numbering does NOT * NOTE: In case it is not obvious, software version numbering does NOT
* behave like normal decimal numbers. For example, in software versions * behave like normal decimal numbers. For example, in software versions
* the following statement is TRUE: 4.1 < 4.4 < 4.5 < 4.10 < 4.21 < 4.51 * the following statement is TRUE: {@code 4.1 < 4.4 < 4.5 < 4.10 < 4.21 < 4.51}
* *
* @param firstVersion * @param firstVersion
* First version to compare, as a String * First version to compare, as a String
* @param secondVersion * @param secondVersion
* Second version to compare as a String * Second version to compare as a String
* @return -1 if first < second, 1 if first > second, 0 if equal * @return -1 if first less than second, 1 if first greater than second, 0 if equal
* @throws IOException * @throws IOException if IO error
*/ */
public static int compareSoftwareVersions(String firstVersion, String secondVersion) public static int compareSoftwareVersions(String firstVersion, String secondVersion)
throws IOException throws IOException

View File

@@ -283,7 +283,7 @@ public class OpenSearchServiceImpl implements OpenSearchService, InitializingBea
* Converts a JDOM document to a W3C one * Converts a JDOM document to a W3C one
* @param jdomDoc * @param jdomDoc
* @return W3C Document object * @return W3C Document object
* @throws IOException * @throws IOException if IO error
*/ */
protected Document jDomToW3(org.jdom.Document jdomDoc) throws IOException protected Document jDomToW3(org.jdom.Document jdomDoc) throws IOException
{ {

View File

@@ -206,7 +206,7 @@ public class SubmissionConfigReader
/** /**
* Returns a particular global step definition based on its ID. * Returns a particular global step definition based on its ID.
* <P> * <P>
* Global step definitions are those defined in the <step-definitions> * Global step definitions are those defined in the {@code <step-definitions>}
* section of the configuration file. * section of the configuration file.
* *
* @param stepID * @param stepID

View File

@@ -213,7 +213,7 @@ public class SubmissionInfo extends HashMap
/** /**
* Returns a particular global step definition based on its ID. * Returns a particular global step definition based on its ID.
* <P> * <P>
* Global step definitions are those defined in the <step-definitions> * Global step definitions are those defined in the {@code <step-definitions>}
* section of the configuration file. * section of the configuration file.
* *
* @param stepID * @param stepID

View File

@@ -100,8 +100,8 @@ public class SubmissionStepConfig implements Serializable
/** /**
* Get the ID for this step. An ID is only defined if the step exists in the * Get the ID for this step. An ID is only defined if the step exists in the
* <step-definitions> section. This ID field is used to reference special * {@code <step-definitions>} section. This ID field is used to reference special
* steps (like the required step with id="collection") * steps (like the required step with {@code id="collection"})
* *
* @return the step ID * @return the step ID
*/ */

View File

@@ -523,17 +523,17 @@ public class SyndicationFeed
logo.getID()+"/"+(name == null?"":name); logo.getID()+"/"+(name == null?"":name);
} }
protected String baseURL = null; // cache the result for null
/** /**
* Return a url to the DSpace object, either use the official * Return a url to the DSpace object, either use the official
* handle for the item or build a url based upon the current server. * handle for the item or build a url based upon the current server.
* *
* If the dspaceobject is null then a local url to the repository is generated. * If the dspaceobject is null then a local url to the repository is generated.
* *
* @param request current servlet request
* @param dso The object to reference, null if to the repository. * @param dso The object to reference, null if to the repository.
* @return * @return
*/ */
protected String baseURL = null; // cache the result for null
protected String resolveURL(HttpServletRequest request, DSpaceObject dso) protected String resolveURL(HttpServletRequest request, DSpaceObject dso)
{ {
// If no object given then just link to the whole repository, // If no object given then just link to the whole repository,

View File

@@ -25,9 +25,9 @@ public class XMLUtils
{ {
/** /**
* *
* @param rootElement * @param dataRoot
* the starting node * the starting node
* @param subElementName * @param name
* the name of the subelement to find * the name of the subelement to find
* @return the list of all DOM Element with the provided name direct child * @return the list of all DOM Element with the provided name direct child
* of the starting node * of the starting node

View File

@@ -13,7 +13,7 @@ import org.dspace.core.GenericDAO;
/** /**
* Database Access Object interface class for the WebApp object. * Database Access Object interface class for the WebApp object.
* The implementation of this class is responsible for all database calls for the WebApp object and is autowired by spring * The implementation of this class is responsible for all database calls for the WebApp object and is autowired by spring
* This class should only be accessed from a single service & should never be exposed outside of the API * This class should only be accessed from a single service and should never be exposed outside of the API
* *
* @author kevinvandevelde at atmire.com * @author kevinvandevelde at atmire.com
*/ */

View File

@@ -58,7 +58,7 @@ public interface MetadataExposureService {
* @param qualifier metadata field qualifier * @param qualifier metadata field qualifier
* *
* @return true (hidden) or false (exposed) * @return true (hidden) or false (exposed)
* @throws java.sql.SQLException * @throws SQLException if database error
*/ */
public boolean isHidden(Context context, String schema, String element, String qualifier) public boolean isHidden(Context context, String schema, String element, String qualifier)
throws SQLException; throws SQLException;

View File

@@ -55,7 +55,7 @@ public interface OpenSearchService {
* *
* @param scope - null for entire repository, or handle or community or collection * @param scope - null for entire repository, or handle or community or collection
* @return document the service document * @return document the service document
* @throws java.io.IOException * @throws IOException if IO error
*/ */
public Document getDescriptionDoc(String scope) throws IOException; public Document getDescriptionDoc(String scope) throws IOException;
@@ -71,6 +71,7 @@ public interface OpenSearchService {
/** /**
* Returns a formatted set of search results as a string * Returns a formatted set of search results as a string
* *
* @param context DSpace Context
* @param format results format - html, rss or atom * @param format results format - html, rss or atom
* @param query - the search query * @param query - the search query
* @param totalResults - the hit count * @param totalResults - the hit count
@@ -80,7 +81,7 @@ public interface OpenSearchService {
* @param results the retreived DSpace objects satisfying search * @param results the retreived DSpace objects satisfying search
* @param labels labels to apply - format specific * @param labels labels to apply - format specific
* @return formatted search results * @return formatted search results
* @throws java.io.IOException * @throws IOException if IO error
*/ */
public String getResultsString(Context context, String format, String query, int totalResults, int start, int pageSize, public String getResultsString(Context context, String format, String query, int totalResults, int start, int pageSize,
DSpaceObject scope, DSpaceObject[] results, DSpaceObject scope, DSpaceObject[] results,
@@ -88,6 +89,7 @@ public interface OpenSearchService {
/** /**
* Returns a formatted set of search results as a document * Returns a formatted set of search results as a document
* *
* @param context DSpace Context
* @param format results format - html, rss or atom * @param format results format - html, rss or atom
* @param query - the search query * @param query - the search query
* @param totalResults - the hit count * @param totalResults - the hit count
@@ -97,7 +99,7 @@ public interface OpenSearchService {
* @param results the retreived DSpace objects satisfying search * @param results the retreived DSpace objects satisfying search
* @param labels labels to apply - format specific * @param labels labels to apply - format specific
* @return formatted search results * @return formatted search results
* @throws IOException * @throws IOException if IO error
*/ */
public Document getResultsDoc(Context context, String format, String query, int totalResults, int start, int pageSize, public Document getResultsDoc(Context context, String format, String query, int totalResults, int start, int pageSize,
DSpaceObject scope, DSpaceObject[] results, Map<String, String> labels) DSpaceObject scope, DSpaceObject[] results, Map<String, String> labels)

View File

@@ -266,7 +266,7 @@ public class ShibAuthentication implements AuthenticationMethod
* *
* The values extracted (a user may have multiple roles) will be used to look * The values extracted (a user may have multiple roles) will be used to look
* up which groups to place the user into. The groups are defined as * up which groups to place the user into. The groups are defined as
* "authentication.shib.role.<role-name>" which is a comma separated list of * {@code authentication.shib.role.<role-name>} which is a comma separated list of
* DSpace groups. * DSpace groups.
* *
* @param context * @param context

View File

@@ -107,7 +107,7 @@ public class AuthoritySolrServiceImpl implements AuthorityIndexingService, Autho
/** /**
* Write the document to the solr index * Write the document to the solr index
* @param doc the solr document * @param doc the solr document
* @throws java.io.IOException * @throws IOException if IO error
*/ */
protected void writeDocument(SolrInputDocument doc) throws IOException { protected void writeDocument(SolrInputDocument doc) throws IOException {

View File

@@ -26,15 +26,14 @@ import java.util.*;
/** /**
* DSpaceAuthorityIndexer is used in IndexClient, which is called by the AuthorityConsumer and the indexing-script. * DSpaceAuthorityIndexer is used in IndexClient, which is called by the AuthorityConsumer and the indexing-script.
* <p/> * <p>
* An instance of DSpaceAuthorityIndexer is bound to a list of items. * An instance of DSpaceAuthorityIndexer is bound to a list of items.
* This can be one item or all items too depending on the init() method. * This can be one item or all items too depending on the init() method.
* <p/> * <p>
* DSpaceAuthorityIndexer lets you iterate over each metadata value * DSpaceAuthorityIndexer lets you iterate over each metadata value
* for each metadata field defined in dspace.cfg with 'authority.author.indexer.field' * for each metadata field defined in dspace.cfg with 'authority.author.indexer.field'
* for each item in the list. * for each item in the list.
* <p/> * <p>
* <p/>
* *
* @author Antoine Snyers (antoine at atmire.com) * @author Antoine Snyers (antoine at atmire.com)
* @author Kevin Van de Velde (kevin at atmire dot com) * @author Kevin Van de Velde (kevin at atmire dot com)

View File

@@ -26,12 +26,6 @@ public abstract class RestSource {
this.restConnector = new RESTConnector(url); this.restConnector = new RESTConnector(url);
} }
/**
* TODO
* com.atmire.org.dspace.authority.rest.RestSource#queryAuthorities -> add field, so the source can decide whether to query /users or something else.
* -> implement subclasses
* -> implement usages
*/
public abstract List<AuthorityValue> queryAuthorities(String text, int max); public abstract List<AuthorityValue> queryAuthorities(String text, int max);
public abstract AuthorityValue queryAuthorityID(String id); public abstract AuthorityValue queryAuthorityID(String id);

View File

@@ -228,7 +228,7 @@ public class AuthorizeServiceImpl implements AuthorizeService
* object can be used * object can be used
* @return <code>true</code> if user is authorized to perform the given * @return <code>true</code> if user is authorized to perform the given
* action, <code>false</code> otherwise * action, <code>false</code> otherwise
* @throws SQLException * @throws SQLException if database error
*/ */
protected boolean authorize(Context c, DSpaceObject o, int action, EPerson e, boolean useInheritance) throws SQLException protected boolean authorize(Context c, DSpaceObject o, int action, EPerson e, boolean useInheritance) throws SQLException
{ {
@@ -623,8 +623,8 @@ public class AuthorizeServiceImpl implements AuthorizeService
* @param reason * @param reason
* @param dso * @param dso
* @param owningCollection * @param owningCollection
* @throws SQLException * @throws SQLException if database error
* @throws AuthorizeException * @throws AuthorizeException if authorization error
*/ */
@Override @Override
public void generateAutomaticPolicies(Context context, Date embargoDate, public void generateAutomaticPolicies(Context context, Date embargoDate,

View File

@@ -111,9 +111,9 @@ public class PolicySet
* @param clearOnly * @param clearOnly
* if <code>true</code>, just delete policies for matching * if <code>true</code>, just delete policies for matching
* objects * objects
* @throws SQLException * @throws SQLException if database error
* if database problem * if database problem
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if current user is not authorized to change these policies * if current user is not authorized to change these policies
*/ */
public static void setPolicies(Context c, int containerType, public static void setPolicies(Context c, int containerType,
@@ -139,8 +139,8 @@ public class PolicySet
* @param description * @param description
* @param startDate * @param startDate
* @param endDate * @param endDate
* @throws SQLException * @throws SQLException if database error
* @throws AuthorizeException * @throws AuthorizeException if authorization error
*/ */
public static void setPolicies(Context c, int containerType, public static void setPolicies(Context c, int containerType,
UUID containerID, int contentType, int actionID, UUID groupID, UUID containerID, int contentType, int actionID, UUID groupID,
@@ -175,9 +175,9 @@ public class PolicySet
* objects * objects
* @param filter * @param filter
* if non-null, only process bitstreams whose names contain filter * if non-null, only process bitstreams whose names contain filter
* @throws SQLException * @throws SQLException if database error
* if database problem * if database problem
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if current user is not authorized to change these policies * if current user is not authorized to change these policies
*/ */
public static void setPoliciesFilter(Context c, int containerType, public static void setPoliciesFilter(Context c, int containerType,
@@ -215,9 +215,9 @@ public class PolicySet
* @param description * @param description
* @param startDate * @param startDate
* @param endDate * @param endDate
* @throws SQLException * @throws SQLException if database error
* if database problem * if database problem
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if current user is not authorized to change these policies * if current user is not authorized to change these policies
*/ */
public static void setPoliciesFilter(Context c, int containerType, public static void setPoliciesFilter(Context c, int containerType,

View File

@@ -20,7 +20,7 @@ import java.util.List;
/** /**
* Database Access Object interface class for the ResourcePolicy object. * Database Access Object interface class for the ResourcePolicy object.
* The implementation of this class is responsible for all database calls for the ResourcePolicy object and is autowired by spring * The implementation of this class is responsible for all database calls for the ResourcePolicy object and is autowired by spring
* This class should only be accessed from a single service & should never be exposed outside of the API * This class should only be accessed from a single service and should never be exposed outside of the API
* *
* @author kevinvandevelde at atmire.com * @author kevinvandevelde at atmire.com
*/ */

View File

@@ -48,7 +48,7 @@ public interface AuthorizeService {
* @param actions * @param actions
* array of action IDs from * array of action IDs from
* <code>org.dspace.core.Constants</code> * <code>org.dspace.core.Constants</code>
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if any one of the specified actions cannot be performed by * if any one of the specified actions cannot be performed by
* the current user on the given object. * the current user on the given object.
*/ */
@@ -65,7 +65,7 @@ public interface AuthorizeService {
* a DSpaceObject * a DSpaceObject
* @param action * @param action
* action to perform from <code>org.dspace.core.Constants</code> * action to perform from <code>org.dspace.core.Constants</code>
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the user is denied * if the user is denied
*/ */
public void authorizeAction(Context c, DSpaceObject o, int action) throws AuthorizeException, SQLException; public void authorizeAction(Context c, DSpaceObject o, int action) throws AuthorizeException, SQLException;
@@ -84,7 +84,7 @@ public interface AuthorizeService {
* object can be used * object can be used
* @param action * @param action
* action to perform from <code>org.dspace.core.Constants</code> * action to perform from <code>org.dspace.core.Constants</code>
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the user is denied * if the user is denied
*/ */
public void authorizeAction(Context c, DSpaceObject o, int action, boolean useInheritance) public void authorizeAction(Context c, DSpaceObject o, int action, boolean useInheritance)
@@ -106,7 +106,7 @@ public interface AuthorizeService {
* object can be used * object can be used
* @param action * @param action
* action to perform from <code>org.dspace.core.Constants</code> * action to perform from <code>org.dspace.core.Constants</code>
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the user is denied * if the user is denied
*/ */
public void authorizeAction(Context c, EPerson e, DSpaceObject o, int action, boolean useInheritance) public void authorizeAction(Context c, EPerson e, DSpaceObject o, int action, boolean useInheritance)
@@ -216,7 +216,7 @@ public interface AuthorizeService {
* ID of action from <code>org.dspace.core.Constants</code> * ID of action from <code>org.dspace.core.Constants</code>
* @param e * @param e
* eperson who can perform the action * eperson who can perform the action
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if current user in context is not authorized to add policies * if current user in context is not authorized to add policies
*/ */
public void addPolicy(Context c, DSpaceObject o, int actionID, EPerson e) throws SQLException, AuthorizeException; public void addPolicy(Context c, DSpaceObject o, int actionID, EPerson e) throws SQLException, AuthorizeException;
@@ -235,7 +235,7 @@ public interface AuthorizeService {
* eperson who can perform the action * eperson who can perform the action
* @param type * @param type
* policy type, deafult types are declared in the ResourcePolicy class * policy type, deafult types are declared in the ResourcePolicy class
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if current user in context is not authorized to add policies * if current user in context is not authorized to add policies
*/ */
public void addPolicy(Context c, DSpaceObject o, int actionID, EPerson e, String type) throws SQLException, AuthorizeException; public void addPolicy(Context c, DSpaceObject o, int actionID, EPerson e, String type) throws SQLException, AuthorizeException;
@@ -251,9 +251,9 @@ public interface AuthorizeService {
* ID of action from <code>org.dspace.core.Constants</code> * ID of action from <code>org.dspace.core.Constants</code>
* @param g * @param g
* group to add policy for * group to add policy for
* @throws SQLException * @throws SQLException if database error
* if there's a database problem * if there's a database problem
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not authorized to add this policy * if the current user is not authorized to add this policy
*/ */
public void addPolicy(Context c, DSpaceObject o, int actionID, Group g) throws SQLException, AuthorizeException; public void addPolicy(Context c, DSpaceObject o, int actionID, Group g) throws SQLException, AuthorizeException;
@@ -271,9 +271,9 @@ public interface AuthorizeService {
* group to add policy for * group to add policy for
* @param type * @param type
* policy type, deafult types are declared in the ResourcePolicy class * policy type, deafult types are declared in the ResourcePolicy class
* @throws SQLException * @throws SQLException if database error
* if there's a database problem * if there's a database problem
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not authorized to add this policy * if the current user is not authorized to add this policy
*/ */
public void addPolicy(Context c, DSpaceObject o, int actionID, Group g, String type) throws SQLException, AuthorizeException; public void addPolicy(Context c, DSpaceObject o, int actionID, Group g, String type) throws SQLException, AuthorizeException;
@@ -320,7 +320,7 @@ public interface AuthorizeService {
* DSpaceObject policies relate to * DSpaceObject policies relate to
* @param actionID * @param actionID
* action (defined in class Constants) * action (defined in class Constants)
* @throws SQLException * @throws SQLException if database error
* if there's a database problem * if there's a database problem
*/ */
public List<ResourcePolicy> getPoliciesActionFilter(Context c, DSpaceObject o, int actionID) throws SQLException; public List<ResourcePolicy> getPoliciesActionFilter(Context c, DSpaceObject o, int actionID) throws SQLException;
@@ -334,9 +334,9 @@ public interface AuthorizeService {
* source of policies * source of policies
* @param dest * @param dest
* destination of inherited policies * destination of inherited policies
* @throws SQLException * @throws SQLException if database error
* if there's a database problem * if there's a database problem
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not authorized to add these policies * if the current user is not authorized to add these policies
*/ */
public void inheritPolicies(Context c, DSpaceObject src, DSpaceObject dest) throws SQLException, AuthorizeException; public void inheritPolicies(Context c, DSpaceObject src, DSpaceObject dest) throws SQLException, AuthorizeException;
@@ -350,9 +350,9 @@ public interface AuthorizeService {
* List of ResourcePolicy objects * List of ResourcePolicy objects
* @param dest * @param dest
* object to have policies added * object to have policies added
* @throws SQLException * @throws SQLException if database error
* if there's a database problem * if there's a database problem
* @throws AuthorizeException * @throws AuthorizeException if authorization error
* if the current user is not authorized to add these policies * if the current user is not authorized to add these policies
*/ */
public void addPolicies(Context c, List<ResourcePolicy> policies, DSpaceObject dest) throws SQLException, AuthorizeException; public void addPolicies(Context c, List<ResourcePolicy> policies, DSpaceObject dest) throws SQLException, AuthorizeException;
@@ -364,7 +364,7 @@ public interface AuthorizeService {
* DSpace context * DSpace context
* @param o * @param o
* object to remove policies for * object to remove policies for
* @throws SQLException * @throws SQLException if database error
* if there's a database problem * if there's a database problem
*/ */
public void removeAllPolicies(Context c, DSpaceObject o) throws SQLException, AuthorizeException; public void removeAllPolicies(Context c, DSpaceObject o) throws SQLException, AuthorizeException;
@@ -378,7 +378,7 @@ public interface AuthorizeService {
* DSpace context * DSpace context
* @param o * @param o
* object to remove policies for * object to remove policies for
* @throws SQLException * @throws SQLException if database error
* if there's a database problem * if there's a database problem
*/ */
public void removeAllPoliciesByDSOAndTypeNotEqualsTo(Context c, DSpaceObject o, String type) throws SQLException, AuthorizeException; public void removeAllPoliciesByDSOAndTypeNotEqualsTo(Context c, DSpaceObject o, String type) throws SQLException, AuthorizeException;
@@ -392,7 +392,7 @@ public interface AuthorizeService {
* object to remove policies for * object to remove policies for
* @param type * @param type
* policy type * policy type
* @throws SQLException * @throws SQLException if database error
* if there's a database problem * if there's a database problem
*/ */
public void removeAllPoliciesByDSOAndType(Context c, DSpaceObject o, String type) throws SQLException, AuthorizeException; public void removeAllPoliciesByDSOAndType(Context c, DSpaceObject o, String type) throws SQLException, AuthorizeException;
@@ -408,7 +408,7 @@ public interface AuthorizeService {
* @param actionID * @param actionID
* ID of action to match from * ID of action to match from
* <code>org.dspace.core.Constants</code>, or -1=all * <code>org.dspace.core.Constants</code>, or -1=all
* @throws SQLException * @throws SQLException if database error
* if there's a database problem * if there's a database problem
*/ */
public void removePoliciesActionFilter(Context context, DSpaceObject dso, int actionID) throws SQLException, AuthorizeException; public void removePoliciesActionFilter(Context context, DSpaceObject dso, int actionID) throws SQLException, AuthorizeException;
@@ -421,7 +421,7 @@ public interface AuthorizeService {
* current context * current context
* @param group * @param group
* the group * the group
* @throws SQLException * @throws SQLException if database error
* if there's a database problem * if there's a database problem
*/ */
public void removeGroupPolicies(Context c, Group group) throws SQLException; public void removeGroupPolicies(Context c, Group group) throws SQLException;
@@ -436,7 +436,7 @@ public interface AuthorizeService {
* the object * the object
* @param g * @param g
* the group * the group
* @throws SQLException * @throws SQLException if database error
* if there's a database problem * if there's a database problem
*/ */
public void removeGroupPolicies(Context c, DSpaceObject o, Group g) throws SQLException, AuthorizeException; public void removeGroupPolicies(Context c, DSpaceObject o, Group g) throws SQLException, AuthorizeException;
@@ -451,7 +451,7 @@ public interface AuthorizeService {
* the object * the object
* @param e * @param e
* the eperson * the eperson
* @throws java.sql.SQLException * @throws SQLException if database error
* if there's a database problem * if there's a database problem
*/ */
public void removeEPersonPolicies(Context c, DSpaceObject o, EPerson e) throws SQLException, AuthorizeException; public void removeEPersonPolicies(Context c, DSpaceObject o, EPerson e) throws SQLException, AuthorizeException;
@@ -468,7 +468,7 @@ public interface AuthorizeService {
* ID of action from <code>org.dspace.core.Constants</code> * ID of action from <code>org.dspace.core.Constants</code>
* @return array of <code>Group</code>s that can perform the specified * @return array of <code>Group</code>s that can perform the specified
* action on the specified object * action on the specified object
* @throws java.sql.SQLException * @throws SQLException if database error
* if there's a database problem * if there's a database problem
*/ */
public List<Group> getAuthorizedGroups(Context c, DSpaceObject o, int actionID) throws java.sql.SQLException; public List<Group> getAuthorizedGroups(Context c, DSpaceObject o, int actionID) throws java.sql.SQLException;
@@ -488,7 +488,7 @@ public interface AuthorizeService {
* @param policyID * @param policyID
* ID of an existing policy. If -1 is specified, this parameter will be ignored * ID of an existing policy. If -1 is specified, this parameter will be ignored
* @return true if such a policy exists, false otherwise * @return true if such a policy exists, false otherwise
* @throws java.sql.SQLException * @throws SQLException if database error
* if there's a database problem * if there's a database problem
*/ */
public boolean isAnIdenticalPolicyAlreadyInPlace(Context c, DSpaceObject o, Group group, int actionID, int policyID) throws SQLException; public boolean isAnIdenticalPolicyAlreadyInPlace(Context c, DSpaceObject o, Group group, int actionID, int policyID) throws SQLException;
@@ -505,8 +505,8 @@ public interface AuthorizeService {
* @param reason * @param reason
* @param dso * @param dso
* @param owningCollection * @param owningCollection
* @throws SQLException * @throws SQLException if database error
* @throws AuthorizeException * @throws AuthorizeException if authorization error
*/ */
public void generateAutomaticPolicies(Context context, Date embargoDate, String reason, DSpaceObject dso, Collection owningCollection) throws SQLException, AuthorizeException; public void generateAutomaticPolicies(Context context, Date embargoDate, String reason, DSpaceObject dso, Collection owningCollection) throws SQLException, AuthorizeException;

View File

@@ -44,7 +44,7 @@ public interface BrowseDAO
* parameters you set. * parameters you set.
* *
* @return the integer value of the number of results found * @return the integer value of the number of results found
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public int doCountQuery() throws BrowseException; public int doCountQuery() throws BrowseException;
@@ -55,7 +55,7 @@ public interface BrowseDAO
* commonly used with a Distinct browse type. * commonly used with a Distinct browse type.
* *
* @return List of Strings representing the single value query results * @return List of Strings representing the single value query results
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public List<String[]> doValueQuery() throws BrowseException; public List<String[]> doValueQuery() throws BrowseException;
@@ -64,7 +64,7 @@ public interface BrowseDAO
* representing the results of a full item browse. * representing the results of a full item browse.
* *
* @return List of BrowseItem objects * @return List of BrowseItem objects
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public List<Item> doQuery() throws BrowseException; public List<Item> doQuery() throws BrowseException;
@@ -76,7 +76,7 @@ public interface BrowseDAO
* @param table the table to query * @param table the table to query
* @param itemID the item id * @param itemID the item id
* @return String representing the max value in the given column * @return String representing the max value in the given column
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public String doMaxQuery(String column, String table, int itemID) throws BrowseException; public String doMaxQuery(String column, String table, int itemID) throws BrowseException;
@@ -88,7 +88,7 @@ public interface BrowseDAO
* @param value the item id * @param value the item id
* @param isAscending browsing in ascending or descending order * @param isAscending browsing in ascending or descending order
* @return the offset into the table * @return the offset into the table
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public int doOffsetQuery(String column, String value, boolean isAscending) throws BrowseException; public int doOffsetQuery(String column, String value, boolean isAscending) throws BrowseException;
@@ -100,7 +100,7 @@ public interface BrowseDAO
* @param value the item id * @param value the item id
* @param isAscending browsing in ascending or descending order * @param isAscending browsing in ascending or descending order
* @return the offset into the table * @return the offset into the table
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public int doDistinctOffsetQuery(String column, String value, boolean isAscending) throws BrowseException; public int doDistinctOffsetQuery(String column, String value, boolean isAscending) throws BrowseException;
@@ -117,8 +117,8 @@ public interface BrowseDAO
/** /**
* Set whether the query should use an equals comparator when doing less than or * Set whether the query should use an equals comparator when doing less than or
* greater than comparisons. That is, if true then comparisons will be made * greater than comparisons. That is, if true then comparisons will be made
* using the equivalent of "<=" and ">=", while if false it will use the * using the equivalent of {@code <=} and {@code >=}, while if false it will use the
* equivalent of "<" and ">" * equivalent of {@code <} and {@code >}
* *
* @param equalsComparator true to use, false to not. * @param equalsComparator true to use, false to not.
*/ */
@@ -189,7 +189,7 @@ public interface BrowseDAO
* the browse. This will either be the "sort_value" field or one of the * the browse. This will either be the "sort_value" field or one of the
* additional sort fields defined by configuration * additional sort fields defined by configuration
* *
* param focusField the name of the focus field * @param focusField the name of the focus field
*/ */
public void setJumpToField(String focusField); public void setJumpToField(String focusField);

View File

@@ -24,7 +24,7 @@ public class BrowseDAOFactory
* *
* @param context the DSpace context * @param context the DSpace context
* @return the relevant DAO * @return the relevant DAO
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public static BrowseDAO getInstance(Context context) public static BrowseDAO getInstance(Context context)
throws BrowseException throws BrowseException

View File

@@ -53,7 +53,7 @@ public class BrowseEngine
* for the Browse Engine, based on the brand of the provided DBMS. * for the Browse Engine, based on the brand of the provided DBMS.
* *
* @param context the DSpace context * @param context the DSpace context
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public BrowseEngine(Context context) public BrowseEngine(Context context)
throws BrowseException throws BrowseException
@@ -73,7 +73,7 @@ public class BrowseEngine
* *
* @param bs the scope of the browse * @param bs the scope of the browse
* @return the results of the browse * @return the results of the browse
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public BrowseInfo browse(BrowserScope bs) public BrowseInfo browse(BrowserScope bs)
throws BrowseException throws BrowseException
@@ -111,6 +111,7 @@ public class BrowseEngine
* *
* @param bs the scope of the browse * @param bs the scope of the browse
* @return the results of the browse * @return the results of the browse
* @throws BrowseException if browse error
*/ */
public BrowseInfo browseMini(BrowserScope bs) public BrowseInfo browseMini(BrowserScope bs)
throws BrowseException throws BrowseException
@@ -196,7 +197,7 @@ public class BrowseEngine
* *
* @param bs the scope of the browse * @param bs the scope of the browse
* @return the results of the browse * @return the results of the browse
* @throws BrowseException * @throws BrowseException if browse error
*/ */
private BrowseInfo browseByItem(BrowserScope bs) private BrowseInfo browseByItem(BrowserScope bs)
throws BrowseException throws BrowseException
@@ -395,7 +396,7 @@ public class BrowseEngine
* *
* @param bs the scope of the browse * @param bs the scope of the browse
* @return the results of the browse * @return the results of the browse
* @throws BrowseException * @throws BrowseException if browse error
*/ */
private BrowseInfo browseByValue(BrowserScope bs) private BrowseInfo browseByValue(BrowserScope bs)
throws BrowseException throws BrowseException
@@ -562,7 +563,7 @@ public class BrowseEngine
* Return the focus value. * Return the focus value.
* *
* @return the focus value to use * @return the focus value to use
* @throws BrowseException * @throws BrowseException if browse error
*/ */
private String getJumpToValue() private String getJumpToValue()
throws BrowseException throws BrowseException
@@ -627,8 +628,9 @@ public class BrowseEngine
/** /**
* Convert the value into an offset into the table for this browse * Convert the value into an offset into the table for this browse
* *
* @param value value
* @return the focus value to use * @return the focus value to use
* @throws BrowseException * @throws BrowseException if browse error
*/ */
private int getOffsetForValue(String value) private int getOffsetForValue(String value)
throws BrowseException throws BrowseException
@@ -662,8 +664,9 @@ public class BrowseEngine
/** /**
* Convert the value into an offset into the table for this browse * Convert the value into an offset into the table for this browse
* *
* @param value value
* @return the focus value to use * @return the focus value to use
* @throws BrowseException * @throws BrowseException if browse error
*/ */
private int getOffsetForDistinctValue(String value) private int getOffsetForDistinctValue(String value)
throws BrowseException throws BrowseException
@@ -685,7 +688,7 @@ public class BrowseEngine
* *
* @param value a focus value to normalize * @param value a focus value to normalize
* @return the normalized focus value * @return the normalized focus value
* @throws BrowseException * @throws BrowseException if browse error
*/ */
private String normalizeJumpToValue(String value) private String normalizeJumpToValue(String value)
throws BrowseException throws BrowseException
@@ -712,9 +715,9 @@ public class BrowseEngine
* Get the total number of results for the browse. This is the same as * Get the total number of results for the browse. This is the same as
* calling getTotalResults(false) * calling getTotalResults(false)
* *
* @return * @return total
* @throws SQLException * @throws SQLException if database error
* @throws BrowseException * @throws BrowseException if browse error
*/ */
private int getTotalResults() private int getTotalResults()
throws SQLException, BrowseException throws SQLException, BrowseException
@@ -728,8 +731,8 @@ public class BrowseEngine
* *
* @param distinct is this a distinct browse or not * @param distinct is this a distinct browse or not
* @return the total number of results available in this type of browse * @return the total number of results available in this type of browse
* @throws SQLException * @throws SQLException if database error
* @throws BrowseException * @throws BrowseException if browse error
*/ */
private int getTotalResults(boolean distinct) private int getTotalResults(boolean distinct)
throws SQLException, BrowseException throws SQLException, BrowseException

View File

@@ -12,7 +12,6 @@ import java.util.ArrayList;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils;
import org.dspace.core.ConfigurationManager; import org.dspace.core.ConfigurationManager;
import org.dspace.sort.SortOption; import org.dspace.sort.SortOption;
@@ -123,7 +122,7 @@ public final class BrowseIndex
* *
* @param definition the configuration definition of this index * @param definition the configuration definition of this index
* @param number the configuration number of this index * @param number the configuration number of this index
* @throws BrowseException * @throws BrowseException if browse error
*/ */
private BrowseIndex(String definition, int number) private BrowseIndex(String definition, int number)
throws BrowseException throws BrowseException
@@ -295,6 +294,7 @@ public final class BrowseIndex
} }
/** /**
* @param idx index
* @return Returns the mdBits. * @return Returns the mdBits.
*/ */
public String[] getMdBits(int idx) public String[] getMdBits(int idx)
@@ -315,6 +315,11 @@ public final class BrowseIndex
return metadataAll; return metadataAll;
} }
/**
*
* @param idx index
* @return metadata
*/
public String getMetadata(int idx) public String getMetadata(int idx)
{ {
return metadata[idx]; return metadata[idx];
@@ -338,12 +343,17 @@ public final class BrowseIndex
/** /**
* Get the SortOption associated with this index. * Get the SortOption associated with this index.
* @return SortOption
*/ */
public SortOption getSortOption() public SortOption getSortOption()
{ {
return sortOption; return sortOption;
} }
/**
*
* @return true or false
*/
public boolean isDisplayFrequencies() { public boolean isDisplayFrequencies() {
return displayFrequencies; return displayFrequencies;
} }
@@ -445,12 +455,12 @@ public final class BrowseIndex
/** /**
* Generate a table name from the given base * Generate a table name from the given base
* @param baseName * @param baseName base name
* @param isCommunity * @param isCommunity whether this is a community constrained index (view)
* @param isCollection * @param isCollection whether this is a collection constrained index (view)
* @param isDistinct * @param isDistinct whether this is a distinct table
* @param isMap * @param isMap whether this is a distinct map table
* @return * @return table name
*/ */
private static String getTableName(String baseName, boolean isCommunity, boolean isCollection, boolean isDistinct, boolean isMap) private static String getTableName(String baseName, boolean isCommunity, boolean isCollection, boolean isDistinct, boolean isMap)
{ {
@@ -523,6 +533,8 @@ public final class BrowseIndex
* <code> * <code>
* getTableName(false, false, false, false); * getTableName(false, false, false, false);
* </code> * </code>
*
* @return table name
*/ */
public String getTableName() public String getTableName()
{ {
@@ -538,10 +550,11 @@ public final class BrowseIndex
* getTableName(isCommunity, isCollection, isDistinct, false); * getTableName(isCommunity, isCollection, isDistinct, false);
* </code> * </code>
* *
* @param isDistinct is this a distinct table * @param isCommunity whether this is a community constrained index (view)
* @param isCommunity * @param isCollection whether this is a collection constrained index (view)
* @param isCollection * @param isDistinct whether this is a distinct table
* @deprecated 1.5 * @deprecated 1.5
* @return table name
*/ */
public String getTableName(boolean isDistinct, boolean isCommunity, boolean isCollection) public String getTableName(boolean isDistinct, boolean isCommunity, boolean isCollection)
{ {
@@ -554,6 +567,7 @@ public final class BrowseIndex
* <code> * <code>
* getTableName(false, false, false, true); * getTableName(false, false, false, true);
* </code> * </code>
* @return table name
*/ */
public String getMapTableName() public String getMapTableName()
{ {
@@ -566,6 +580,7 @@ public final class BrowseIndex
* <code> * <code>
* getTableName(false, false, true, false); * getTableName(false, false, true, false);
* </code> * </code>
* @return table name
*/ */
public String getDistinctTableName() public String getDistinctTableName()
{ {
@@ -661,7 +676,9 @@ public final class BrowseIndex
/** /**
* Get the field for sorting associated with this index. * Get the field for sorting associated with this index.
* @throws BrowseException * @param isSecondLevel whether second level browse
* @return sort field
* @throws BrowseException if browse error
*/ */
public String getSortField(boolean isSecondLevel) throws BrowseException public String getSortField(boolean isSecondLevel) throws BrowseException
{ {
@@ -686,8 +703,9 @@ public final class BrowseIndex
} }
/** /**
* @return array of tables
* @deprecated * @deprecated
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public static String[] tables() public static String[] tables()
throws BrowseException throws BrowseException
@@ -706,7 +724,7 @@ public final class BrowseIndex
* Get an array of all the browse indices for the current configuration * Get an array of all the browse indices for the current configuration
* *
* @return an array of all the current browse indices * @return an array of all the current browse indices
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public static BrowseIndex[] getBrowseIndices() public static BrowseIndex[] getBrowseIndices()
throws BrowseException throws BrowseException
@@ -738,7 +756,7 @@ public final class BrowseIndex
* *
* @param name the name to retrieve * @param name the name to retrieve
* @return the specified browse index * @return the specified browse index
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public static BrowseIndex getBrowseIndex(String name) public static BrowseIndex getBrowseIndex(String name)
throws BrowseException throws BrowseException
@@ -757,8 +775,9 @@ public final class BrowseIndex
/** /**
* Get the configured browse index that is defined to use this sort option. * Get the configured browse index that is defined to use this sort option.
* *
* @param so * @param so sort option
* @throws BrowseException * @return browse index
* @throws BrowseException if browse error
*/ */
public static BrowseIndex getBrowseIndex(SortOption so) throws BrowseException public static BrowseIndex getBrowseIndex(SortOption so) throws BrowseException
{ {
@@ -775,6 +794,7 @@ public final class BrowseIndex
/** /**
* Get the internally defined browse index for archived items. * Get the internally defined browse index for archived items.
* @return browse index
*/ */
public static BrowseIndex getItemBrowseIndex() public static BrowseIndex getItemBrowseIndex()
{ {
@@ -783,13 +803,16 @@ public final class BrowseIndex
/** /**
* Get the internally defined browse index for withdrawn items. * Get the internally defined browse index for withdrawn items.
* @return browse index
*/ */
public static BrowseIndex getWithdrawnBrowseIndex() public static BrowseIndex getWithdrawnBrowseIndex()
{ {
return BrowseIndex.withdrawnIndex; return BrowseIndex.withdrawnIndex;
} }
/**
* @return browse index
*/
public static BrowseIndex getPrivateBrowseIndex() public static BrowseIndex getPrivateBrowseIndex()
{ {
return BrowseIndex.privateIndex; return BrowseIndex.privateIndex;
@@ -804,6 +827,7 @@ public final class BrowseIndex
* @param mfield the string representation of the metadata * @param mfield the string representation of the metadata
* @param init the default value of the array elements * @param init the default value of the array elements
* @return a three element array with schema, element and qualifier respectively * @return a three element array with schema, element and qualifier respectively
* @throws IOException if IO error
*/ */
public String[] interpretField(String mfield, String init) public String[] interpretField(String mfield, String init)
throws IOException throws IOException
@@ -829,6 +853,7 @@ public final class BrowseIndex
/** /**
* Does this browse index represent one of the internal item indexes? * Does this browse index represent one of the internal item indexes?
* @return true or false
*/ */
public boolean isInternalIndex() public boolean isInternalIndex()
{ {
@@ -837,13 +862,18 @@ public final class BrowseIndex
/** /**
* Generate a base table name. * Generate a base table name.
* @param number * @param number index number
* @return table name
*/ */
private static String makeTableBaseName(int number) private static String makeTableBaseName(int number)
{ {
return "bi_" + Integer.toString(number); return "bi_" + Integer.toString(number);
} }
/**
* Is tag cloud enabled
* @return true or false
*/
public boolean isTagCloudEnabled() { public boolean isTagCloudEnabled() {
return ConfigurationManager.getBooleanProperty("webui.browse.index.tagcloud." + number); return ConfigurationManager.getBooleanProperty("webui.browse.index.tagcloud." + number);

View File

@@ -256,7 +256,7 @@ public class BrowseInfo
* exception * exception
* *
* @param dso the container object; a Community or Collection * @param dso the container object; a Community or Collection
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public void setBrowseContainer(DSpaceObject dso) public void setBrowseContainer(DSpaceObject dso)
throws BrowseException throws BrowseException
@@ -836,7 +836,7 @@ public class BrowseInfo
* *
* @param config * @param config
* @return * @return
* @throws SQLException * @throws SQLException if database error
*/ */
private String fullListingString(ItemListConfig config) private String fullListingString(ItemListConfig config)
throws SQLException throws SQLException

View File

@@ -160,8 +160,8 @@ public class BrowseOutput
* Pass in some SQL. If print is set to true this will output to the * Pass in some SQL. If print is set to true this will output to the
* screen. If file is set to true, this will write to the file specified. * screen. If file is set to true, this will write to the file specified.
* *
* @param sql * @param sql SQL string
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public void sql(String sql) throws BrowseException public void sql(String sql) throws BrowseException
{ {

View File

@@ -96,7 +96,7 @@ public class BrowserScope
* exception * exception
* *
* @param dso the container object; a Community or Collection * @param dso the container object; a Community or Collection
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public void setBrowseContainer(DSpaceObject dso) public void setBrowseContainer(DSpaceObject dso)
throws BrowseException throws BrowseException
@@ -397,7 +397,7 @@ public class BrowserScope
* Obtain the sort option * Obtain the sort option
* *
* @return the sort option * @return the sort option
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public SortOption getSortOption() public SortOption getSortOption()
throws BrowseException throws BrowseException

View File

@@ -28,7 +28,7 @@ public class CrossLinks
/** /**
* Construct a new object which will obtain the configuration for itself. * Construct a new object which will obtain the configuration for itself.
* *
* @throws BrowseException * @throws BrowseException if browse error
*/ */
public CrossLinks() public CrossLinks()
throws BrowseException throws BrowseException

View File

@@ -22,8 +22,8 @@ public interface ItemCountDAO
/** /**
* Set the DSpace Context to use during data access * Set the DSpace Context to use during data access
* *
* @param context * @param context DSpace Context
* @throws ItemCountException * @throws ItemCountException if count error
*/ */
public void setContext(Context context) throws ItemCountException; public void setContext(Context context) throws ItemCountException;
@@ -32,8 +32,8 @@ public interface ItemCountDAO
* only succeed if the DSpaceObject is an instance of either a Community or a * only succeed if the DSpaceObject is an instance of either a Community or a
* Collection. Otherwise it will throw an exception. * Collection. Otherwise it will throw an exception.
* *
* @param dso * @param dso Dspace Object
* @throws ItemCountException * @throws ItemCountException if count error
*/ */
public int getCount(DSpaceObject dso) throws ItemCountException; public int getCount(DSpaceObject dso) throws ItemCountException;
} }

View File

@@ -24,8 +24,8 @@ public class ItemCountDAOFactory
* Get an instance of ItemCountDAO which supports the correct storage backend * Get an instance of ItemCountDAO which supports the correct storage backend
* for the specific DSpace instance. * for the specific DSpace instance.
* *
* @param context * @param context DSpace Context
* @throws ItemCountException * @throws ItemCountException if count error
*/ */
public static ItemCountDAO getInstance(Context context) public static ItemCountDAO getInstance(Context context)
throws ItemCountException throws ItemCountException

View File

@@ -59,8 +59,8 @@ public class ItemCountDAOSolr implements ItemCountDAO
/** /**
* Set the dspace context to use * Set the dspace context to use
* *
* @param context * @param context DSpace Context
* @throws ItemCountException * @throws ItemCountException if count error
*/ */
@Override @Override
public void setContext(Context context) throws ItemCountException public void setContext(Context context) throws ItemCountException
@@ -71,8 +71,8 @@ public class ItemCountDAOSolr implements ItemCountDAO
/** /**
* Get the count of the items in the given container. * Get the count of the items in the given container.
* *
* @param dso * @param dso Dspace Context
* @throws ItemCountException * @throws ItemCountException if count error
*/ */
@Override @Override
public int getCount(DSpaceObject dso) throws ItemCountException public int getCount(DSpaceObject dso) throws ItemCountException
@@ -106,7 +106,7 @@ public class ItemCountDAOSolr implements ItemCountDAO
* make sure that the counts are actually fetched from Solr (if haven't been * make sure that the counts are actually fetched from Solr (if haven't been
* cached in a Map yet) * cached in a Map yet)
* *
* @throws ItemCountException * @throws ItemCountException if count error
*/ */
private void loadCount() throws ItemCountException private void loadCount() throws ItemCountException
{ {

View File

@@ -51,8 +51,8 @@ public class ItemCounter
/** /**
* Construct a new item counter which will use the give DSpace Context * Construct a new item counter which will use the give DSpace Context
* *
* @param context * @param context current context
* @throws ItemCountException * @throws ItemCountException if count error
*/ */
public ItemCounter(Context context) public ItemCounter(Context context)
throws ItemCountException throws ItemCountException
@@ -70,9 +70,8 @@ public class ItemCounter
* cached value if it exists. If it is equal to 'false' it will count * cached value if it exists. If it is equal to 'false' it will count
* the number of items in the container in real time. * the number of items in the container in real time.
* *
* @param dso * @param dso DSpaceObject
* @throws ItemCountException * @throws ItemCountException when error occurs
* @throws SQLException
*/ */
public int getCount(DSpaceObject dso) public int getCount(DSpaceObject dso)
throws ItemCountException throws ItemCountException

View File

@@ -38,7 +38,7 @@ public class ItemListConfig
* Create a new instance of the Item list configuration. This loads * Create a new instance of the Item list configuration. This loads
* all the required information from configuration * all the required information from configuration
* *
* @throws BrowseException * @throws BrowseException if count error
*/ */
public ItemListConfig() public ItemListConfig()
throws BrowseException throws BrowseException
@@ -97,7 +97,7 @@ public class ItemListConfig
/** /**
* What metadata is to go in the given column number? * What metadata is to go in the given column number?
* *
* @param col * @param col column
*/ */
public String[] getMetadata(int col) public String[] getMetadata(int col)
{ {
@@ -113,6 +113,7 @@ public class ItemListConfig
* @param mfield the string representation of the metadata * @param mfield the string representation of the metadata
* @param init the default value of the array elements * @param init the default value of the array elements
* @return a three element array with schema, element and qualifier respectively * @return a three element array with schema, element and qualifier respectively
* @throws IOException if IO error
*/ */
public final String[] interpretField(String mfield, String init) public final String[] interpretField(String mfield, String init)
throws IOException throws IOException

View File

@@ -35,8 +35,8 @@ import org.dspace.storage.bitstore.service.BitstreamStorageService;
* @author Nathan Sarr * @author Nathan Sarr
* *
* *
* @todo the accessor methods are currently unused - are they useful? * TODO the accessor methods are currently unused - are they useful?
* @todo check for any existing resource problems * TODO check for any existing resource problems
*/ */
public final class CheckerCommand public final class CheckerCommand
{ {
@@ -222,7 +222,7 @@ public final class CheckerCommand
* *
* @param info * @param info
* A not found BitStreamInfo * A not found BitStreamInfo
* @todo is this method required? * TODO is this method required?
*/ */
protected void processNullInfoBitstream(MostRecentChecksum info) throws SQLException { protected void processNullInfoBitstream(MostRecentChecksum info) throws SQLException {
info.setInfoFound(false); info.setInfoFound(false);
@@ -241,7 +241,7 @@ public final class CheckerCommand
* actual checksumming never took place. * actual checksumming never took place.
* </p> * </p>
* *
* @todo Why does bitstream have a timestamp indicating it's checked if * TODO Why does bitstream have a timestamp indicating it's checked if
* checksumming doesn't occur? * checksumming doesn't occur?
* *
* @param info * @param info

View File

@@ -93,8 +93,7 @@ public class ChecksumHistoryServiceImpl implements ChecksumHistoryService {
* @param checksumResultCode * @param checksumResultCode
* result code records must have for them to be deleted. * result code records must have for them to be deleted.
* @return number of records deleted. * @return number of records deleted.
* @throws java.sql.SQLException * @throws SQLException if database error occurs.
* if database error occurs.
*/ */
@Override @Override
public int deleteByDateAndCode(Context context, Date retentionDate, ChecksumResultCode checksumResultCode) throws SQLException public int deleteByDateAndCode(Context context, Date retentionDate, ChecksumResultCode checksumResultCode) throws SQLException

View File

@@ -61,10 +61,8 @@ public class DailyReportEmailer
* @param numberOfBitstreams * @param numberOfBitstreams
* the number of bitstreams reported * the number of bitstreams reported
* *
* @throws IOException * @throws IOException if IO exception occurs
* if IO exception occurs * @throws MessagingException if message cannot be sent.
* @throws javax.mail.MessagingException
* if message cannot be sent.
*/ */
public void sendReport(File attachment, int numberOfBitstreams) public void sendReport(File attachment, int numberOfBitstreams)
throws IOException, javax.mail.MessagingException throws IOException, javax.mail.MessagingException

View File

@@ -73,7 +73,7 @@ public class HandleDispatcher implements BitstreamDispatcher
/** /**
* Private initialization routine. * Private initialization routine.
* *
* @throws SQLException * @throws SQLException if database error
* if database access fails. * if database access fails.
*/ */
protected synchronized void init() throws SQLException { protected synchronized void init() throws SQLException {

View File

@@ -36,7 +36,7 @@ public class IteratorDispatcher implements BitstreamDispatcher
/** /**
* Main constructor. * Main constructor.
* *
* @param bitstreamIds * @param bitstreams bitstream iterator
*/ */
public IteratorDispatcher(Iterator<Bitstream> bitstreams) public IteratorDispatcher(Iterator<Bitstream> bitstreams)
{ {

View File

@@ -85,7 +85,7 @@ public class ResultsLogger implements ChecksumResultsCollector
* *
* @param info * @param info
* the BitstreamInfo representing the result. * the BitstreamInfo representing the result.
* @see org.dspace.checker.ChecksumResultsCollector#collect(org.dspace.checker.MostRecentChecksum) * @see org.dspace.checker.ChecksumResultsCollector#collect(org.dspace.core.Context, org.dspace.checker.MostRecentChecksum)
*/ */
@Override @Override
public void collect(Context context, MostRecentChecksum info) throws SQLException { public void collect(Context context, MostRecentChecksum info) throws SQLException {

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