Package org.dspace.app.harvest
Class Harvest
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
HarvestCli
Test class for harvested collections.
- Author:
- Alexey Maslov
-
Nested Class Summary
Nested classes/interfaces inherited from class org.dspace.scripts.DSpaceRunnable
DSpaceRunnable.StepResult -
Field Summary
FieldsFields inherited from class org.dspace.scripts.DSpaceRunnable
commandLine, handler, helpCommandLine -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThis method will assign the currentUser to theContextvariable which is also created in this method.This method will return the Configuration that the implementing DSpaceRunnable usesvoidThis method has to be included in every script and this will be the main execution block for the script that'll contain all the logic neededvoidsetup()This method has to be included in every script and handles the setup of the script by parsing the CommandLine and setting the variablesMethods inherited from class org.dspace.scripts.DSpaceRunnable
getEpersonIdentifier, getFileNamesFromInputStreamOptions, initialize, printHelp, run, setEpersonIdentifier
-
Field Details
-
ePersonService
-
context
-
-
Constructor Details
-
Harvest
public Harvest()
-
-
Method Details
-
getScriptConfiguration
Description copied from class:DSpaceRunnableThis method will return the Configuration that the implementing DSpaceRunnable uses- Specified by:
getScriptConfigurationin classDSpaceRunnable<HarvestScriptConfiguration>- Returns:
- The
ScriptConfigurationthat this implementing DspaceRunnable uses
-
setup
public void setup() throws org.apache.commons.cli.ParseExceptionDescription copied from class:DSpaceRunnableThis method has to be included in every script and handles the setup of the script by parsing the CommandLine and setting the variables- Specified by:
setupin classDSpaceRunnable<HarvestScriptConfiguration>- Throws:
org.apache.commons.cli.ParseException- If something goes wrong
-
assignCurrentUserInContext
protected void assignCurrentUserInContext() throws org.apache.commons.cli.ParseExceptionThis method will assign the currentUser to theContextvariable which is also created in this method. The instance of the method in this class will fetch the EPersonIdentifier from this class, this identifier was given to this class upon instantiation, it'll then be used to find theEPersonassociated with it and thisEPersonwill be set as the currentUser of the createdContext- Throws:
org.apache.commons.cli.ParseException- If something went wrong with the retrieval of the EPerson Identifier
-
internalRun
Description copied from class:DSpaceRunnableThis method has to be included in every script and this will be the main execution block for the script that'll contain all the logic needed- Specified by:
internalRunin classDSpaceRunnable<HarvestScriptConfiguration>- Throws:
Exception- If something goes wrong
-