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 Details

    • authorizeService

      @Autowired protected AuthorizeService authorizeService
    • options

      protected org.apache.commons.cli.Options options
      The possible options for this script
  • Constructor Details

    • ScriptConfiguration

      public ScriptConfiguration()
  • Method Details

    • 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 context
      commandLineParameters - the parameters that will be used to start the process if known, null otherwise
      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

      public void setBeanName(String beanName)
      Specified by:
      setBeanName in interface BeanNameAware