Changeset 4871


Ignore:
Timestamp:
Apr 1, 2009, 2:58:27 PM (13 years ago)
Author:
Nicklas Nordborg
Message:

References #1271: Add extension points to all toolbars

Added extension points to all experiment subpages. Fixed some rendering bugs.

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/renderer/PrefixSuffixRenderer.java

    r4870 r4871  
    8888      if (prefix != null) writer.print(prefix);
    8989      if (parent != null) parent.render(action);
    90       if (suffix != null) writer.print(prefix);
     90      if (suffix != null) writer.print(suffix);
    9191    }
    9292    catch (IOException ex)
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/toolbar/ToolbarButtonRenderer.java

    r4870 r4871  
    136136      sb.append("</tr></table>");
    137137    }
    138     sb.append("</div>\n");
     138    sb.append("</div>");
    139139    return sb.toString();
    140140  }
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/toolbar/ToolbarUtil.java

    r4870 r4871  
    5454  public static final Item[] TOOLBAR_ITEMS = new Item[]
    5555    {
    56       Item.EXPERIMENT
     56      Item.EXPERIMENT, Item.BIOASSAYSET, Item.BIOASSAY,
     57      Item.TRANSFORMATION, Item.EXTRAVALUE, Item.SPOTDATA
    5758    };
    5859
  • trunk/src/clients/web/net/sf/basedb/clients/web/taglib/extensions/Render.java

    r4870 r4871  
    2222*/
    2323package net.sf.basedb.clients.web.taglib.extensions;
    24 
    25 import java.io.IOException;
    2624
    2725import javax.servlet.jsp.JspException;
     
    158156  {
    159157    if (item != null && context != null) context.setCurrentItem(item);
    160     try
     158    if (renderer == null)
    161159    {
    162       if (renderer == null)
    163       {
    164         extensions.renderDefault(wrapper);
    165       }
    166       else if (wrapper != null)
    167       {
    168         wrapper.setParent(renderer);
    169         extensions.render(wrapper);
    170       }
    171       else
    172       {
    173         extensions.render(renderer);
    174       }
    175       pageContext.getOut().print("</td>");
     160      extensions.renderDefault(wrapper);
    176161    }
    177     catch (IOException ex)
     162    else if (wrapper != null)
    178163    {
    179       throw new JspException(ex);
     164      wrapper.setParent(renderer);
     165      extensions.render(wrapper);
     166    }
     167    else
     168    {
     169      extensions.render(renderer);
    180170    }
    181171    return SKIP_BODY;
  • trunk/www/views/experiments/bioassays/list_bioassays.jsp

    r4776 r4871  
    6161  import="net.sf.basedb.util.formatter.Formatter"
    6262  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
     63  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
     64  import="net.sf.basedb.clients.web.extensions.JspContext"
     65  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
     66  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
     67  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
    6368  import="java.util.List"
    6469  import="java.util.LinkedList"
     
    7277<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
    7378<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
     79<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
    7480<%!
    7581  private static final Item itemType = Item.BIOASSAY;
     
    126132  }
    127133  int numListed = 0;
     134  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext);
     135  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext, guiContext);
    128136  %>
    129137  <base:page title="<%=title%>" type="<%=mode.getPageType()%>">
    130138  <base:head scripts="table.js,tabcontrol.js" styles="table.css,headertabcontrol.css,path.css">
     139    <ext:scripts context="<%=jspContext%>" />
     140    <ext:stylesheets context="<%=jspContext%>" />
    131141    <script language="JavaScript">
    132142    var submitPage = 'index.jsp';
     
    411421          visible="<%=pluginCount.containsKey(Plugin.MainType.ANALYZE) && !mode.isSelectionMode()%>"
    412422        />
     423        <ext:render extensions="<%=invoker%>" context="<%=jspContext%>"
     424          wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
    413425      </tbl:toolbar>
    414426      <tbl:navigator
  • trunk/www/views/experiments/bioassays/view_bioassay.jsp

    r4511 r4871  
    5252  import="net.sf.basedb.clients.web.PermissionUtil"
    5353  import="net.sf.basedb.clients.web.util.HTML"
     54  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
     55  import="net.sf.basedb.clients.web.extensions.JspContext"
     56  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
     57  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
     58  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
    5459  import="net.sf.basedb.util.Values"
    5560  import="java.util.Map"
     
    6267<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
    6368<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
     69<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
    6470<%!
    6571  private static final Item itemType = Item.BIOASSAY;
     
    8490  final boolean writePermission = bioAssay.hasPermission(Permission.WRITE);
    8591  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
     92  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext);
     93  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext, guiContext);
    8694  %>
    87 
    8895  <base:page title="<%=title%>">
    8996  <base:head scripts="table.js,tabcontrol.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css">
     97    <ext:scripts context="<%=jspContext%>" />
     98    <ext:stylesheets context="<%=jspContext%>" />
    9099    <script language="JavaScript">
    91100    function editItem()
     
    164173        visible="<%=hasDbSpots%>"
    165174      />
     175      <ext:render extensions="<%=invoker%>" context="<%=jspContext%>"
     176        wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
    166177      <tbl:button
    167178        image="help.gif"
  • trunk/www/views/experiments/bioassaysets/analysis_tree.jsp

    r4776 r4871  
    6363  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
    6464  import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction"
     65  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
    6566  import="net.sf.basedb.clients.web.extensions.JspContext"
     67  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
    6668  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
    6769  import="net.sf.basedb.util.extensions.Renderer"
     
    279281 
    280282  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext);
    281   ExtensionsInvoker invoker = ExtensionsControl.useExtensions(jspContext,
     283  ExtensionsInvoker toolsInvoker = ExtensionsControl.useExtensions(jspContext,
    282284      "net.sf.basedb.clients.web.bioassayset.list.tools");
     285  ExtensionsInvoker toolbarInvoker = ToolbarUtil.useExtensions(jspContext, guiContext);
    283286  %>
    284 <base:page type="include">
     287  <base:page type="include">
    285288  <base:body>
    286289    <ext:scripts context="<%=jspContext%>" />
     
    735738          visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
    736739        />
     740        <ext:render extensions="<%=toolbarInvoker%>" context="<%=jspContext%>"
     741          wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
    737742      </tbl:toolbar>
    738743      <tbl:data>
     
    918923                      }
    919924                      %>
    920                       <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" item="<%=item%>" />
     925                      <ext:render extensions="<%=toolsInvoker%>" context="<%=jspContext%>" item="<%=item%>" />
    921926                      </nobr>
    922927                    </tbl:cell>
     
    986991                      }
    987992                      %>
    988                       <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" item="<%=item%>" />
     993                      <ext:render extensions="<%=toolsInvoker%>" context="<%=jspContext%>" item="<%=item%>" />
    989994                      </nobr>
    990995                    </tbl:cell>
     
    10101015                      }
    10111016                      %>
    1012                       <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" item="<%=item%>" />                           
     1017                      <ext:render extensions="<%=toolsInvoker%>" context="<%=jspContext%>" item="<%=item%>" />                           
    10131018                      </nobr>
    10141019                    </tbl:cell>
  • trunk/www/views/experiments/bioassaysets/view_bioassayset.jsp

    r4825 r4871  
    5959  import="net.sf.basedb.util.formatter.Formatter"
    6060  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
     61  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
     62  import="net.sf.basedb.clients.web.extensions.JspContext"
     63  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
     64  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
     65  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
    6166  import="java.util.Date"
    6267  import="java.util.Map"
     
    6873<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
    6974<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
     75<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
    7076<%!
    7177  private static final Item itemType = Item.BIOASSAYSET;
     
    136142  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
    137143  Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc);
     144  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext);
     145  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext, guiContext);
    138146  %>
    139 
    140147  <base:page title="<%=title%>">
    141148  <base:head scripts="table.js,tabcontrol.js,newjoust.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css,newjoust.css">
     149    <ext:scripts context="<%=jspContext%>" />
     150    <ext:stylesheets context="<%=jspContext%>" />
    142151    <script language="JavaScript">
    143152    function editItem()
     
    304313        visible="<%=pluginCount.containsKey(Plugin.MainType.ANALYZE)%>"
    305314      />
     315      <ext:render extensions="<%=invoker%>" context="<%=jspContext%>"
     316        wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
    306317      <tbl:button
    307318        image="help.gif"
  • trunk/www/views/experiments/extravalues/view_extravalue.jsp

    r4511 r4871  
    5858  import="net.sf.basedb.util.formatter.Formatter"
    5959  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
     60  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
     61  import="net.sf.basedb.clients.web.extensions.JspContext"
     62  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
     63  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
     64  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
    6065  import="java.util.Date"
    6166  import="java.util.Map"
     
    6772<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
    6873<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
     74<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
    6975<%!
    7076  private static final Item itemType = Item.EXTRAVALUE;
     
    141147  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
    142148  Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc);
     149  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext);
     150  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext, guiContext);
    143151  %>
    144 
    145152  <base:page title="<%=title%>">
    146153  <base:head scripts="table.js,tabcontrol.js,newjoust.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css,newjoust.css">
     154    <ext:scripts context="<%=jspContext%>" />
     155    <ext:stylesheets context="<%=jspContext%>" />
    147156    <script language="JavaScript">
    148157    function editItem()
     
    218227        visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
    219228      />
     229      <ext:render extensions="<%=invoker%>" context="<%=jspContext%>"
     230        wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
    220231      <tbl:button
    221232        image="help.gif"
  • trunk/www/views/experiments/spotdata/list_spotdata.jsp

    r4857 r4871  
    5353  import="net.sf.basedb.util.Values"
    5454  import="net.sf.basedb.clients.web.taglib.table.TableColumn"
     55  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
     56  import="net.sf.basedb.clients.web.extensions.JspContext"
     57  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
     58  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
     59  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
    5560  import="java.util.Map"
    5661  import="java.util.HashMap"
     
    6772<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
    6873<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
     74<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
    6975<%!
    7076  private static final Item itemType = Item.SPOTDATA;
     
    118124
    119125  int numListed = 0;
     126  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext);
     127  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext, guiContext);
    120128  %>
    121  
    122129  <base:page title="<%=title%>">
    123130  <base:head scripts="table.js,tabcontrol.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css">
     131    <ext:scripts context="<%=jspContext%>" />
     132    <ext:stylesheets context="<%=jspContext%>" />
    124133    <script language="JavaScript">
    125134    var submitPage = 'index.jsp';
     
    328337          visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
    329338        />
     339        <ext:render extensions="<%=invoker%>" context="<%=jspContext%>"
     340          wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
    330341      </tbl:toolbar>
    331342      <tbl:navigator
  • trunk/www/views/experiments/transformations/view_transformation.jsp

    r4669 r4871  
    5858  import="net.sf.basedb.util.formatter.Formatter"
    5959  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
     60  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
     61  import="net.sf.basedb.clients.web.extensions.JspContext"
     62  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
     63  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
     64  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
    6065  import="java.util.Date"
    6166  import="java.util.Map"
     
    6772<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
    6873<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
     74<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
    6975<%!
    7076  private static final Item itemType = Item.TRANSFORMATION;
     
    132138  final boolean writePermission = transformation.hasPermission(Permission.WRITE);
    133139  final boolean deletePermission = transformation.hasPermission(Permission.DELETE);
     140  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext);
     141  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext, guiContext);
    134142  %>
    135 
    136143  <base:page title="<%=title%>">
    137144  <base:head scripts="table.js,tabcontrol.js,newjoust.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css,newjoust.css">
     145    <ext:scripts context="<%=jspContext%>" />
     146    <ext:stylesheets context="<%=jspContext%>" />
    138147    <script language="JavaScript">
    139148    function editItem()
     
    221230        visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
    222231      />
     232      <ext:render extensions="<%=invoker%>" context="<%=jspContext%>"
     233        wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
    223234      <tbl:button
    224235        image="help.gif"
  • trunk/www/views/experiments/view_experiment.jsp

    r4767 r4871  
    5858  import="net.sf.basedb.util.formatter.Formatter"
    5959  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
     60  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
     61  import="net.sf.basedb.clients.web.extensions.JspContext"
     62  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
     63  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
     64  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
    6065  import="java.util.Collections"
    6166  import="java.util.Date"
     
    7277<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
    7378<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
     79<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
    7480<%!
    7581  private static final Item itemType = Item.EXPERIMENT;
     
    105111    new HashMap<AnnotationType, Set<Object>>();
    106112  Map<AnnotationType, Integer> factorValuesCount = new HashMap<AnnotationType, Integer>();
     113  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext);
     114  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext, guiContext);
    107115  %>
    108 
    109116  <base:page title="<%=title%>">
    110117  <base:head scripts="table.js,tabcontrol.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css">
     118    <ext:scripts context="<%=jspContext%>" />
     119    <ext:stylesheets context="<%=jspContext%>" />
    111120    <script language="JavaScript">
    112121    function editItem()
     
    288297        visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
    289298      />
     299      <ext:render extensions="<%=invoker%>" context="<%=jspContext%>"
     300        wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
    290301      <tbl:button
    291302        image="help.gif"
Note: See TracChangeset for help on using the changeset viewer.