Changeset 4613


Ignore:
Timestamp:
Oct 29, 2008, 9:23:56 AM (14 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1129: Filtering of child/parent items in table listing

Biomaterials and the rest of the View menu.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/data/BioMaterialData.java

    r4517 r4613  
    2222*/
    2323package net.sf.basedb.core.data;
     24
     25import java.util.Set;
    2426
    2527/**
     
    6062  }
    6163
     64  private Set<MeasuredBioMaterialData> children;
     65  /**
     66    This is the inverse end. NOTE! This collection will not
     67    contained pooled children or hybridizations.
     68    @see MeasuredBioMaterialData#getParent()
     69    @since 2.9
     70    @hibernate.set inverse="true" lazy="true"
     71    @hibernate.collection-key column="`parent_id`"
     72    @hibernate.collection-one-to-many class="net.sf.basedb.core.data.MeasuredBioMaterialData"
     73  */
     74  Set<MeasuredBioMaterialData> getChildren()
     75  {
     76    return children;
     77  }
     78  void setChildren(Set<MeasuredBioMaterialData> children)
     79  {
     80    this.children = children;
     81  }
    6282
    6383}
  • trunk/src/core/net/sf/basedb/core/data/BioMaterialEventData.java

    r4517 r4613  
    2626import java.util.Map;
    2727import java.util.HashMap;
     28import java.util.Set;
    2829
    2930/**
     
    210211  }
    211212 
     213  private Set<MeasuredBioMaterialData> sourceBioMaterials;
     214  /**
     215    This is the inverse end. The children is the non-pooled biomaterials
     216    that has this item as a parent.
     217    @see MeasuredBioMaterialData#getParent()
     218    @since 2.9
     219    @hibernate.set table="`BioMaterialEventSources`" inverse="true" lazy="true"
     220    @hibernate.collection-key column="`event_id`"
     221    @hibernate.collection-many-to-many column="`biomaterial_id`" class="net.sf.basedb.core.data.MeasuredBioMaterialData"
     222  */
     223  Set<MeasuredBioMaterialData> getSourceBioMaterials()
     224  {
     225    return sourceBioMaterials;
     226  }
     227  void setSourceBioMaterials(Set<MeasuredBioMaterialData> sourceBioMaterials)
     228  {
     229    this.sourceBioMaterials = sourceBioMaterials;
     230  }
    212231
    213232}
  • trunk/www/biomaterials/biosources/list_biosources.jsp

    r4596 r4613  
    251251        id="samples"
    252252        title="Samples"
     253        property="&children(name)"
     254        datatype="string"
     255        filterable="true"
    253256      />
    254257      <tbl:columndef
  • trunk/www/biomaterials/extracts/list_extracts.jsp

    r4596 r4613  
    322322        id="parents"
    323323        title="Parents"
     324        property="&creationEvent.sourceBioMaterials(name)"
     325        datatype="string"
     326        filterable="true"
    324327      />
    325328      <tbl:columndef
    326329        id="labeledextracts"
    327330        title="Labeled extracts"
     331        property="&children(name)"
     332        datatype="string"
     333        filterable="true"
    328334      />
    329335      <tbl:columndef
  • trunk/www/biomaterials/labeledextracts/list_labeledextracts.jsp

    r4596 r4613  
    330330        id="parents"
    331331        title="Parents"
     332        property="&creationEvent.sourceBioMaterials(name)"
     333        datatype="string"
     334        filterable="true"
    332335      />
    333336      <tbl:columndef
    334337        id="hybridizations"
    335338        title="Hybridizations"
     339        property="&sourceEvents(event.hybridization.name)"
     340        datatype="string"
     341        filterable="true"
    336342      />
    337343      <tbl:columndef
  • trunk/www/biomaterials/samples/list_samples.jsp

    r4596 r4613  
    321321      />
    322322      <tbl:columndef
     323        id="bioSource"
     324        title="Biosource"
     325        property="parent.name"
     326        datatype="string"
     327        sortable="true"
     328        filterable="true"
     329        exportable="true"
     330      />
     331      <tbl:columndef
    323332        id="parents"
    324333        title="Parents"
     334        property="&creationEvent.sourceBioMaterials(name)"
     335        datatype="string"
     336        filterable="true"
    325337      />
    326338      <tbl:columndef
    327339        id="extracts"
    328340        title="Extracts"
     341        property="&children(name)"
     342        datatype="string"
     343        filterable="true"
    329344      />     
    330345      <tbl:columndef
     
    571586                <tbl:cell column="eventDate" value="<%=creationEvent.getEventDate()%>" />
    572587                <tbl:cell column="entryDate" value="<%=creationEvent.getEntryDate()%>" />
     588                <tbl:cell column="bioSource"><base:propertyvalue item="<%=item%>" property="parent"/></tbl:cell>
    573589                <tbl:cell column="parents">
    574590                  <%
    575                   if (!item.isPooled())
    576                   {
    577                   %>
    578                     <base:propertyvalue item="<%=item%>" property="parent"/>
    579                   <%
    580                   }
    581                   else
     591                  if (item.isPooled())
    582592                  {
    583593                    String separator = "";
     
    601611                  }
    602612                  %>
    603                   </tbl:cell>
     613                </tbl:cell>
    604614                <tbl:cell column="extracts">
    605615                  <%
  • trunk/www/views/experiments/index.jsp

    r4587 r4613  
    341341    redirect = "../../common/plugin/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&main_type=OTHER&title=Run+plugin";
    342342  }
     343  else if ("DeleteAllRawData".equals(cmd))
     344  {
     345    dc = sc.newDbControl();
     346    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     347    Experiment exp = Experiment.getById(dc, cc.getId());
     348    List<RawBioAssay> all = new ArrayList<RawBioAssay>(exp.getRawBioAssays().list(dc));
     349    for (RawBioAssay rba : all)
     350    {
     351      exp.removeRawBioAssay(rba);
     352    }
     353    dc.commit();
     354   
     355    dc = sc.newDbControl();
     356    for (RawBioAssay rba : all)
     357    {
     358      rba = RawBioAssay.getById(dc, rba.getId());
     359      rba.deleteRawData();
     360    }
     361    dc.commit();
     362   
     363    dc = sc.newDbControl();
     364    exp = Experiment.getById(dc, cc.getId());
     365    for (RawBioAssay rba : all)
     366    {
     367      exp.addRawBioAssay(rba);
     368    }
     369    dc.commit();
     370    redirect = viewPage;
     371  }
    343372  else
    344373  {
  • trunk/www/views/experiments/view_experiment.jsp

    r4578 r4613  
    148148      location.href = '<%=root%>/analyze/index.jsp?ID=<%=ID%>&experiment_id=<%=itemId%>';
    149149    }
     150    function deleteAllRaw()
     151    {
     152      location.href = 'index.jsp?ID=<%=ID%>&cmd=DeleteAllRawData&item_id=<%=itemId%>';
     153    }
    150154    function viewBioAssaySets()
    151155    {
     
    271275        title="Help&hellip;"
    272276        tooltip="Get help about this page"
     277      />
     278      <tbl:button
     279        onclick="deleteAllRaw()"
     280        title="Delete all raw data"
    273281      />
    274282      </tbl:toolbar>
  • trunk/www/views/hybridizations/list_hybridizations.jsp

    r4596 r4613  
    266266        id="labeledExtracts"
    267267        title="Labeled extracts"
     268        property="&creationEvent.sourceBioMaterials(name)"
     269        datatype="string"
     270        filterable="true"
    268271      />
    269272      <tbl:columndef
     
    279282        id="scans"
    280283        title="Scans"
     284        property="&scans(name)"
     285        datatype="string"
     286        filterable="true"
    281287      />
    282288      <tbl:columndef
  • trunk/www/views/scans/list_scans.jsp

    r4596 r4613  
    270270        id="rawBioAssays"
    271271        title="Raw bioassays"
     272        property="&rawBioAssays(name)"
     273        datatype="string"
     274        filterable="true"
    272275      />
    273276      <tbl:columndef
Note: See TracChangeset for help on using the changeset viewer.