Package org.dspace.app.suggestion.script
Class PublicationLoaderScriptConfiguration<T extends PublicationLoaderRunnable>
java.lang.Object
org.dspace.scripts.configuration.ScriptConfiguration<T>
org.dspace.app.suggestion.script.PublicationLoaderScriptConfiguration<T>
- Type Parameters:
T- The specific type ofPublicationLoaderRunnablethat this configuration supports.
- All Implemented Interfaces:
Aware,BeanNameAware
- Direct Known Subclasses:
PublicationLoaderCliScriptConfiguration
public class PublicationLoaderScriptConfiguration<T extends PublicationLoaderRunnable>
extends ScriptConfiguration<T>
Configuration class for the PublicationLoader script.
This class extends
ScriptConfiguration to provide configuration settings
and execution permissions for the PublicationLoaderRunnable script.- Author:
- Adamo Fapohunda (adamo.fapohunda at 4science.com)
-
Field Summary
Fields inherited from class org.dspace.scripts.configuration.ScriptConfiguration
options -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the class type of the DSpace runnable script.org.apache.commons.cli.OptionsDefines the command-line options available for the script.booleanisAllowedToExecute(Context context, List<DSpaceCommandLineParameter> commandLineParameters) Determines whether the current user is authorized to execute the script.voidsetDspaceRunnableClass(Class<T> dspaceRunnableClass) Sets the class type of the DSpace runnable script.Methods inherited from class org.dspace.scripts.configuration.ScriptConfiguration
getDescription, getHelpOptions, getName, setBeanName, setDescription, setName
-
Constructor Details
-
PublicationLoaderScriptConfiguration
public PublicationLoaderScriptConfiguration()
-
-
Method Details
-
getDspaceRunnableClass
Retrieves the class type of the DSpace runnable script.- Specified by:
getDspaceRunnableClassin classScriptConfiguration<T extends PublicationLoaderRunnable>- Returns:
- the class of type
PublicationLoaderScriptConfigurationrepresenting the script to execute.
-
setDspaceRunnableClass
Sets the class type of the DSpace runnable script.- Specified by:
setDspaceRunnableClassin classScriptConfiguration<T extends PublicationLoaderRunnable>- Parameters:
dspaceRunnableClass- The class of the script to be set.
-
isAllowedToExecute
public boolean isAllowedToExecute(Context context, List<DSpaceCommandLineParameter> commandLineParameters) Determines whether the current user is authorized to execute the script. This check is based on whether the user has administrator privileges.- Overrides:
isAllowedToExecutein classScriptConfiguration<T extends PublicationLoaderRunnable>- Parameters:
context- The DSpace context.commandLineParameters- The list of command line parameters provided.- Returns:
- true if the user has administrative privileges, false otherwise.
- Throws:
RuntimeException- if an SQL exception occurs while checking authorization.
-
getOptions
public org.apache.commons.cli.Options getOptions()Defines the command-line options available for the script. These options allow customization of the script execution parameters.- Specified by:
getOptionsin classScriptConfiguration<T extends PublicationLoaderRunnable>- Returns:
- an
Optionsobject containing the available script options.
-