Changeset 2491


Ignore:
Timestamp:
Aug 8, 2006, 9:51:46 AM (16 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #168: Use formulas in table listings of bioassay data

Location:
trunk
Files:
4 edited

Legend:

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

    r2490 r2491  
    114114  */
    115115 
    116   // TODO - fix for use with table listings
    117116  public static void addFormulaColumns(List<TableColumn> columns, DbControl dc, RawDataType rawDataType, Formula.Type type, String idPrefix, String titlePrefix)
    118117  {
  • trunk/src/core/net/sf/basedb/core/ItemContext.java

    r2490 r2491  
    3535import net.sf.basedb.core.query.JoinType;
    3636import net.sf.basedb.core.query.Select;
     37import net.sf.basedb.core.query.Selects;
    3738import net.sf.basedb.core.data.ContextData;
    3839import net.sf.basedb.core.data.PropertyFilterData;
     
    10071008      // TODO
    10081009    }
     1010    else if (propertyDef.startsWith("="))
     1011    {
     1012      // propertyDef is JEP expression
     1013      joins.joinRawData |= propertyDef.contains("raw(");
     1014      Expression e = Jep.formulaToExpression(propertyDef.substring(1), ch, raw);
     1015      s = Selects.expression(e, "jep" + joins.getNextAlias());
     1016    }
    10091017    else
    10101018    {
     
    10361044    public boolean joinRawData = false;
    10371045    public boolean joinReporters = false;
     1046   
     1047    private int nextAlias = 0;
     1048   
     1049    public int getNextAlias()
     1050    {
     1051      return ++nextAlias;
     1052    }
     1053   
    10381054  }
    10391055 
  • trunk/www/views/experiments/bioassays/spotdata/list_spotdata.jsp

    r2304 r2491  
    3939  import="net.sf.basedb.core.DynamicResultIterator"
    4040  import="net.sf.basedb.core.PluginDefinition"
     41  import="net.sf.basedb.core.Formula"
    4142  import="net.sf.basedb.core.plugin.GuiContext"
    4243  import="net.sf.basedb.core.plugin.Plugin"
     
    8788  List<TableColumn> columns = new LinkedList<TableColumn>();
    8889  DynamicUtil.addSpotColumns(columns, rawDataType.getChannels());
     90  DynamicUtil.addFormulaColumns(columns, dc, rawDataType, Formula.Type.COLUMN_EXPRESSION, "frm.", "");
    8991  DynamicUtil.addRawDataColumns(columns, rawDataType, "raw.", "$", "[Raw] ");
    9092  DynamicUtil.addReporterColumns(columns, "rep.", "@", "[Rep] ");
    9193  // TODO - DynamicUtil.addExtraColumns(columns);
    92   // TODO - DynamicUtil.addFormulaColumns(columns);
    9394  DynamicUtil.SelectedInfo selected = DynamicUtil.getSelectedColumns(cc, columns);
    9495 
     
    105106  int numListed = 0;
    106107  %>
    107 
    108108  <base:page title="<%=title%>">
    109109  <base:head scripts="table.js,tabcontrol.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css">
  • trunk/www/views/experiments/explorer/view/view.jsp

    r2490 r2491  
    101101  List<TableColumn> columns = new LinkedList<TableColumn>();
    102102  DynamicUtil.addSpotColumns(columns, rawDataType.getChannels());
    103   DynamicUtil.addFormulaColumns(columns, dc, rawDataType, Formula.Type.COLUMN_EXPRESSION, "frm", "");
     103  DynamicUtil.addFormulaColumns(columns, dc, rawDataType, Formula.Type.COLUMN_EXPRESSION, "frm.", "");
    104104  DynamicUtil.addRawDataColumns(columns, rawDataType, "raw.", "$", "[Raw] ");
    105105  // TODO - DynamicUtil.addExtraColumns(columns);
Note: See TracChangeset for help on using the changeset viewer.