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
CLI variant for the
MetadataImport class
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, workspaceItemServiceFields inherited from class org.dspace.scripts.DSpaceRunnable
commandLine, handler, helpCommandLine -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 variablesMethods inherited from class org.dspace.app.bulkedit.MetadataImport
add, clean, compare, compareAndUpdate, contains, getBulkEditValueFromCSV, getScriptConfiguration, initMetadataImport, internalRun, resolveEntityRefs, runImport, simplyCopyValueMethods inherited from class org.dspace.scripts.DSpaceRunnable
getEpersonIdentifier, getFileNamesFromInputStreamOptions, initialize, printHelp, run, setEpersonIdentifier
-
Constructor Details
-
MetadataImportCLI
public MetadataImportCLI()
-
-
Method Details
-
determineChange
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
-