Skip to content

Commit

Permalink
[Task 72232] added javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Raf-atmire committed Aug 11, 2020
1 parent 40ec84d commit cdc1d3b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dspace-api/src/main/java/org/dspace/curate/Curation.java
Expand Up @@ -248,6 +248,13 @@ public void setup() throws ParseException {
}
}

/**
* This method will assign the currentUser to the {@link Context} variable 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 the {@link EPerson} associated with it
* and this {@link EPerson} will be set as the currentUser of the created {@link Context}
* @throws ParseException If something went wrong with the retrieval of the EPerson Identifier
*/
protected void assignCurrentUserInContext() throws ParseException {
UUID currentUserUuid = this.getEpersonIdentifier();
try {
Expand Down
11 changes: 11 additions & 0 deletions dspace-api/src/main/java/org/dspace/curate/CurationCli.java
Expand Up @@ -13,8 +13,19 @@
import org.dspace.core.Context;
import org.dspace.eperson.EPerson;

/**
* This is the CLI version of the {@link Curation} script.
* This will only be called when the curate script is called from a commandline instance.
*/
public class CurationCli extends Curation {

/**
* This is the overridden instance of the {@link Curation#assignCurrentUserInContext()} method in the parent class
* {@link Curation}.
* This is done so that the CLI version of the Script is able to retrieve its currentUser from the -e flag given
* with the parameters of the Script.
* @throws ParseException If the e flag was not given to the parameters when calling the script
*/
@Override
protected void assignCurrentUserInContext() throws ParseException {
if (this.commandLine.hasOption('e')) {
Expand Down
Expand Up @@ -9,6 +9,10 @@

import org.apache.commons.cli.Options;

/**
* This is the CLI version of the {@link CurationScriptConfiguration} class that handles the configuration for the
* {@link CurationCli} script
*/
public class CurationCliScriptConfiguration extends CurationScriptConfiguration<Curation> {

@Override
Expand Down
Expand Up @@ -45,6 +45,11 @@ protected static CurationClientOptions getClientOption(CommandLine commandLine)
return null;
}

/**
* This method will create all the possible Options for the {@link Curation} script.
* This will be used by {@link CurationScriptConfiguration}
* @return The options for the {@link Curation} script
*/
protected static Options constructOptions() {
Options options = new Options();

Expand Down

0 comments on commit cdc1d3b

Please sign in to comment.