Changeset 5404


Ignore:
Timestamp:
Sep 10, 2010, 1:03:53 PM (13 years ago)
Author:
Martin Svensson
Message:

Fixes #1508 Hide "Restart job" for failed jobs if the plug-in doesn't support restarting

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/plugins/SimpleExport.java

    r5400 r5404  
    5959import net.sf.basedb.core.plugin.Plugin;
    6060import net.sf.basedb.core.plugin.InteractivePlugin;
     61import net.sf.basedb.core.plugin.NonRestartable;
    6162import net.sf.basedb.core.plugin.Request;
    6263import net.sf.basedb.core.plugin.Response;
     
    100101public class SimpleExport
    101102  extends AbstractExporterPlugin
    102   implements InteractivePlugin, SignalTarget
     103  implements InteractivePlugin, SignalTarget, NonRestartable
    103104{
    104105
  • trunk/src/core/net/sf/basedb/core/Install.java

    r5388 r5404  
    669669        "API documentation for more details.",
    670670        "net.sf.basedb.plugins.executor.IOSupport", null);
     671      createPluginType("Non-restartable plug-in",
     672          "This is a tagging interface that should be implemented by plug-ins that " +
     673          "don't support restart and reconfiguration of a job after an interrupted execution. " +
     674          "This interface doesn't define any method that implementing classes should use.",
     675          "net.sf.basedb.core.plugin.NonRestartable", null);
    671676     
    672677      createPluginDefinition("net.sf.basedb.plugins.Base1PluginExecuter", null, null, true, null, false);
  • trunk/www/views/jobs/view_job.jsp

    r5402 r5404  
    4242  import="net.sf.basedb.core.ItemResultIterator"
    4343  import="net.sf.basedb.core.ItemQuery"
    44   import="net.sf.basedb.core.ItemResultList"
     44  import="net.sf.basedb.core.ItemResultList" 
    4545  import="net.sf.basedb.core.PermissionDeniedException"
    4646  import="net.sf.basedb.core.PluginDefinition"
    4747  import="net.sf.basedb.core.PluginConfiguration"
     48  import="net.sf.basedb.core.PluginType"
    4849  import="net.sf.basedb.core.ParameterInfo"
    4950  import="net.sf.basedb.core.query.Orders"
    5051  import="net.sf.basedb.core.query.Hql"
    5152  import="net.sf.basedb.core.plugin.GuiContext"
     53  import="net.sf.basedb.core.plugin.NonRestartable"
    5254  import="net.sf.basedb.core.plugin.Plugin"
    5355  import="net.sf.basedb.core.signal.SignalTransporter"
     
    653655      if (job.getStatus() == Job.Status.ERROR && job.getJobType() == Job.Type.RUN_PLUGIN)
    654656      {
    655         %>
    656         <base:button onclick="restartJob(0)" title="Restart job"
    657           image="refresh.gif"
    658           tooltip="Try to run this job again with the same parameters"
    659         />
    660         <base:button onclick="reconfigureJob()" title="Re-configure job"
    661           image="runplugin.gif"
    662           tooltip="Change the parameters for this job and try again"
    663           visible="<%=job.hasContext()%>"
    664         />
    665         <%
     657        boolean restartable = !job.getPluginDefinition().supports("net.sf.basedb.core.plugin.NonRestartable");       
     658        if (restartable)
     659        {
     660          %>
     661          <base:button onclick="restartJob(0)" title="Restart job"
     662            image="refresh.gif"
     663            tooltip="Try to run this job again with the same parameters"
     664          />
     665          <base:button onclick="reconfigureJob()" title="Re-configure job"
     666            image="runplugin.gif"
     667            tooltip="Change the parameters for this job and try again"
     668            visible="<%=job.hasContext()%>"
     669          />
     670          <%
     671        }
    666672      }
    667673      if (job.getStatus() == Job.Status.DONE && job.isDryRun())
Note: See TracChangeset for help on using the changeset viewer.