Changeset 4901


Ignore:
Timestamp:
Apr 23, 2009, 3:57:52 PM (13 years ago)
Author:
Martin Svensson
Message:

References #1128 Updated list-pages and index-pages for the majority of items that have some kind of child or parent connections. Also extended the NameableFormatter? to handle null as a parameter value.

Location:
trunk
Files:
21 edited

Legend:

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

    r4900 r4901  
    5151    {
    5252      Metadata metadata = Metadata.getInstance(item.getType().getDataClass());
    53       parents = metadata.getPropertyValue(dc, item, exportedProperty.name);
     53      try
     54      {
     55        parents = metadata.getPropertyValue(dc, item, exportedProperty.name);
     56      }
     57      catch(Throwable e)
     58      {
     59        return null;
     60      }
    5461    }
    5562    return parents;
  • trunk/src/clients/web/net/sf/basedb/clients/web/plugins/SimpleExport.java

    r4898 r4901  
    252252      Annotatable.class.isAssignableFrom(itemType.getItemClass());
    253253    MultiFormatter defaultFormatter = new MultiFormatter(new ToStringFormatter<Object>(), true);
    254     defaultFormatter.registerFormatter(Date.class, FormatterFactory.getDateFormatter(sc));
    255     DataLoader dataloader = null;
     254    defaultFormatter.registerFormatter(Date.class, FormatterFactory.getDateFormatter(sc));   
    256255    for (String column : columns)
    257256    {
    258257      Formatter<?> formatter = defaultFormatter;
     258      DataLoader dataloader = null;
    259259      int splitAt = column.indexOf(":");
    260260      if (splitAt >= 0)
  • trunk/src/core/net/sf/basedb/util/formatter/NameableFormatter.java

    r4900 r4901  
    3737  public String format(Nameable nameableItem)
    3838  {   
    39     return nameableItem.getName();
     39    return nameableItem == null ? "" : nameableItem.getName();
    4040  }
    4141
  • trunk/www/biomaterials/biosources/index.jsp

    r4889 r4901  
    3838  import="net.sf.basedb.core.PermissionDeniedException"
    3939  import="net.sf.basedb.core.ItemAlreadyExistsException"
     40  import="net.sf.basedb.core.Sample"
     41  import="net.sf.basedb.core.query.Hql"
     42  import="net.sf.basedb.core.query.Orders"
     43  import="net.sf.basedb.core.query.Restrictions"
     44  import="net.sf.basedb.core.query.Expressions"
    4045  import="net.sf.basedb.util.RemovableUtil"
    4146  import="net.sf.basedb.util.ShareableUtil"
    4247  import="net.sf.basedb.util.OwnableUtil"
     48  import="net.sf.basedb.util.formatter.NameableFormatter"
    4349  import="net.sf.basedb.clients.web.Base"
    4450  import="net.sf.basedb.clients.web.WebException"
    4551  import="net.sf.basedb.util.Values"
    46   import="net.sf.basedb.clients.web.util.HTML"
     52  import="net.sf.basedb.clients.web.plugins.ItemQueryLoader"
     53  import="net.sf.basedb.clients.web.util.HTML" 
    4754  import="java.util.Enumeration"
    4855  import="java.util.Set"
     
    5663  private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,samples,description");
    5764  private static final Item itemType = Item.BIOSOURCE;
     65 
     66  private static void registerExportUtils(ItemContext cc)
     67  {
     68    // Register formatters
     69    cc.setObject("export.formatter.&children(name)", new NameableFormatter());
     70       
     71    // Register dataloaders
     72    String bioSourceParameter = "bioSource";
     73    final ItemQuery<Sample> sampleQuery = Sample.getQuery();
     74    sampleQuery.include(cc.getInclude());
     75    sampleQuery.restrict(Restrictions.eq(Hql.property("parent"), Expressions.parameter(bioSourceParameter)));
     76    sampleQuery.order(Orders.asc(Hql.property("name")));
     77    cc.setObject("export.dataloader.&children(name)", new ItemQueryLoader(sampleQuery, bioSourceParameter));
     78  }
    5879%>
    5980<%
     
    241262    // Run an export plugin in a list context
    242263    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     264    registerExportUtils(cc);
    243265    final ItemQuery<BioSource> query = BioSource.getQuery();
    244266    cc.configureQuery(query, true);
     
    250272    // Run an export plugin in single-item context
    251273    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     274    registerExportUtils(cc);
    252275    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+biosource";
    253276  }
  • trunk/www/biomaterials/biosources/list_biosources.jsp

    r4889 r4901  
    279279        datatype="string"
    280280        filterable="true"
     281        exportable="true"
    281282      />
    282283      <tbl:columndef
  • trunk/www/biomaterials/labeledextracts/index.jsp

    r4889 r4901  
    3838  import="net.sf.basedb.core.ItemResultIterator"
    3939  import="net.sf.basedb.core.Permission"
     40  import="net.sf.basedb.core.Hybridization"
    4041  import="net.sf.basedb.core.ItemContext"
    4142  import="net.sf.basedb.core.MultiPermissions"
     
    4344  import="net.sf.basedb.core.PermissionDeniedException"
    4445  import="net.sf.basedb.core.ItemAlreadyExistsException"
     46  import="net.sf.basedb.core.query.Hql"
     47  import="net.sf.basedb.core.query.Orders"
     48  import="net.sf.basedb.core.query.Restrictions"
     49  import="net.sf.basedb.core.query.Expressions"
    4550  import="net.sf.basedb.util.RemovableUtil"
    4651  import="net.sf.basedb.util.ShareableUtil"
     
    4954  import="net.sf.basedb.clients.web.WebException"
    5055  import="net.sf.basedb.util.Values"
     56  import="net.sf.basedb.clients.web.plugins.ItemQueryLoader"
     57  import="net.sf.basedb.clients.web.plugins.ParentBioMaterialLoader" 
    5158  import="net.sf.basedb.clients.web.util.HTML"
    5259  import="net.sf.basedb.util.formatter.Formatter"
     60  import="net.sf.basedb.util.formatter.NameableFormatter"
    5361  import="net.sf.basedb.util.formatter.WellCoordinateFormatter"
    5462  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
     
    6674  private static final Item itemType = Item.LABELEDEXTRACT;
    6775 
    68   private static void registerExportFormatters(ItemContext cc)
    69   {
     76  private static void registerExportUtils(ItemContext cc)
     77  {
     78    // Register formatters
    7079    cc.setObject("export.formatter.bioWell.row", new WellCoordinateFormatter(true));
    7180    cc.setObject("export.formatter.bioWell.column", new WellCoordinateFormatter(false));
     81    cc.setObject("export.formatter.&creationEvent.sourceBioMaterials(name)", new NameableFormatter());
     82    cc.setObject("export.formatter.&sourceEvents(event.hybridization.name)", new NameableFormatter());
     83   
     84    // Register dataloaders
     85    String lblExtractParameter = "labeledExtract";
     86    ItemQuery<Hybridization> query = Hybridization.getQuery();
     87    query.join(Hql.innerJoin("creationEvent.sources", Item.LABELEDEXTRACT.getAlias()));
     88    query.include(cc.getInclude());   
     89    query.restrict(Restrictions.eq(Hql.index(Item.LABELEDEXTRACT.getAlias(), null), Expressions.parameter(lblExtractParameter)));
     90    query.order(Orders.asc(Hql.property("name")));
     91    cc.setObject("export.dataloader.&sourceEvents(event.hybridization.name)", new ItemQueryLoader(query, lblExtractParameter));
     92    cc.setObject("export.dataloader.&creationEvent.sourceBioMaterials(name)", new ParentBioMaterialLoader());   
    7293  }
    7394%>
     
    342363    final ItemQuery<LabeledExtract> query = LabeledExtract.getQuery();
    343364    cc.configureQuery(query, true);
    344     registerExportFormatters(cc);
     365    registerExportUtils(cc);
    345366    cc.setQuery(query);
    346367    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+labeled+extracts";
     
    350371    // Run an export plugin in single-item context
    351372    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
    352     registerExportFormatters(cc);
     373    registerExportUtils(cc);
    353374    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+labeled+extract";
    354375  }
  • trunk/www/biomaterials/labeledextracts/list_labeledextracts.jsp

    r4889 r4901  
    365365        datatype="string"
    366366        filterable="true"
     367        exportable="true"
    367368      />
    368369      <tbl:columndef
     
    372373        datatype="string"
    373374        filterable="true"
     375        exportable="true"
    374376      />
    375377      <tbl:columndef
  • trunk/www/biomaterials/samples/index.jsp

    r4889 r4901  
    3333  import="net.sf.basedb.core.BioMaterialEvent"
    3434  import="net.sf.basedb.core.BioWell"
     35  import="net.sf.basedb.core.Extract"
    3536  import="net.sf.basedb.core.Protocol"
    3637  import="net.sf.basedb.core.ItemQuery"
     
    4243  import="net.sf.basedb.core.PermissionDeniedException"
    4344  import="net.sf.basedb.core.ItemAlreadyExistsException"
     45  import="net.sf.basedb.core.query.Hql"
     46  import="net.sf.basedb.core.query.Orders"
     47  import="net.sf.basedb.core.query.Restrictions"
     48  import="net.sf.basedb.core.query.Expressions"
    4449  import="net.sf.basedb.util.RemovableUtil"
    4550  import="net.sf.basedb.util.ShareableUtil"
     
    4853  import="net.sf.basedb.clients.web.WebException"
    4954  import="net.sf.basedb.util.Values"
     55  import="net.sf.basedb.clients.web.plugins.ParentBioMaterialLoader"
     56  import="net.sf.basedb.clients.web.plugins.ItemQueryLoader"
    5057  import="net.sf.basedb.clients.web.util.HTML"
    5158  import="net.sf.basedb.util.formatter.Formatter"
    5259  import="net.sf.basedb.util.formatter.WellCoordinateFormatter"
     60  import="net.sf.basedb.util.formatter.NameableFormatter"
    5361  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
    5462  import="java.util.Enumeration"
     
    6573  private static final Item itemType = Item.SAMPLE;
    6674 
    67   private static void registerExportFormatters(ItemContext cc)
    68   {
     75  private static void registerExportUtils(ItemContext cc)
     76  {
     77    // Register formatters
    6978    cc.setObject("export.formatter.bioWell.row", new WellCoordinateFormatter(true));
    7079    cc.setObject("export.formatter.bioWell.column", new WellCoordinateFormatter(false));
     80    cc.setObject("export.formatter.&creationEvent.sourceBioMaterials(name)", new NameableFormatter());
     81    cc.setObject("export.formatter.&children(name)", new NameableFormatter());
     82   
     83    // Register dataloaders
     84    String sampleParameter = "samples";
     85    ItemQuery<Extract> extractQuery = Extract.getQuery();
     86    extractQuery.include(cc.getInclude());
     87    extractQuery.restrict(Restrictions.eq(Hql.property("parent"), Expressions.parameter(sampleParameter)));
     88    extractQuery.order(Orders.asc(Hql.property("name")));
     89    cc.setObject("export.dataloader.&children(name)", new ItemQueryLoader(extractQuery, sampleParameter));
     90    cc.setObject("export.dataloader.&creationEvent.sourceBioMaterials(name)", new ParentBioMaterialLoader());
    7191  }
    7292%>
     
    328348    final ItemQuery<Sample> query = Sample.getQuery();
    329349    cc.configureQuery(query, true);
    330     registerExportFormatters(cc);
     350    registerExportUtils(cc);
    331351    cc.setQuery(query);
    332352    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+samples";
     
    336356    // Run an export plugin in single-item context
    337357    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
    338     registerExportFormatters(cc);
     358    registerExportUtils(cc);
    339359    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+sample";
    340360  }
  • trunk/www/biomaterials/samples/list_samples.jsp

    r4889 r4901  
    366366        datatype="string"
    367367        filterable="true"
     368        exportable="true"
    368369      />
    369370      <tbl:columndef
     
    373374        datatype="string"
    374375        filterable="true"
     376        exportable="true"
    375377      />
    376378      <tbl:columndef
  • trunk/www/lims/arraydesigns/index.jsp

    r4889 r4901  
    3030  import="net.sf.basedb.core.Item"
    3131  import="net.sf.basedb.core.Include"
     32  import="net.sf.basedb.core.ArrayBatch"
    3233  import="net.sf.basedb.core.ArrayDesign"
    3334  import="net.sf.basedb.core.Affymetrix"
     
    4849  import="net.sf.basedb.core.PermissionDeniedException"
    4950  import="net.sf.basedb.core.ItemAlreadyExistsException"
     51  import="net.sf.basedb.core.query.Expressions"
     52  import="net.sf.basedb.core.query.Hql"
     53  import="net.sf.basedb.core.query.Orders"
     54  import="net.sf.basedb.core.query.Restrictions"
    5055  import="net.sf.basedb.util.RemovableUtil"
    5156  import="net.sf.basedb.util.ShareableUtil"
    5257  import="net.sf.basedb.util.OwnableUtil"
     58  import="net.sf.basedb.util.formatter.NameableFormatter"
    5359  import="net.sf.basedb.clients.web.Base"
    5460  import="net.sf.basedb.clients.web.WebException"
    5561  import="net.sf.basedb.util.Values"
     62  import="net.sf.basedb.clients.web.plugins.ItemQueryLoader"
    5663  import="net.sf.basedb.clients.web.util.HTML"
    5764  import="java.util.Enumeration"
     
    6673  private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,platform,numDbFeatures,numFileFeatures,description");
    6774  private static final Item itemType = Item.ARRAYDESIGN;
     75 
     76  private static void registerExportUtils(ItemContext cc)
     77  {
     78    // Register formatters
     79    cc.setObject("export.formatter.&arrayBatches(name)", new NameableFormatter());
     80   
     81    // Register dataloaders
     82    String designParameter = "arrayDesign";
     83    ItemQuery<ArrayBatch> batchQuery = ArrayBatch.getQuery();
     84    batchQuery.include(cc.getInclude());
     85    batchQuery.restrict(Restrictions.eq(Hql.property("arrayDesign"), Expressions.parameter(designParameter)));
     86    batchQuery.order(Orders.asc(Hql.property("name")));
     87    cc.setObject("export.dataloader.&arrayBatches(name)", new ItemQueryLoader(batchQuery, designParameter));
     88  }
    6889%>
    6990<%
     
    283304    cc.configureQuery(query, true);
    284305    cc.setQuery(query);
     306    registerExportUtils(cc);
    285307    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+array+designs";
    286308  }
     
    289311    // Run an export plugin in single-item context
    290312    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     313    registerExportUtils(cc);
    291314    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+array+design";
    292315  }
  • trunk/www/lims/arraydesigns/list_designs.jsp

    r4889 r4901  
    396396        datatype="string"
    397397        filterable="true"
     398        exportable="true"
    398399      />
    399400      <tbl:columndef
  • trunk/www/lims/geometries/index.jsp

    r4889 r4901  
    3636  import="net.sf.basedb.core.MultiPermissions"
    3737  import="net.sf.basedb.core.PermissionDeniedException"
     38  import="net.sf.basedb.core.PlateType"
    3839  import="net.sf.basedb.core.ItemAlreadyExistsException"
     40  import="net.sf.basedb.core.query.Hql"
     41  import="net.sf.basedb.core.query.Expressions"
     42  import="net.sf.basedb.core.query.Orders"
     43  import="net.sf.basedb.core.query.Restrictions"
     44  import="net.sf.basedb.util.formatter.NameableFormatter"
    3945  import="net.sf.basedb.util.RemovableUtil"
     46  import="net.sf.basedb.util.Values"
    4047  import="net.sf.basedb.clients.web.Base"
    41   import="net.sf.basedb.clients.web.WebException"
    42   import="net.sf.basedb.util.Values"
     48  import="net.sf.basedb.clients.web.WebException" 
     49  import="net.sf.basedb.clients.web.plugins.ItemQueryLoader"
    4350  import="net.sf.basedb.clients.web.util.HTML"
    4451  import="java.util.Enumeration"
     
    5360  private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,rows,columns,plateTypes,description");
    5461  private static final Item itemType = Item.PLATEGEOMETRY;
     62 
     63  private static void registerExportUtils(ItemContext cc)
     64  {
     65    // Register formatters
     66    cc.setObject("export.formatter.&plateTypes(name)", new NameableFormatter());
     67   
     68    // Register dataloaders
     69    String geometryParameter = "geometry";
     70    ItemQuery<PlateType> plateTypeQuery = PlateType.getQuery();
     71    plateTypeQuery.include(cc.getInclude());
     72    plateTypeQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
     73    plateTypeQuery.restrict(Restrictions.eq(Hql.property("plateGeometry"), Expressions.parameter(geometryParameter)));
     74    plateTypeQuery.order(Orders.asc(Hql.property("name")));
     75    cc.setObject("export.dataloader.&plateTypes(name)", new ItemQueryLoader(plateTypeQuery, geometryParameter));
     76  }
    5577%>
    5678<%
     
    197219    cc.configureQuery(query, true);
    198220    cc.setQuery(query);
     221    registerExportUtils(cc);
    199222    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+array+designs";
    200223  }
     
    203226    // Run an export plugin in single-item context
    204227    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     228    registerExportUtils(cc);
    205229    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+array+design";
    206230  }
  • trunk/www/lims/geometries/list_geometries.jsp

    r4889 r4901  
    264264        datatype="string"
    265265        filterable="true"
     266        exportable="true"
    266267      />
    267268      <tbl:columndef
  • trunk/www/lims/platetypes/index.jsp

    r4889 r4901  
    3838  import="net.sf.basedb.core.OwnedItem"
    3939  import="net.sf.basedb.core.PermissionDeniedException"
     40  import="net.sf.basedb.core.Plate"
    4041  import="net.sf.basedb.core.ItemAlreadyExistsException"
     42  import="net.sf.basedb.core.query.Expressions"
     43  import="net.sf.basedb.core.query.Hql"
     44  import="net.sf.basedb.core.query.Orders"
     45  import="net.sf.basedb.core.query.Restrictions"
    4146  import="net.sf.basedb.util.RemovableUtil"
    4247  import="net.sf.basedb.util.ShareableUtil"
    43   import="net.sf.basedb.util.OwnableUtil"
     48  import="net.sf.basedb.util.OwnableUtil"
     49  import="net.sf.basedb.util.formatter.NameableFormatter"
     50  import="net.sf.basedb.util.Values"
    4451  import="net.sf.basedb.clients.web.Base"
    4552  import="net.sf.basedb.clients.web.WebException"
    46   import="net.sf.basedb.util.Values"
     53  import="net.sf.basedb.clients.web.plugins.ItemQueryLoader"
    4754  import="net.sf.basedb.clients.web.util.HTML"
    4855  import="java.util.Enumeration"
     
    5764  private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,geometry,plates,description");
    5865  private static final Item itemType = Item.PLATETYPE;
     66 
     67  private static void registerExportUtils(ItemContext cc)
     68  {
     69    // Register formatters
     70    cc.setObject("export.formatter.&plates(name)", new NameableFormatter());
     71   
     72    // Register dataloaders
     73    String plateTypeParameter = "plateType";
     74    ItemQuery<Plate> plateQuery = Plate.getQuery();
     75    plateQuery.include(cc.getInclude());
     76    plateQuery.restrict(Restrictions.eq(Hql.property("plateType"), Expressions.parameter(plateTypeParameter)));
     77    plateQuery.order(Orders.asc(Hql.property("name")));
     78    cc.setObject("export.dataloader.&plates(name)", new ItemQueryLoader(plateQuery, plateTypeParameter));
     79  }
    5980%>
    6081<%
     
    246267    cc.configureQuery(query, true);
    247268    cc.setQuery(query);
     269    registerExportUtils(cc);
    248270    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+array+designs";
    249271  }
     
    252274    // Run an export plugin in single-item context
    253275    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     276    registerExportUtils(cc);
    254277    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+array+design";
    255278  }
  • trunk/www/lims/platetypes/list_platetypes.jsp

    r4889 r4901  
    282282        datatype="string"
    283283        filterable="true"
     284        exportable="true"
    284285      />
    285286      <tbl:columndef
  • trunk/www/views/hybridizations/index.jsp

    r4889 r4901  
    4343  import="net.sf.basedb.core.PermissionDeniedException"
    4444  import="net.sf.basedb.core.ItemAlreadyExistsException"
     45  import="net.sf.basedb.core.Scan"
     46  import="net.sf.basedb.core.query.Hql"
     47  import="net.sf.basedb.core.query.Orders"
     48  import="net.sf.basedb.core.query.Restrictions"
     49  import="net.sf.basedb.core.query.Expressions"
    4550  import="net.sf.basedb.util.RemovableUtil"
    4651  import="net.sf.basedb.util.ShareableUtil"
     
    5156  import="net.sf.basedb.clients.web.util.HTML"
    5257  import="net.sf.basedb.util.formatter.Formatter"
     58  import="net.sf.basedb.util.formatter.NameableFormatter"
    5359  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
     60  import="net.sf.basedb.clients.web.plugins.ItemQueryLoader"
    5461  import="java.util.Enumeration"
    5562  import="java.util.Set"
     
    6471  private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,labeledExtracts,arraySlide,scans,description");
    6572  private static final Item itemType = Item.HYBRIDIZATION;
     73 
     74  private static void registerExportUtils(ItemContext cc)
     75  {
     76    // Register formatters
     77    cc.setObject("export.formatter.&creationEvent.sourceBioMaterials(name)", new NameableFormatter());
     78    cc.setObject("export.formatter.&scans(name)", new NameableFormatter());
     79   
     80    // Register dataloaders
     81    String hybridizationParameter = "hybridization";
     82    ItemQuery<LabeledExtract> labeledExtractQuery = LabeledExtract.getQuery();   
     83    labeledExtractQuery.include(cc.getInclude());
     84    labeledExtractQuery.join(Hql.innerJoin("sourceEvents", "srcevt"));
     85    labeledExtractQuery.join(Hql.innerJoin("srcevt", "event", "evt"));
     86    labeledExtractQuery.restrict(Restrictions.eq(Hql.property("evt", "hybridization"), Expressions.parameter(hybridizationParameter)));
     87    labeledExtractQuery.order(Orders.asc(Hql.property("name")));
     88    cc.setObject("export.dataloader.&creationEvent.sourceBioMaterials(name)", new ItemQueryLoader(labeledExtractQuery, hybridizationParameter));
     89   
     90    ItemQuery<Scan> scanQuery = Scan.getQuery();
     91    scanQuery.include(cc.getInclude());
     92    scanQuery.restrict(Restrictions.eq(Hql.property("hybridization"), Expressions.parameter(hybridizationParameter)));
     93    scanQuery.order(Orders.asc(Hql.property("name")));
     94    cc.setObject("export.dataloader.&scans(name)", new ItemQueryLoader(scanQuery, hybridizationParameter));
     95  }
    6696%>
    6797<%
     
    302332    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
    303333    final ItemQuery<Hybridization> query = Hybridization.getQuery();
     334    registerExportUtils(cc);
    304335    cc.configureQuery(query, true);
    305336    cc.setQuery(query);
     
    310341    // Run an export plugin in single-item context
    311342    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     343    registerExportUtils(cc);
    312344    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+hybridization";
    313345  }
  • trunk/www/views/hybridizations/list_hybridizations.jsp

    r4889 r4901  
    279279        datatype="string"
    280280        filterable="true"
     281        exportable="true"
    281282      />
    282283      <tbl:columndef
     
    295296        datatype="string"
    296297        filterable="true"
     298        exportable="true"
    297299      />
    298300      <tbl:columndef
  • trunk/www/views/rawbioassays/index.jsp

    r4889 r4901  
    3838  import="net.sf.basedb.core.Software"
    3939  import="net.sf.basedb.core.ArrayDesign"
     40  import="net.sf.basedb.core.Experiment"
    4041  import="net.sf.basedb.core.File"
    4142  import="net.sf.basedb.core.FileType"
     
    6364  import="net.sf.basedb.core.ItemParameterType"
    6465  import="net.sf.basedb.core.BooleanParameterType"
     66  import="net.sf.basedb.core.query.Hql"
     67  import="net.sf.basedb.core.query.Orders"
     68  import="net.sf.basedb.core.query.Restrictions"
     69  import="net.sf.basedb.core.query.Expressions"
    6570  import="net.sf.basedb.util.RemovableUtil"
    6671  import="net.sf.basedb.util.ShareableUtil"
     
    6974  import="net.sf.basedb.clients.web.WebException"
    7075  import="net.sf.basedb.util.Values"
    71   import="net.sf.basedb.clients.web.util.HTML"
     76  import="net.sf.basedb.util.formatter.NameableFormatter"
     77  import="net.sf.basedb.clients.web.plugins.ItemQueryLoader"
     78  import="net.sf.basedb.clients.web.util.HTML" 
    7279  import="java.util.Enumeration"
    7380  import="java.util.Set"
     
    8289  private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,platform,variant,hasData,description");
    8390  private static final Item itemType = Item.RAWBIOASSAY;
     91 
     92  private static void registerExportUtils(ItemContext cc)
     93  {
     94    // Register formatters
     95    cc.setObject("export.formatter.&experiments(name)", new NameableFormatter());
     96   
     97    // Register dataloaders
     98    String rawParameter = "rawBioAssay";
     99    final ItemQuery<Experiment> experimentQuery = Experiment.getQuery();
     100    experimentQuery.include(cc.getInclude());
     101    experimentQuery.join(Hql.innerJoin("rawBioAssays", "rba"));
     102    experimentQuery.restrict(Restrictions.eq(Hql.alias("rba"), Expressions.parameter(rawParameter)));
     103    experimentQuery.order(Orders.asc(Hql.property("name")));
     104    cc.setObject("export.dataloader.&experiments(name)", new ItemQueryLoader(experimentQuery, rawParameter));
     105  }
    84106 
    85107  private static class UpdateArrayDesign
     
    435457    cc.configureQuery(query, true);
    436458    cc.setQuery(query);
     459    registerExportUtils(cc);
    437460    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+raw+bioassays";
    438461  }
     
    441464    // Run an export plugin in single-item context
    442465    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     466    registerExportUtils(cc);
    443467    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+raw+bioassay";
    444468  }
  • trunk/www/views/rawbioassays/list_rawbioassays.jsp

    r4889 r4901  
    454454        datatype="string"
    455455        filterable="true"
     456        exportable="true"
    456457      />
    457458      <tbl:columndef
  • trunk/www/views/scans/index.jsp

    r4889 r4901  
    4141  import="net.sf.basedb.core.PermissionDeniedException"
    4242  import="net.sf.basedb.core.ItemAlreadyExistsException"
     43  import="net.sf.basedb.core.RawBioAssay"
     44  import="net.sf.basedb.core.query.Hql"
     45  import="net.sf.basedb.core.query.Orders"
     46  import="net.sf.basedb.core.query.Restrictions"
     47  import="net.sf.basedb.core.query.Expressions"
    4348  import="net.sf.basedb.util.RemovableUtil"
    4449  import="net.sf.basedb.util.ShareableUtil"
     
    4651  import="net.sf.basedb.clients.web.Base"
    4752  import="net.sf.basedb.clients.web.WebException"
     53  import="net.sf.basedb.util.formatter.NameableFormatter"
    4854  import="net.sf.basedb.util.Values"
     55  import="net.sf.basedb.clients.web.plugins.ItemQueryLoader"
    4956  import="net.sf.basedb.clients.web.util.HTML"
    5057  import="java.util.Enumeration"
     
    5966  private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,hybridization,rawBioAssays,description");
    6067  private static final Item itemType = Item.SCAN;
     68 
     69  private static void registerExportUtils(ItemContext cc)
     70  {
     71    // Register formatters
     72    cc.setObject("export.formatter.&rawBioAssays(name)", new NameableFormatter());
     73   
     74    // Register dataloaders
     75    String scanParameter = "scan";
     76    ItemQuery<RawBioAssay> rawQuery = RawBioAssay.getQuery();
     77    rawQuery.include(cc.getInclude());
     78    rawQuery.restrict(Restrictions.eq(Hql.property("scan"), Expressions.parameter(scanParameter)));
     79    rawQuery.order(Orders.asc(Hql.property("name")));
     80    cc.setObject("export.dataloader.&rawBioAssays(name)", new ItemQueryLoader(rawQuery, scanParameter));
     81  }
    6182%>
    6283<%
     
    266287    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
    267288    final ItemQuery<Scan> query = Scan.getQuery();
     289    registerExportUtils(cc);
    268290    cc.configureQuery(query, true);
    269291    cc.setQuery(query);
     
    274296    // Run an export plugin in single-item context
    275297    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     298    registerExportUtils(cc);
    276299    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+scan";
    277300  }
  • trunk/www/views/scans/list_scans.jsp

    r4889 r4901  
    296296        datatype="string"
    297297        filterable="true"
     298        exportable="true"
    298299      />
    299300      <tbl:columndef
Note: See TracChangeset for help on using the changeset viewer.