Package org.dspace.scripts.configuration
Class ScriptConfiguration<T extends DSpaceRunnable>
- java.lang.Object
-
- org.dspace.scripts.configuration.ScriptConfiguration<T>
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware
- Direct Known Subclasses:
BulkAccessControlScriptConfiguration,CurationScriptConfiguration,HarvestScriptConfiguration,IndexDiscoveryScriptConfiguration,ItemExportScriptConfiguration,ItemImportScriptConfiguration,MediaFilterScriptConfiguration,MetadataDeletionScriptConfiguration,MetadataExportScriptConfiguration,MetadataExportSearchScriptConfiguration,MetadataImportScriptConfiguration,OrcidBulkPushScriptConfiguration,ProcessCleanerConfiguration,RetryFailedOpenUrlTrackerScriptConfiguration,SolrDatabaseResyncCliScriptConfiguration,SubmissionFormsMigrationCliScriptConfiguration,SubmissionFormsMigrationScriptConfiguration,SubscriptionEmailNotificationConfiguration
public abstract class ScriptConfiguration<T extends DSpaceRunnable> extends Object implements org.springframework.beans.factory.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 theisAllowedToExecute(Context, List)method.
-
-
Field Summary
Fields Modifier and Type Field Description protected AuthorizeServiceauthorizeServiceprotected org.apache.commons.cli.OptionsoptionsThe possible options for this script
-
Constructor Summary
Constructors Constructor Description ScriptConfiguration()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringgetDescription()Generic getter for the descriptionabstract Class<T>getDspaceRunnableClass()Generic getter for the dspaceRunnableClassorg.apache.commons.cli.OptionsgetHelpOptions()The getter for the options of the Script (help informations)StringgetName()Generic getter for the nameabstract org.apache.commons.cli.OptionsgetOptions()The 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 dspaceRunnableClassvoidsetName(String name)Generic setter for the name
-
-
-
Field Detail
-
authorizeService
@Autowired protected AuthorizeService authorizeService
-
options
protected org.apache.commons.cli.Options options
The possible options for this script
-
-
Method Detail
-
getDescription
public String getDescription()
Generic getter for the description- Returns:
- the description value of this ScriptConfiguration
-
setDescription
public void setDescription(String description)
Generic setter for the description- Parameters:
description- The description to be set on this ScriptConfiguration
-
getName
public String getName()
Generic getter for the name- Returns:
- the name value of this ScriptConfiguration
-
setName
public void setName(String name)
Generic setter for the name- Parameters:
name- The name to be set on this ScriptConfiguration
-
getDspaceRunnableClass
public abstract Class<T> getDspaceRunnableClass()
Generic getter for the dspaceRunnableClass- Returns:
- the dspaceRunnableClass value of this ScriptConfiguration
-
setDspaceRunnableClass
public abstract void setDspaceRunnableClass(Class<T> dspaceRunnableClass)
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 informations)- Returns:
- the options value of this ScriptConfiguration for help
-
setBeanName
public void setBeanName(String beanName)
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
-