Package org.dspace.app.bulkedit
Class MetadataImportCLI
- java.lang.Object
-
- org.dspace.scripts.DSpaceRunnable<MetadataImportScriptConfiguration>
-
- org.dspace.app.bulkedit.MetadataImport
-
- org.dspace.app.bulkedit.MetadataImportCLI
-
- All Implemented Interfaces:
Runnable
public class MetadataImportCLI extends MetadataImport
CLI variant for theMetadataImportclass This has been made so that we can specify the behaviour of the determineChanges method to be specific for the CLI
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.dspace.scripts.DSpaceRunnable
DSpaceRunnable.StepResult
-
-
Field Summary
-
Fields inherited from class org.dspace.app.bulkedit.MetadataImport
AC_PREFIX, authorityControlled, authorityValueService, collectionService, configurationService, csvRefMap, csvRowMap, entityRelationMap, entityService, entityTypeMap, entityTypeService, handleService, installItemService, itemService, log, relationshipService, relationshipTypeService, relationValidationErrors, rowCount, validateOnly, workspaceItemService
-
Fields inherited from class org.dspace.scripts.DSpaceRunnable
commandLine, handler, helpCommandLine
-
-
Constructor Summary
Constructors Constructor Description MetadataImportCLI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassignCurrentUserInContext(Context context)protected booleandetermineChange(DSpaceRunnableHandler handler)This method determines whether the changes should be applied or not.voidsetup()This method has to be included in every script and handles the setup of the script by parsing the CommandLine and setting the variables-
Methods inherited from class org.dspace.app.bulkedit.MetadataImport
add, clean, compare, compareAndUpdate, contains, getBulkEditValueFromCSV, getScriptConfiguration, initMetadataImport, internalRun, resolveEntityRefs, runImport, simplyCopyValue
-
Methods inherited from class org.dspace.scripts.DSpaceRunnable
getEpersonIdentifier, getFileNamesFromInputStreamOptions, initialize, printHelp, run, setEpersonIdentifier
-
-
-
-
Method Detail
-
determineChange
protected boolean determineChange(DSpaceRunnableHandler handler) throws IOException
Description copied from class:MetadataImportThis method determines whether the changes should be applied or not. This is default set to true for the REST script as we don't want to interact with the caller. This will be overwritten in the CLI script to ask for confirmation- Overrides:
determineChangein classMetadataImport- Parameters:
handler- Applicable DSpaceRunnableHandler- Returns:
- boolean indicating the value
- Throws:
IOException- If something goes wrong
-
assignCurrentUserInContext
protected void assignCurrentUserInContext(Context context) throws org.apache.commons.cli.ParseException
- Overrides:
assignCurrentUserInContextin classMetadataImport- Throws:
org.apache.commons.cli.ParseException
-
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- Overrides:
setupin classMetadataImport- Throws:
org.apache.commons.cli.ParseException- If something goes wrong
-
-