Package org.dspace.scripts.configuration
Class ScriptConfiguration<T extends DSpaceRunnable>
java.lang.Object
org.dspace.scripts.configuration.ScriptConfiguration<T>
- All Implemented Interfaces:
Aware,BeanNameAware
- Direct Known Subclasses:
BulkAccessControlScriptConfiguration,CurationScriptConfiguration,HarvestScriptConfiguration,IndexDiscoveryScriptConfiguration,ItemExportScriptConfiguration,ItemImportScriptConfiguration,MediaFilterScriptConfiguration,MetadataDeletionScriptConfiguration,MetadataExportFilteredItemsReportScriptConfiguration,MetadataExportScriptConfiguration,MetadataExportSearchScriptConfiguration,MetadataImportScriptConfiguration,OpenaireEventsImportScriptConfiguration,OrcidBulkPushScriptConfiguration,ProcessCleanerConfiguration,PublicationLoaderScriptConfiguration,RetryFailedOpenUrlTrackerScriptConfiguration,SolrDatabaseResyncCliScriptConfiguration,SubmissionFormsMigrationCliScriptConfiguration,SubmissionFormsMigrationScriptConfiguration,SubscriptionEmailNotificationConfiguration
public abstract class ScriptConfiguration<T extends DSpaceRunnable>
extends Object
implements BeanNameAware
This class represents an Abstract class that a ScriptConfiguration can inherit to further implement this
and represent a script's configuration.
By default script are available only to repository administrators script that have a broader audience
must override the
isAllowedToExecute(Context, List) method.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AuthorizeServiceprotected org.apache.commons.cli.OptionsThe possible options for this script -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGeneric getter for the descriptionGeneric getter for the dspaceRunnableClassorg.apache.commons.cli.OptionsThe getter for the options of the Script (help information)getName()Generic getter for the nameabstract org.apache.commons.cli.OptionsThe getter for the options of the ScriptbooleanisAllowedToExecute(Context context, List<DSpaceCommandLineParameter> commandLineParameters) This method will return if the script is allowed to execute in the given context.voidsetBeanName(String beanName) voidsetDescription(String description) Generic setter for the descriptionabstract voidsetDspaceRunnableClass(Class<T> dspaceRunnableClass) Generic setter for the dspaceRunnableClassvoidGeneric setter for the name
-
Field Details
-
authorizeService
-
options
protected org.apache.commons.cli.Options optionsThe possible options for this script
-
-
Constructor Details
-
ScriptConfiguration
public ScriptConfiguration()
-
-
Method Details
-
getDescription
Generic getter for the description- Returns:
- the description value of this ScriptConfiguration
-
setDescription
Generic setter for the description- Parameters:
description- The description to be set on this ScriptConfiguration
-
getName
Generic getter for the name- Returns:
- the name value of this ScriptConfiguration
-
setName
Generic setter for the name- Parameters:
name- The name to be set on this ScriptConfiguration
-
getDspaceRunnableClass
Generic getter for the dspaceRunnableClass- Returns:
- the dspaceRunnableClass value of this ScriptConfiguration
-
setDspaceRunnableClass
Generic setter for the dspaceRunnableClass- Parameters:
dspaceRunnableClass- The dspaceRunnableClass to be set on this IndexDiscoveryScriptConfiguration
-
isAllowedToExecute
public boolean isAllowedToExecute(Context context, List<DSpaceCommandLineParameter> commandLineParameters) This method will return if the script is allowed to execute in the given context. This is by default set to the currentUser in the context being an admin, however this can be overwritten by each script individually if different rules apply- Parameters:
context- The relevant DSpace contextcommandLineParameters- the parameters that will be used to start the process if known,nullotherwise- Returns:
- A boolean indicating whether the script is allowed to execute or not
-
getOptions
public abstract org.apache.commons.cli.Options getOptions()The getter for the options of the Script- Returns:
- the options value of this ScriptConfiguration
-
getHelpOptions
public org.apache.commons.cli.Options getHelpOptions()The getter for the options of the Script (help information)- Returns:
- the options value of this ScriptConfiguration for help
-
setBeanName
- Specified by:
setBeanNamein interfaceBeanNameAware
-