Ignore:
Timestamp:
Feb 6, 2006, 2:59:19 PM (17 years ago)
Author:
Gregory Vincic
Message:

Initial revision of the JFreePlotServlet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/analyze/index.jsp

    r1889 r1918  
    169169final ItemContext cc = Base.getAndSetCurrentContext(sc, basType, pageContext, defaultContext);
    170170final ModeInfo mode = ModeInfo.get(request.getParameter("mode"));
     171ItemResultList<BioAssay> baList = null;
    171172
    172173/* Command validation */
     
    244245    var submitPage = 'index.jsp';
    245246    var formId = 'bioassaysets';
    246    
     247    function configureColumns()
     248    {
     249      Table.configureColumns('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>');
     250    }
    247251    function viewExperiment()
    248252    {
     
    284288    function switchTab(tabControlId, tabId)
    285289    {
    286       TabControl.setActiveTab(tabControlId, tabId);       
     290      if(tabId == 'overviewplots')
     291      {
     292        location.replace('index.jsp?ID=<%=ID%>&experiment_id=<%=experimentId%>&item_id=<%=itemId%>&tabId=overviewplots');
     293      }
     294      else
     295      {
     296        TabControl.setActiveTab(tabControlId, tabId);
     297      }
     298     
    287299    }
    288300  </script>
     
    371383        baQuery.include(Include.REMOVED);
    372384        baQuery.include(Include.OTHERS);
    373         ItemResultList<BioAssay> baList = baQuery.list(dc);
     385        baList = baQuery.list(dc);
    374386        for(BioAssay ba : baList) {%>
    375387          <option value="<%=ba.getId()%>" <%=(bioassayId == ba.getId()) ? "selected=selected": ""%>><%=HTML.encodeTags(ba.getName())%>[<%=ba.getNumSpots()%>]</option>
     
    419431        # --> extra value, not implemented
    420432        % --> channel, eg. %1, %2
    421       */
    422       List<String> selectionList = new LinkedList<String>();
     433      */     
    423434      List<TableColumn> cols = new LinkedList<TableColumn>();
     435     
     436      /* Column definitions */
    424437      cols.add( new TableColumn("position", "POSITION", "int", "Position") );
    425438      cols.add( new TableColumn("ch1", "%1", "float", "Ch 1") );
    426439      cols.add( new TableColumn("ch2", "%2", "float", "Ch 2") );
    427440      cols.add( new TableColumn("externalId", "@externalId", "string", "External Id") );
     441      cols.add( new TableColumn("name", "@name", "string", "Name") );
     442      cols.add( new TableColumn("symbol", "@symbol", "string", "Symbol") );
     443      cols.add( new TableColumn("ch1FgMedian", "$ch1FgMedian", "float", "ch1FgMedian") );
     444     
     445      /* End column definitions */
     446      List<String> selectionList = new LinkedList<String>(); // Used when configuring query
    428447     
    429448      for(TableColumn c : cols)
     
    446465      DynamicResultIterator spots = dynQuery.iterate(dc);
    447466      %>
     467     
     468      <tbl:toolbar>
     469        <tbl:button
     470          image="columns.gif"
     471          onclick="configureColumns()"
     472          title="Columns&hellip;"
     473          tooltip="Show, hide and re-order columns"
     474        />
     475      </tbl:toolbar>
    448476      <tbl:navigator
    449477        page="<%=cc.getPage()%>"
     
    466494        </tr>
    467495        <tbl:rows>
    468           <%
    469          
    470           int reporter_i = spots.getIndex("externalId");
    471           int ch1 = spots.getIndex("ch1");
    472           int ch2 = spots.getIndex("ch2");
    473           int position_i = spots.getIndex("position");
     496          <%         
     497          int[] indexValues = new int[cols.size()];
     498          int i = 0;
     499          for(TableColumn c : cols)
     500          {
     501            indexValues[i] = spots.getIndex(c.getId());
     502            i++;
     503          }
    474504          while(spots.hasNext())
    475           {
    476            
     505          {           
    477506            SqlResult r = spots.next();
    478507            %>
    479508            <tbl:row>
    480509                <th colspan="3" class="index">&nbsp;</th>
    481               <tbl:cell column="externalId"><%=r.getString(reporter_i) == null ? "" : r.getString(reporter_i)%></tbl:cell>
    482               <tbl:cell column="ch1"><%=r.getFloat(ch1)%></tbl:cell>
    483               <tbl:cell column="ch2"><%=r.getFloat(ch2)%></tbl:cell>
    484               <tbl:cell column="position"><%=r.getInt(position_i)%></tbl:cell>
     510                <%
     511                i = 0;
     512                for(TableColumn c : cols)
     513                {%>
     514                <tbl:cell column="<%=c.getId()%>">
     515                  <%=r.getString(indexValues[i]) == null ? "" : r.getString(indexValues[i])%>
     516                </tbl:cell>
     517              <%
     518              i++;
     519              }%>
    485520            </tbl:row>
    486521          <%
     
    499534      />
    500535    </tbl:table>
     536    <%}%>
     537    </t:tab>
     538    <t:tab id="overviewplots" title="Overview plots">
     539    <%if(tabId.equals("overviewplots")){%>
     540    <%for(BioAssay ba : baList) {%>
     541          <img src="<%=root%>/analyze/jfreeplot/<%=ID%>/<%=itemId%>/<%=ba.getId()%>"/>
     542        <%}%>
    501543    <%}%>
    502544    </t:tab>
Note: See TracChangeset for help on using the changeset viewer.