Changeset 2512 for trunk/src/examples


Ignore:
Timestamp:
Aug 10, 2006, 11:54:19 AM (16 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #302: Running a plugin without a configuration should not be possible

Location:
trunk/src/examples/plugins/src/net/sf/basedb/exampleplugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/examples/plugins/src/net/sf/basedb/exampleplugins/ExampleAnalyzer.java

    r2498 r2512  
    2323
    2424import net.sf.basedb.core.BaseException;
    25 import net.sf.basedb.core.BioAssay;
    2625import net.sf.basedb.core.BioAssaySet;
    2726import net.sf.basedb.core.DbControl;
     
    9291  );
    9392 
    94   // No configuration options
    95   private static final RequestInformation configurePlugin = new RequestInformation
    96   (
    97     Request.COMMAND_CONFIGURE_PLUGIN,
    98     "Configure plugin",
    99     "This plugin has no configuration options.",
    100     null
    101   );
    102 
    10393  // Job configuration is created by getConfigureJob()
    10494  private RequestInformation configureJob;
     
    130120  {
    131121    return Plugin.MainType.ANALYZE;
     122  }
     123  public boolean supportsConfigurations()
     124  {
     125    return false;
     126  }
     127  public boolean requiresConfiguration()
     128  {
     129    return false;
    132130  }
    133131  public void run(Request request, Response response, ProgressReporter progress)
     
    240238  {
    241239    RequestInformation requestInformation = null;
    242     if (command.equals(Request.COMMAND_CONFIGURE_PLUGIN))
    243     {
    244       requestInformation = configurePlugin;
    245     }
    246     else if (command.equals(Request.COMMAND_CONFIGURE_JOB))
     240    if (command.equals(Request.COMMAND_CONFIGURE_JOB))
    247241    {
    248242      requestInformation = getConfigureJob(context);
     
    259253    try
    260254    {
    261       if (command.equals(Request.COMMAND_CONFIGURE_PLUGIN))
    262       {
    263         response.setDone("Plugin configuration complete");
    264       }
    265      
    266       else if (command.equals(Request.COMMAND_CONFIGURE_JOB))
     255      if (command.equals(Request.COMMAND_CONFIGURE_JOB))
    267256      {
    268257        List<Throwable> errors =
  • trunk/src/examples/plugins/src/net/sf/basedb/exampleplugins/ExampleImporter.java

    r2346 r2512  
    3232import net.sf.basedb.core.PluginParameter;
    3333import net.sf.basedb.core.ProgressReporter;
    34 import net.sf.basedb.core.ReporterList;
    3534import net.sf.basedb.core.RequestInformation;
    3635
     
    8786  );
    8887 
    89 
    90   // No configuration options
    91   private static final RequestInformation configurePlugin = new RequestInformation
    92   (
    93     Request.COMMAND_CONFIGURE_PLUGIN,
    94     "Configure example importer",
    95     "This plugin has no configuration options.",
    96     null
    97   );
    98 
    9988  // Job configuration is created by getConfigureJob()
    10089  private RequestInformation configureJob;
     
    126115  {
    127116    return Plugin.MainType.IMPORT;
     117  }
     118  public boolean supportsConfigurations()
     119  {
     120    return false;
     121  }
     122  public boolean requiresConfiguration()
     123  {
     124    return false;
    128125  }
    129126  public void run(Request request, Response response, ProgressReporter progress)
     
    191188  {
    192189    RequestInformation requestInformation = null;
    193     if (command.equals(Request.COMMAND_CONFIGURE_PLUGIN))
    194     {
    195       requestInformation = configurePlugin;
    196     }
    197     else if (command.equals(Request.COMMAND_CONFIGURE_JOB))
     190    if (command.equals(Request.COMMAND_CONFIGURE_JOB))
    198191    {
    199192      requestInformation = getConfigureJob(context);
     
    210203    try
    211204    {
    212       if (command.equals(Request.COMMAND_CONFIGURE_PLUGIN))
    213       {
    214         response.setDone("Plugin configuration complete");
    215       }
    216      
    217       else if (command.equals(Request.COMMAND_CONFIGURE_JOB))
     205      if (command.equals(Request.COMMAND_CONFIGURE_JOB))
    218206      {
    219207        List<Throwable> errors =
Note: See TracChangeset for help on using the changeset viewer.