Changeset 5685
- Timestamp:
- Aug 4, 2011, 12:58:23 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 deleted
- 41 edited
- 3 copied
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/clients/web/net/sf/basedb/clients/web/PermissionUtil.java
r5652 r5685 198 198 Item.BIOSOURCE, Item.SAMPLE, Item.EXTRACT, Item.TAG, 199 199 Item.BIOMATERIALLIST, Item.BIOPLATE, Item.BIOPLATETYPE, Item.BIOPLATEEVENT, Item.BIOPLATEEVENTTYPE, 200 Item.PHYSICALBIOASSAY, Item.DERIVEDBIOASSAY SET, Item.RAWBIOASSAY, Item.EXPERIMENT, Item.FORMULA200 Item.PHYSICALBIOASSAY, Item.DERIVEDBIOASSAY, Item.RAWBIOASSAY, Item.EXPERIMENT, Item.FORMULA 201 201 }) 202 202 ); -
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/edit/EditUtil.java
r5652 r5685 63 63 Item.PLATEGEOMETRY, Item.PLATEMAPPING, 64 64 Item.DIRECTORY, Item.FILE, Item.FILESERVER, Item.PROJECT, Item.PERMISSIONTEMPLATE, 65 Item.PHYSICALBIOASSAY, Item.DERIVEDBIOASSAY SET, Item.RAWBIOASSAY,65 Item.PHYSICALBIOASSAY, Item.DERIVEDBIOASSAY, Item.RAWBIOASSAY, 66 66 Item.FORMULA, Item.REPORTER, Item.REPORTERLIST, 67 67 Item.EXPERIMENT, Item.TRANSFORMATION, Item.BIOASSAYSET, Item.BIOASSAY, -
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/toolbar/ToolbarUtil.java
r5652 r5685 60 60 Item.RAWBIOASSAY, Item.RAWDATA, Item.FORMULA, 61 61 Item.REPORTER, Item.REPORTERLIST, Item.REPORTERSCORE, 62 Item.DERIVEDBIOASSAY SET, Item.PHYSICALBIOASSAY,62 Item.DERIVEDBIOASSAY, Item.PHYSICALBIOASSAY, 63 63 Item.BIOSOURCE, Item.SAMPLE, Item.EXTRACT, 64 64 Item.TAG, Item.BIOMATERIALEVENT, -
trunk/src/clients/web/net/sf/basedb/clients/web/resources/common.properties
r5652 r5685 84 84 item.physicalbioassay Physical bioassay 85 85 item.physicalbioassay+ Physical bioassays 86 item.derivedbioassayset Derived bioassay set87 item.derivedbioassayset+ Derived bioassay sets88 86 item.derivedbioassay Derived bioassay 89 87 item.derivedbioassay+ Derived bioassays -
trunk/src/clients/web/net/sf/basedb/clients/web/resources/menu.properties
r5652 r5685 87 87 physicalbioassays.tooltip.1 Manage physical bioassays 88 88 physicalbioassays.tooltip.0 You do not have permission to manage physical bioassays 89 derivedbioassays.tooltip.1 Manage derived bioassays 90 derivedbioassays.tooltip.0 You do not have permission to manage derived bioassays 89 91 rawbioassays.tooltip.1 Manage raw bioassays 90 92 rawbioassays.tooltip.0 You do not have permission to manage raw bioassays -
trunk/src/core/common-queries.xml
r5663 r5685 855 855 </query> 856 856 857 <query id="GET_DERIVEDBIOASSAY SET_FOR_PROTOCOL" type="HQL">858 <sql> 859 SELECT {1} 860 FROM DerivedBioAssay SetData dbas861 WHERE dba s.protocol = :protocol862 </sql> 863 <description> 864 A Hibernate query that gets derived bioassay sets857 <query id="GET_DERIVEDBIOASSAY_FOR_PROTOCOL" type="HQL"> 858 <sql> 859 SELECT {1} 860 FROM DerivedBioAssayData dba 861 WHERE dba.protocol = :protocol 862 </sql> 863 <description> 864 A Hibernate query that gets derived bioassays 865 865 using a protocol. 866 866 </description> … … 917 917 </query> 918 918 919 <query id="GET_DERIVEDBIOASSAYS ETS_FOR_HARDWARE" type="HQL">919 <query id="GET_DERIVEDBIOASSAYS_FOR_HARDWARE" type="HQL"> 920 920 <sql> 921 921 SELECT {1} 922 FROM DerivedBioAssay SetData dbas923 WHERE dba s.hardware = :hardware922 FROM DerivedBioAssayData dba 923 WHERE dba.hardware = :hardware 924 924 </sql> 925 925 <description> … … 1000 1000 </query> 1001 1001 1002 <query id="GET_DERIVEDBIOASSAYS ETS_FOR_SOFTWARE" type="HQL">1003 <sql> 1004 SELECT {1} 1005 FROM DerivedBioAssay SetData dbas1006 WHERE dba s.software = :software1007 </sql> 1008 <description> 1009 A Hibernate query that gets the derived bioassay sets1002 <query id="GET_DERIVEDBIOASSAYS_FOR_SOFTWARE" type="HQL"> 1003 <sql> 1004 SELECT {1} 1005 FROM DerivedBioAssayData dba 1006 WHERE dba.software = :software 1007 </sql> 1008 <description> 1009 A Hibernate query that gets the derived bioassay 1010 1010 using a given software. 1011 1011 </description> … … 1369 1369 </query> 1370 1370 1371 <query id="GET_ROOT_DERIVEDBIOASSAYS ETS_FOR_PHYSICALBIOASSAY" type="HQL">1372 <sql> 1373 SELECT {1} 1374 FROM DerivedBioAssay SetData dbs1375 WHERE db s.physicalBioAssay = :bioAssay1376 AND db s.parent is null1377 </sql> 1378 <description> 1379 A Hibernate query that gets root derived bioassay sets1380 created f ora specific physical bioassay.1381 </description> 1382 </query> 1383 1384 <query id="GET_RAWBIOASSAYS_FOR_ SCAN" type="HQL">1371 <query id="GET_ROOT_DERIVEDBIOASSAYS_FOR_PHYSICALBIOASSAY" type="HQL"> 1372 <sql> 1373 SELECT {1} 1374 FROM DerivedBioAssayData dba 1375 WHERE dba.physicalBioAssay = :bioAssay 1376 AND dba.parent is null 1377 </sql> 1378 <description> 1379 A Hibernate query that gets root derived bioassays 1380 created from a specific physical bioassay. 1381 </description> 1382 </query> 1383 1384 <query id="GET_RAWBIOASSAYS_FOR_DERIVEDBIOASSAY" type="HQL"> 1385 1385 <sql> 1386 1386 SELECT {1} 1387 1387 FROM RawBioAssayData rba 1388 WHERE rba. scan = :scan1388 WHERE rba.parentBioAssay = :bioAssay 1389 1389 </sql> 1390 1390 <description> 1391 1391 A Hibernate query that gets raw bioassays 1392 created from a specific scan. 1393 </description> 1394 </query> 1395 1396 <query id="GET_IMAGES_FOR_SCAN" type="HQL"> 1397 <sql> 1398 SELECT {1} 1399 FROM ImageData img 1400 WHERE img.scan = :scan 1401 </sql> 1402 <description> 1403 A Hibernate query that gets images 1404 created from a specific scan. 1392 created from a specific derived bioassay. 1405 1393 </description> 1406 1394 </query> -
trunk/src/core/net/sf/basedb/core/DerivedBioAssay.java
r5684 r5685 27 27 import java.util.Set; 28 28 29 import net.sf.basedb.core.data.DerivedBioAssaySetData; 29 import net.sf.basedb.core.data.ArrayBatchData; 30 import net.sf.basedb.core.data.ArraySlideData; 31 import net.sf.basedb.core.data.DerivedBioAssayData; 30 32 import net.sf.basedb.core.data.HardwareData; 33 import net.sf.basedb.core.data.PhysicalBioAssayData; 31 34 import net.sf.basedb.core.data.ProtocolData; 32 35 import net.sf.basedb.core.data.SoftwareData; … … 40 43 @base.modified $Date$ 41 44 */ 42 public class DerivedBioAssay Set43 extends AnnotatedItem<DerivedBioAssay SetData>45 public class DerivedBioAssay 46 extends AnnotatedItem<DerivedBioAssayData> 44 47 implements Registered, FileStoreEnabled, Subtypable 45 48 { … … 47 50 /** 48 51 The type of item represented by this class. 49 @see Item#DERIVEDBIOASSAY SET52 @see Item#DERIVEDBIOASSAY 50 53 @see #getType() 51 54 */ 52 public static final Item TYPE = Item.DERIVEDBIOASSAY SET;53 54 /** 55 The id for the <code>DerivedBioAssay SetType</code> item representing a55 public static final Item TYPE = Item.DERIVEDBIOASSAY; 56 57 /** 58 The id for the <code>DerivedBioAssayType</code> item representing a 56 59 scanned hybridization. 57 60 */ 58 public static final String SCAN = "net.sf.basedb.core.DerivedBioAssay SetType.SCAN";59 60 61 /** 62 The id for the <code>DerivedBioAssay SetType</code> item representing61 public static final String SCAN = "net.sf.basedb.core.DerivedBioAssayType.SCAN"; 62 63 64 /** 65 The id for the <code>DerivedBioAssayType</code> item representing 63 66 original sequenced data. 64 67 */ 65 public static final String SEQUENCED = "net.sf.basedb.core.DerivedBioAssay SetType.SEQUENCED";66 67 /** 68 The id for the <code>DerivedBioAssay SetType</code> item representing68 public static final String SEQUENCED = "net.sf.basedb.core.DerivedBioAssayType.SEQUENCED"; 69 70 /** 71 The id for the <code>DerivedBioAssayType</code> item representing 69 72 sequenced data that has been aligned to a reference database. 70 73 */ 71 public static final String ASSEMBLY = "net.sf.basedb.core.DerivedBioAssay SetType.ASSEMBLY";72 73 74 /** 75 Get a <code>DerivedBioAssay Set</code> item when you know the id.74 public static final String ASSEMBLY = "net.sf.basedb.core.DerivedBioAssayType.ASSEMBLY"; 75 76 77 /** 78 Get a <code>DerivedBioAssay</code> item when you know the id. 76 79 77 80 @param dc The <code>DbControl</code> which will be used for 78 81 permission checking and database access. 79 82 @param id The id of the item to load 80 @return The <code>DerivedBioAssay Set</code> item83 @return The <code>DerivedBioAssay</code> item 81 84 @throws ItemNotFoundException If an item with the specified 82 85 id is not found … … 85 88 @throws BaseException If there is another error 86 89 */ 87 public static DerivedBioAssay SetgetById(DbControl dc, int id)90 public static DerivedBioAssay getById(DbControl dc, int id) 88 91 throws ItemNotFoundException, PermissionDeniedException, BaseException 89 92 { 90 DerivedBioAssay Set dbas = dc.loadItem(DerivedBioAssaySet.class, id);91 if (dbas == null) throw new ItemNotFoundException("DerivedBioAssay Set[id="+id+"]");93 DerivedBioAssay dbas = dc.loadItem(DerivedBioAssay.class, id); 94 if (dbas == null) throw new ItemNotFoundException("DerivedBioAssay[id="+id+"]"); 92 95 return dbas; 93 96 } 94 97 95 98 /** 96 Create a new (root) derived bioassay set from a physical bioasay.99 Create a new (root) derived bioassay from a physical bioassay. 97 100 @param dc The <code>DbControl</code> which will be used for 98 101 permission checking and database access 99 102 @param bioAssay The parent physical bioassay 100 @return A new DerivedBioAssay Setitem101 */ 102 public static DerivedBioAssay SetgetNew(DbControl dc, PhysicalBioAssay bioAssay)103 @return A new DerivedBioAssay item 104 */ 105 public static DerivedBioAssay getNew(DbControl dc, PhysicalBioAssay bioAssay) 103 106 { 104 107 if (bioAssay == null) throw new InvalidUseOfNullException("bioAssay"); 105 108 bioAssay.checkPermission(Permission.USE); 106 109 107 DerivedBioAssay Set dbas = dc.newItem(DerivedBioAssaySet.class);108 dbas.setName("New derived bioassay set");110 DerivedBioAssay dbas = dc.newItem(DerivedBioAssay.class); 111 dbas.setName("New derived bioassay"); 109 112 dbas.getData().setPhysicalBioAssay(bioAssay.getData()); 110 113 dbas.getData().setEntryDate(new Date()); … … 113 116 114 117 /** 115 Create a new child derived bioassay set from a parent bioassay set.118 Create a new child derived bioassay from a parent derived bioassay. 116 119 @param dc The <code>DbControl</code> which will be used for 117 120 permission checking and database access 118 @param parent The parent bioassay set119 @return A new DerivedBioAssay Setitem120 */ 121 public static DerivedBioAssay Set getNew(DbControl dc, DerivedBioAssaySetparent)121 @param parent The parent bioassay 122 @return A new DerivedBioAssay item 123 */ 124 public static DerivedBioAssay getNew(DbControl dc, DerivedBioAssay parent) 122 125 { 123 126 if (parent == null) throw new InvalidUseOfNullException("parent"); 124 127 parent.checkPermission(Permission.USE); 125 128 126 DerivedBioAssay Set dbas = dc.newItem(DerivedBioAssaySet.class);127 dbas.setName("New derived bioassay set");129 DerivedBioAssay dbas = dc.newItem(DerivedBioAssay.class); 130 dbas.setName("New derived bioassay"); 128 131 dbas.getData().setParent(parent.getData()); 129 132 dbas.getData().setPhysicalBioAssay(parent.getData().getPhysicalBioAssay()); 133 dbas.getData().setExtract(parent.getData().getExtract()); 130 134 dbas.getData().setEntryDate(new Date()); 131 135 return dbas; … … 133 137 134 138 /** 135 Get a query that returns derived bioassay sets.139 Get a query that returns derived bioassay. 136 140 @return An {@link ItemQuery} object 137 141 */ 138 public static ItemQuery<DerivedBioAssay Set> getQuery()139 { 140 return new ItemQuery<DerivedBioAssay Set>(DerivedBioAssaySet.class);141 } 142 143 DerivedBioAssay Set(DerivedBioAssaySetData data)142 public static ItemQuery<DerivedBioAssay> getQuery() 143 { 144 return new ItemQuery<DerivedBioAssay>(DerivedBioAssay.class); 145 } 146 147 DerivedBioAssay(DerivedBioAssayData data) 144 148 { 145 149 super(data); … … 252 256 try 253 257 { 254 DerivedBioAssay Setparent = getParent();258 DerivedBioAssay parent = getParent(); 255 259 if (parent != null) 256 260 { … … 277 281 */ 278 282 @Override 279 @SubtypableRelatedItems({Item.PHYSICALBIOASSAY, Item.DERIVEDBIOASSAY SET, Item.SOFTWARE, Item.HARDWARE, Item.PROTOCOL})283 @SubtypableRelatedItems({Item.PHYSICALBIOASSAY, Item.DERIVEDBIOASSAY, Item.SOFTWARE, Item.HARDWARE, Item.PROTOCOL}) 280 284 public ItemSubtype getItemSubtype() 281 285 { … … 362 366 @return The parent bioassay set or null if this item is a root bioassay set 363 367 */ 364 public DerivedBioAssay SetgetParent()365 { 366 return getDbControl().getItem(DerivedBioAssay Set.class, getData().getParent());368 public DerivedBioAssay getParent() 369 { 370 return getDbControl().getItem(DerivedBioAssay.class, getData().getParent()); 367 371 } 368 372 … … 377 381 } 378 382 379 public ItemQuery<DerivedBioAssaySet> getChildren() 380 { 381 ItemQuery<DerivedBioAssaySet> query = DerivedBioAssaySet.getQuery(); 383 public Extract getExtract() 384 { 385 return getDbControl().getItem(Extract.class, getData().getExtract()); 386 } 387 388 public void setExtract(Extract extract) 389 { 390 checkPermission(Permission.WRITE); 391 if (extract != null) extract.checkPermission(Permission.USE); 392 getData().setExtract(extract == null ? null : extract.getData()); 393 } 394 395 public ItemQuery<DerivedBioAssay> getChildren() 396 { 397 ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery(); 382 398 query.restrictPermanent( 383 399 Restrictions.eq( … … 389 405 } 390 406 391 /**392 Create a new bioassay that is part of the bioassay set. The393 biomaterial is optional. If given, it should be one of the394 biomaterials that was part of the physical bioassay that this395 bioassay set is derived from. It is only possible to create396 one bioassay for each biomaterial.397 398 @param extract The biomaterial this extract is related to399 @return A new child bioassay400 */401 public DerivedBioAssay newBioAssay(Extract extract)402 {403 checkPermission(Permission.WRITE);404 // TODO - Check if the extract is a source to the parent physical bioassay405 406 return DerivedBioAssay.getNew(getDbControl(), this, extract);407 }408 409 public ItemQuery<DerivedBioAssay> getBioAssays()410 {411 ItemQuery<DerivedBioAssay> query = new ItemQuery<DerivedBioAssay>(DerivedBioAssay.class, null);412 query.restrictPermanent(413 Restrictions.eq(414 Hql.property("bioAssaySet"),415 Hql.entity(this)416 )417 );418 return query;419 }420 421 407 public Job getJob() 422 408 { … … 495 481 } 496 482 483 484 public ItemQuery<RawBioAssay> getRawBioAssays() 485 { 486 ItemQuery<RawBioAssay> query = RawBioAssay.getQuery(); 487 query.restrictPermanent( 488 Restrictions.eq( 489 Hql.property("parentBioAssay"), 490 Hql.entity(this) 491 ) 492 ); 493 return query; 494 } 495 496 /** 497 Get the array design connected to this derived bioassay by 498 following the path from the physical bioassay to the array slide to 499 the array batch to the array design. 500 @return The array design, or null if no array design is connected 501 @throws PermissionDeniedException If the logged in user doesn't have 502 read permission for the array design 503 @throws BaseException If there is another error. 504 */ 505 public ArrayDesign getArrayDesign() 506 throws PermissionDeniedException, BaseException 507 { 508 PhysicalBioAssayData pba = getData().getPhysicalBioAssay(); 509 if (pba == null) return null; 510 ArraySlideData slide = pba.getArraySlide(); 511 if (slide == null) return null; 512 ArrayBatchData batch = slide.getArrayBatch(); 513 if (batch == null) return null; 514 return getDbControl().getItem(ArrayDesign.class, batch.getArrayDesign()); 515 } 516 517 /** 518 Counts all raw bioassays that have been created from this bioassay. The count 519 includes raw bioassays that the logged in user doesn't have access to. 520 @return The number of raw bioassays 521 @throws BaseException If the raw bioassays couldn't be counted. 522 */ 523 public long countRawBioAssays() 524 throws BaseException 525 { 526 org.hibernate.Session session = getDbControl().getHibernateSession(); 527 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 528 "GET_RAWBIOASSAYS_FOR_DERIVEDBIOASSAY", "count(*)"); 529 /* 530 SELECT {1} 531 FROM RawBioAssayData rba 532 WHERE rba.parentBioAssay = :bioAssay 533 */ 534 query.setEntity("bioAssay", this.getData()); 535 return HibernateUtil.loadData(Long.class, query); 536 } 537 497 538 } -
trunk/src/core/net/sf/basedb/core/Hardware.java
r5652 r5685 227 227 Check if: 228 228 <ul> 229 <li>a {@link DerivedBioAssay Set} is linked to this hardware229 <li>a {@link DerivedBioAssay} is linked to this hardware 230 230 <li>an {@link ArrayBatch} is linked to this hardware 231 231 <li>a {@link BioMaterialEvent} is linked to this hardware … … 245 245 { 246 246 org.hibernate.Query q = HibernateUtil.getPredefinedQuery(session, 247 "GET_DERIVEDBIOASSAYS ETS_FOR_HARDWARE", "count(*)");248 /* 249 SELECT {1} 250 FROM DerivedBioAssay SetData dbas251 WHERE dba s.hardware = :hardware247 "GET_DERIVEDBIOASSAYS_FOR_HARDWARE", "count(*)"); 248 /* 249 SELECT {1} 250 FROM DerivedBioAssayData dba 251 WHERE dba.hardware = :hardware 252 252 */ 253 253 q.setEntity("hardware", this.getData()); … … 295 295 Get all: 296 296 <ul> 297 <li>{@link DerivedBioAssay Set}:s with this hardware297 <li>{@link DerivedBioAssay}:s with this hardware 298 298 <li>{@link ArrayBatch}:s with this hardware 299 299 <li>{@link BioMaterial}:s and {@link PhysicalBioAssay}:s with this hardware … … 310 310 // Derived bioassay sets 311 311 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 312 "GET_DERIVEDBIOASSAYS ETS_FOR_HARDWARE", "dbas.id");313 /* 314 SELECT {1} 315 FROM DerivedBioAssay SetData dbas316 WHERE dba s.hardware = :hardware312 "GET_DERIVEDBIOASSAYS_FOR_HARDWARE", "dba.id"); 313 /* 314 SELECT {1} 315 FROM DerivedBioAssayData dba 316 WHERE dba.hardware = :hardware 317 317 */ 318 318 query.setEntity("hardware", this.getData()); 319 addUsingItems(using, Item.DERIVEDBIOASSAY SET, query);319 addUsingItems(using, Item.DERIVEDBIOASSAY, query); 320 320 321 321 // Array batches -
trunk/src/core/net/sf/basedb/core/Install.java
r5652 r5685 368 368 // Hybridization, raw data and experiments 369 369 createRoleKey(Item.PHYSICALBIOASSAY, "Physical bioassays", "Gives access to physical bioassays", users_create); 370 createRoleKey(Item.DERIVEDBIOASSAY SET, "Derived bioassay sets", "Gives access to derived bioassay sets", users_create);370 createRoleKey(Item.DERIVEDBIOASSAY, "Derived bioassays", "Gives access to derived bioassays", users_create); 371 371 createRoleKey(Item.RAWBIOASSAY, "Raw bioassays", "Gives access to raw bioassays", users_create); 372 372 createRoleKey(Item.EXPERIMENT, "Experiments", "Gives access to experiments", users_create); … … 491 491 492 492 // Derived bioassay set subtypes 493 createItemSubtype(Item.DERIVEDBIOASSAY SET, DerivedBioAssaySet.SCAN,493 createItemSubtype(Item.DERIVEDBIOASSAY, DerivedBioAssay.SCAN, 494 494 "Scan", "A hybridization that has been scanned to produce one or more images.", 495 495 hybridization, scanner, scanningProtocol); 496 createItemSubtype(Item.DERIVEDBIOASSAY SET, DerivedBioAssaySet.SEQUENCED,496 createItemSubtype(Item.DERIVEDBIOASSAY, DerivedBioAssay.SEQUENCED, 497 497 "Sequenced", "A flow cell that has been sequenced.", 498 498 flowCell, sequencer, sequencingProtocol); 499 createItemSubtype(Item.DERIVEDBIOASSAY SET, DerivedBioAssaySet.ASSEMBLY,499 createItemSubtype(Item.DERIVEDBIOASSAY, DerivedBioAssay.ASSEMBLY, 500 500 "Assembly", "A data set of sequences that has been aligned against a reference database", 501 501 alignmentSoftware); -
trunk/src/core/net/sf/basedb/core/Item.java
r5652 r5685 428 428 429 429 /** 430 The item is a {@link DerivedBioAssay Set}.431 */ 432 DERIVEDBIOASSAY SET(267, "Derived bioassay set", "dbs", DerivedBioAssaySet.class, DerivedBioAssaySetData.class, DefinedPermissions.shareable,430 The item is a {@link DerivedBioAssay}. 431 */ 432 DERIVEDBIOASSAY(267, "Derived bioassay", "dba", DerivedBioAssay.class, DerivedBioAssayData.class, DefinedPermissions.shareable, 433 433 330), 434 434 435 /**436 The item is a {@link DerivedBioAssay}.437 */438 DERIVEDBIOASSAY(268, "Derived bioassay", "dby", DerivedBioAssay.class, DerivedBioAssayData.class, null,439 330),440 441 435 /** 442 436 The item is a {@link RawBioAssay}. -
trunk/src/core/net/sf/basedb/core/PhysicalBioAssay.java
r5657 r5685 258 258 Check that: 259 259 <ul> 260 <li>No {@link DerivedBioAssay Set}:s use the physical bioassay260 <li>No {@link DerivedBioAssay}:s use the physical bioassay 261 261 </ul> 262 262 */ … … 264 264 throws BaseException 265 265 { 266 return countRootDerivedBioAssay Sets() > 0 || super.isUsed();266 return countRootDerivedBioAssays() > 0 || super.isUsed(); 267 267 } 268 268 /** 269 269 Get all: 270 270 <ul> 271 <li>(root) {@link DerivedBioAssay Set}:s created from this physical bioassay271 <li>(root) {@link DerivedBioAssay}:s created from this physical bioassay 272 272 <ul> 273 273 @since 2.2 … … 279 279 org.hibernate.Session session = getDbControl().getHibernateSession(); 280 280 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 281 "GET_ROOT_DERIVEDBIOASSAYS ETS_FOR_PHYSICALBIOASSAY", "dbs.id");281 "GET_ROOT_DERIVEDBIOASSAYS_FOR_PHYSICALBIOASSAY", "dbs.id"); 282 282 /* 283 283 SELECT {1} 284 FROM DerivedBioAssay SetData dbs284 FROM DerivedBioAssayData dbs 285 285 WHERE dbs.physicalBioAssay = :bioAssay 286 286 AND dbs.creationEvent.parent is null 287 287 */ 288 288 query.setEntity("bioAssay", this.getData()); 289 addUsingItems(using, Item.DERIVEDBIOASSAY SET, query);289 addUsingItems(using, Item.DERIVEDBIOASSAY, query); 290 290 return using; 291 291 } … … 457 457 458 458 /** 459 Get a query that returns all derived bioassay setscreated from this459 Get a query that returns all derived bioassay created from this 460 460 physical bioassay. 461 461 @return An {@link ItemQuery} object 462 462 */ 463 public ItemQuery<DerivedBioAssay Set> getDerivedBioAssaySets()464 { 465 ItemQuery<DerivedBioAssay Set> query = DerivedBioAssaySet.getQuery();463 public ItemQuery<DerivedBioAssay> getDerivedBioAssays() 464 { 465 ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery(); 466 466 query.restrictPermanent( 467 467 Restrictions.eq( … … 474 474 475 475 /** 476 Get a query that returns all root derived bioassay setscreated from this476 Get a query that returns all root derived bioassay created from this 477 477 physical bioassay. 478 478 @return An {@link ItemQuery} object 479 479 */ 480 public ItemQuery<DerivedBioAssay Set> getRootDerivedBioAssaySets()481 { 482 ItemQuery<DerivedBioAssay Set> query = DerivedBioAssaySet.getQuery();480 public ItemQuery<DerivedBioAssay> getRootDerivedBioAssays() 481 { 482 ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery(); 483 483 query.restrictPermanent( 484 484 Restrictions.eq( … … 493 493 494 494 /** 495 Counts all root derived bioassay sets that have been created from this physical bioassay.496 The count includes bioassay sets that the logged in user doesn't have access to.497 @return The number of root bioassay sets498 @throws BaseException If the bioassay setscould not be counted.495 Counts all root derived bioassays that have been created from this physical bioassay. 496 The count includes bioassays that the logged in user doesn't have access to. 497 @return The number of root bioassay 498 @throws BaseException If the bioassay could not be counted. 499 499 */ 500 public long countRootDerivedBioAssay Sets()500 public long countRootDerivedBioAssays() 501 501 throws BaseException 502 502 { 503 503 org.hibernate.Session session = getDbControl().getHibernateSession(); 504 504 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 505 "GET_ROOT_DERIVEDBIOASSAYS ETS_FOR_PHYSICALBIOASSAY", "count(*)");505 "GET_ROOT_DERIVEDBIOASSAYS_FOR_PHYSICALBIOASSAY", "count(*)"); 506 506 /* 507 507 SELECT {1} 508 FROM DerivedBioAssay SetData dbs508 FROM DerivedBioAssayData dba 509 509 WHERE dbs.physicalBioAssay = :bioAssay 510 AND db s.parent is null510 AND dba.parent is null 511 511 */ 512 512 query.setEntity("bioAssay", this.getData()); -
trunk/src/core/net/sf/basedb/core/Protocol.java
r5652 r5685 357 357 { 358 358 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 359 "GET_DERIVEDBIOASSAY SET_FOR_PROTOCOL", "count(*)");360 /* 361 SELECT {1} 362 FROM DerivedBioAssay SetData dbas363 WHERE dba s.protocol = :protocol359 "GET_DERIVEDBIOASSAY_FOR_PROTOCOL", "count(*)"); 360 /* 361 SELECT {1} 362 FROM DerivedBioAssayData dba 363 WHERE dba.protocol = :protocol 364 364 */ 365 365 query.setEntity("protocol", this.getData()); … … 386 386 <li>a {@link Plate}:s using this protocol 387 387 <li>an {@link ArrayBatch}:s using this protocol 388 <li>a {@link DerivedBioAssay Set}:s using this protocol388 <li>a {@link DerivedBioAssay}:s using this protocol 389 389 <li>a {@link RawBioAssay}:s using this protocol 390 390 <ul> … … 443 443 // Scans 444 444 query = HibernateUtil.getPredefinedQuery(session, 445 "GET_DERIVEDBIOASSAY SET_FOR_PROTOCOL", "dbas.id");446 /* 447 SELECT {1} 448 FROM DerivedBioAssay SetData dbas449 WHERE dba s.protocol = :protocol445 "GET_DERIVEDBIOASSAY_FOR_PROTOCOL", "dba.id"); 446 /* 447 SELECT {1} 448 FROM DerivedBioAssayData dba 449 WHERE dba.protocol = :protocol 450 450 */ 451 451 query.setEntity("protocol", this.getData()); 452 addUsingItems(using, Item.DERIVEDBIOASSAY SET, query);452 addUsingItems(using, Item.DERIVEDBIOASSAY, query); 453 453 454 454 // Raw bioassays -
trunk/src/core/net/sf/basedb/core/RawBioAssay.java
r5657 r5685 657 657 @since 3.0 658 658 */ 659 public void setParent BioAssay(Extract extract)659 public void setParentExtract(Extract extract) 660 660 throws PermissionDeniedException 661 661 { -
trunk/src/core/net/sf/basedb/core/Software.java
r5652 r5685 203 203 <ul> 204 204 <li>a RawBioAssay was created with this software 205 <li>a DerivedBioassay Setwas created with this software205 <li>a DerivedBioassay was created with this software 206 206 </ul> 207 207 */ … … 215 215 { 216 216 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 217 "GET_DERIVEDBIOASSAYS ETS_FOR_SOFTWARE", "count(*)");217 "GET_DERIVEDBIOASSAYS_FOR_SOFTWARE", "count(*)"); 218 218 /* 219 219 SELECT {1} 220 FROM DerivedBioAssay SetData dbas221 WHERE dba s.software = :software220 FROM DerivedBioAssayData dba 221 WHERE dba.software = :software 222 222 */ 223 223 query.setEntity("software", this.getData()); … … 242 242 <ul> 243 243 <li>{@link RawBioAssay}:s created with this software 244 <li>{@link DerivedBioAssay Set}: created with this software244 <li>{@link DerivedBioAssay}: created with this software 245 245 <ul> 246 246 @since 2.2 … … 263 263 // Derived bioassay sets 264 264 query = HibernateUtil.getPredefinedQuery(session, 265 "GET_DERIVEDBIOASSAYS ETS_FOR_SOFTWARE", "dbas.id");265 "GET_DERIVEDBIOASSAYS_FOR_SOFTWARE", "dba.id"); 266 266 /* 267 267 SELECT {1} 268 FROM DerivedBioAssay SetData dbas269 WHERE dba s.software = :software268 FROM DerivedBioAssayData dba 269 WHERE dba.software = :software 270 270 */ 271 271 query.setEntity("software", this.getData()); 272 addUsingItems(using, Item.DERIVEDBIOASSAY SET, query);272 addUsingItems(using, Item.DERIVEDBIOASSAY, query); 273 273 return using; 274 274 } -
trunk/src/core/net/sf/basedb/core/data/DerivedBioAssayData.java
r5684 r5685 30 30 @since 3.0 31 31 @base.modified $Date$ 32 @hibernate.class table="`DerivedBioAssay Sets`" lazy="true"32 @hibernate.class table="`DerivedBioAssays`" lazy="true" 33 33 */ 34 public class DerivedBioAssay SetData34 public class DerivedBioAssayData 35 35 extends AnnotatedData 36 36 implements RegisteredData, FileStoreEnabledData, SubtypableData 37 37 { 38 38 39 public DerivedBioAssay SetData()39 public DerivedBioAssayData() 40 40 {} 41 41 … … 103 103 } 104 104 105 private DerivedBioAssay SetData parent;106 /** 107 Get the bioassay set that is the parent of this bioassay set. null if this bioassay setwas105 private DerivedBioAssayData parent; 106 /** 107 Get the bioassay that is the parent of this bioassay. Null if this bioassay was 108 108 created from a physical bioassay. 109 109 @hibernate.many-to-one column="`parent_id`" not-null="false" update="false" outer-join="false" 110 110 */ 111 public DerivedBioAssay SetData getParent()111 public DerivedBioAssayData getParent() 112 112 { 113 113 return parent; 114 114 } 115 public void setParent(DerivedBioAssay SetData parent)115 public void setParent(DerivedBioAssayData parent) 116 116 { 117 117 this.parent = parent; 118 118 } 119 119 120 private Set<DerivedBioAssay SetData> children;120 private Set<DerivedBioAssayData> children; 121 121 /** 122 122 This is the inverse end. 123 @see DerivedBioAssay SetData#getParent()123 @see DerivedBioAssayData#getParent() 124 124 @hibernate.set lazy="true" inverse="true" 125 125 @hibernate.collection-key column="`parent_id`" 126 @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssay SetData"127 */ 128 Set<DerivedBioAssay SetData> getChildren()126 @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssayData" 127 */ 128 Set<DerivedBioAssayData> getChildren() 129 129 { 130 130 return children; 131 131 } 132 void setChildren(Set<DerivedBioAssay SetData> children)132 void setChildren(Set<DerivedBioAssayData> children) 133 133 { 134 134 this.children = children; 135 135 } 136 136 137 private Set< DerivedBioAssayData> bioAssays;137 private Set<RawBioAssayData> rawBioAssays; 138 138 /** 139 139 This is the inverse end. 140 @see DerivedBioAssayData#getBioAssaySet()141 @hibernate.set lazy="true" inverse="true" cascade="delete"142 @hibernate.collection-key column="`bioassay set_id`"143 @hibernate.collection-one-to-many class="net.sf.basedb.core.data. DerivedBioAssayData"144 */ 145 Set< DerivedBioAssayData> getBioAssays()146 { 147 return bioAssays;148 } 149 void set BioAssays(Set<DerivedBioAssayData> bioAssays)150 { 151 this. bioAssays = bioAssays;140 @see RawBioAssayData#getParentBioAssay() 141 @hibernate.set lazy="true" inverse="true" 142 @hibernate.collection-key column="`bioassay_id`" 143 @hibernate.collection-one-to-many class="net.sf.basedb.core.data.RawBioAssayData" 144 */ 145 Set<RawBioAssayData> getRawBioAssays() 146 { 147 return rawBioAssays; 148 } 149 void setRawBioAssays(Set<RawBioAssayData> rawBioAssays) 150 { 151 this.rawBioAssays = rawBioAssays; 152 152 } 153 153 … … 209 209 } 210 210 211 private ExtractData extract; 212 /** 213 Get the extract that this bioassay is related to. 214 @hibernate.many-to-one column="`extract_id`" not-null="false" outer-join="false" 215 */ 216 public ExtractData getExtract() 217 { 218 return extract; 219 } 220 public void setExtract(ExtractData extract) 221 { 222 this.extract = extract; 223 } 211 224 212 225 } -
trunk/src/core/net/sf/basedb/core/data/PhysicalBioAssayData.java
r5652 r5685 119 119 } 120 120 121 private Set<DerivedBioAssay SetData> rootDerivedBioAssaySets;121 private Set<DerivedBioAssayData> rootDerivedBioAssays; 122 122 /** 123 123 This is the inverse end with an extra restriction 124 @see DerivedBioAssay SetData#getPhysicalBioAssay()124 @see DerivedBioAssayData#getPhysicalBioAssay() 125 125 @hibernate.set lazy="true" inverse="true" where="`parent_id` is null" 126 126 @hibernate.collection-key column="`bioassay_id`" 127 @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssay SetData"127 @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssayData" 128 128 */ 129 Set<DerivedBioAssay SetData> getRootDerivedBioAssaySets()129 Set<DerivedBioAssayData> getRootDerivedBioAssays() 130 130 { 131 return rootDerivedBioAssay Sets;131 return rootDerivedBioAssays; 132 132 } 133 void setRootDerivedBioAssay Sets(Set<DerivedBioAssaySetData> rootDerivedBioAssaySets)133 void setRootDerivedBioAssays(Set<DerivedBioAssayData> rootDerivedBioAssays) 134 134 { 135 this.rootDerivedBioAssay Sets = rootDerivedBioAssaySets;135 this.rootDerivedBioAssays = rootDerivedBioAssays; 136 136 } 137 137 138 private Set<DerivedBioAssay SetData> derivedBioAssaySets;138 private Set<DerivedBioAssayData> derivedBioAssays; 139 139 /** 140 140 This is the inverse end. 141 @see DerivedBioAssay SetData#getPhysicalBioAssay()141 @see DerivedBioAssayData#getPhysicalBioAssay() 142 142 @hibernate.set lazy="true" inverse="true" 143 143 @hibernate.collection-key column="`bioassay_id`" 144 @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssay SetData"144 @hibernate.collection-one-to-many class="net.sf.basedb.core.data.DerivedBioAssayData" 145 145 */ 146 Set<DerivedBioAssay SetData> getDerivedBioAssaySets()146 Set<DerivedBioAssayData> getDerivedBioAssays() 147 147 { 148 return derivedBioAssay Sets;148 return derivedBioAssays; 149 149 } 150 void setDerivedBioAssay Sets(Set<DerivedBioAssaySetData> derivedBioAssaySets)150 void setDerivedBioAssays(Set<DerivedBioAssayData> derivedBioAssays) 151 151 { 152 this.derivedBioAssay Sets = derivedBioAssaySets;152 this.derivedBioAssays = derivedBioAssays; 153 153 } 154 154 -
trunk/src/core/net/sf/basedb/util/AnnotationUtil.java
r5657 r5685 31 31 import net.sf.basedb.core.BaseException; 32 32 import net.sf.basedb.core.DbControl; 33 import net.sf.basedb.core.DerivedBioAssay Set;33 import net.sf.basedb.core.DerivedBioAssay; 34 34 import net.sf.basedb.core.PhysicalBioAssay; 35 35 import net.sf.basedb.core.RawBioAssay; … … 112 112 <ul> 113 113 <li>{@link RawBioAssay#getArrayNum()} if the item is a raw bioassay 114 <li>'arrayNum' if the items is a DerivedBioAssay Setor PhysicalBioAssay114 <li>'arrayNum' if the items is a DerivedBioAssay or PhysicalBioAssay 115 115 <li>0 in all other cases. 116 116 */ … … 122 122 return arrayNum; 123 123 } 124 else if (item instanceof DerivedBioAssay Set|| item instanceof PhysicalBioAssay)124 else if (item instanceof DerivedBioAssay || item instanceof PhysicalBioAssay) 125 125 { 126 126 return arrayNum; -
trunk/src/core/net/sf/basedb/util/overview/OverviewUtil.java
r5657 r5685 35 35 import net.sf.basedb.core.BasicItem; 36 36 import net.sf.basedb.core.DbControl; 37 import net.sf.basedb.core.DerivedBioAssay Set;37 import net.sf.basedb.core.DerivedBioAssay; 38 38 import net.sf.basedb.core.Presets; 39 39 import net.sf.basedb.core.PhysicalBioAssay; -
trunk/src/core/net/sf/basedb/util/overview/loader/BasicItemNodeLoaderFactory.java
r5652 r5685 222 222 registerCheckedNodeLoader(Item.ARRAYSLIDE, ArraySlideLoader.class); 223 223 registerCheckedNodeLoader(Item.PHYSICALBIOASSAY, PhysicalBioAssayLoader.class); 224 registerCheckedNodeLoader(Item.DERIVEDBIOASSAYSET, DerivedBioAssaySetLoader.class);225 224 registerCheckedNodeLoader(Item.DERIVEDBIOASSAY, DerivedBioAssayLoader.class); 226 225 registerCheckedNodeLoader(Item.RAWBIOASSAY, RawBioAssayLoader.class); -
trunk/src/core/net/sf/basedb/util/overview/loader/DerivedBioAssayLoader.java
r5684 r5685 22 22 package net.sf.basedb.util.overview.loader; 23 23 24 import net.sf.basedb.core.BioSource;25 24 import net.sf.basedb.core.DbControl; 26 25 import net.sf.basedb.core.DerivedBioAssay; 27 import net.sf.basedb.core.DerivedBioAssaySet;28 import net.sf.basedb.core.Extract;29 26 import net.sf.basedb.core.Item; 30 27 import net.sf.basedb.core.ItemQuery; … … 32 29 import net.sf.basedb.core.PermissionDeniedException; 33 30 import net.sf.basedb.core.PhysicalBioAssay; 34 import net.sf.basedb.core.RawBioAssay;35 import net.sf.basedb.core.Sample;36 import net.sf.basedb.core.query.Hql;37 import net.sf.basedb.core.query.Restrictions;38 31 import net.sf.basedb.util.overview.Node; 39 32 import net.sf.basedb.util.overview.OverviewContext; … … 50 43 @base.modified $Date$ 51 44 */ 52 public class DerivedBioAssay SetLoader53 extends BasicItemNodeLoader<DerivedBioAssay Set>45 public class DerivedBioAssayLoader 46 extends BasicItemNodeLoader<DerivedBioAssay> 54 47 { 55 public DerivedBioAssay SetLoader()56 { 57 super(Item.DERIVEDBIOASSAY SET, ALLOW_ROOT_NODE,58 new NameableNameGenerator<DerivedBioAssay Set>("bioassayset", "Bioassay set"));48 public DerivedBioAssayLoader() 49 { 50 super(Item.DERIVEDBIOASSAY, ALLOW_ROOT_NODE, 51 new NameableNameGenerator<DerivedBioAssay>("bioassayset", "Bioassay")); 59 52 } 60 53 … … 78 71 returnNode = createForwardNode((PhysicalBioAssay)parentNode.getItem(dc), dc, context, parentNode); 79 72 } 80 else if (parentType == Item.DERIVEDBIOASSAY SET)81 { 82 returnNode = createForwardNode((DerivedBioAssay Set)parentNode.getItem(dc), dc, context, parentNode);73 else if (parentType == Item.DERIVEDBIOASSAY) 74 { 75 returnNode = createForwardNode((DerivedBioAssay)parentNode.getItem(dc), dc, context, parentNode); 83 76 } 84 77 … … 134 127 returnNode = createReverseNode((DerivedBioAssay)parentNode.getItem(dc), dc, context, parentNode); 135 128 } 136 else if (parentType == Item.DERIVEDBIOASSAYSET)137 {138 returnNode = createReverseNode((DerivedBioAssaySet)parentNode.getItem(dc), dc, context, parentNode);139 }140 129 141 130 /* … … 188 177 189 178 /** 190 Loads all child derived bioassay and bioassay set nodes. 191 @see DerivedBioAssaySetLoader#createForwardNode(DbControl, OverviewContext, Node) 179 Loads all child derived bioassay and raw bioassay nodes. 192 180 @see DerivedBioAssayLoader#createForwardNode(DbControl, OverviewContext, Node) 181 @see RawBioAssayLoader#createForwardNode(DbControl, OverviewContext, Node) 193 182 */ 194 183 @Override 195 184 protected void loadForwardChildNodes(DbControl dc, OverviewContext context, Node parentNode) 196 185 { 197 getNodeLoader(context, Item.DERIVEDBIOASSAYSET).createForwardNode(dc, context, parentNode);198 186 getNodeLoader(context, Item.DERIVEDBIOASSAY).createForwardNode(dc, context, parentNode); 187 getNodeLoader(context, Item.RAWBIOASSAY).createForwardNode(dc, context, parentNode); 199 188 } 200 189 … … 202 191 Loads the parent bioassay set or the parent physical bioassay. 203 192 @see PhysicalBioAssayLoader#createReverseNode(DbControl, OverviewContext, Node) 204 @see DerivedBioAssay SetLoader#createReverseNode(DbControl, OverviewContext, Node)193 @see DerivedBioAssayLoader#createReverseNode(DbControl, OverviewContext, Node) 205 194 */ 206 195 @Override 207 196 protected void loadReverseChildNodes(DbControl dc, OverviewContext context, Node bioAssaySetNode) 208 197 { 209 DerivedBioAssay Set dbas = (DerivedBioAssaySet)bioAssaySetNode.getItem(dc);198 DerivedBioAssay dbas = (DerivedBioAssay)bioAssaySetNode.getItem(dc); 210 199 if (dbas.isRoot()) 211 200 { … … 214 203 else 215 204 { 216 getNodeLoader(context, Item.DERIVEDBIOASSAY SET).createReverseNode(dc, context, bioAssaySetNode);205 getNodeLoader(context, Item.DERIVEDBIOASSAY).createReverseNode(dc, context, bioAssaySetNode); 217 206 } 218 207 } … … 221 210 222 211 /** 223 Create forward-loading derived bioassay setnodes that have the given224 physical bioassay as the immediate parent (eg. root bioassay sets).212 Create forward-loading derived bioassay nodes that have the given 213 physical bioassay as the immediate parent (eg. root bioassays). 225 214 */ 226 215 private Node createForwardNode(PhysicalBioAssay bioAssay, DbControl dc, OverviewContext context, Node parentNode) 227 216 { 228 NodeFactory<DerivedBioAssay Set> nf = getNodeFactory(dc, context);217 NodeFactory<DerivedBioAssay> nf = getNodeFactory(dc, context); 229 218 int cacheIndex = getCacheIndex(parentNode); 230 219 231 220 Node folderNode = null; 232 ItemQuery<DerivedBioAssay Set> query = context.initQuery(bioAssay.getRootDerivedBioAssaySets(), "name");233 ItemResultIterator<DerivedBioAssay Set> it = query.iterate(dc);221 ItemQuery<DerivedBioAssay> query = context.initQuery(bioAssay.getRootDerivedBioAssays(), "name"); 222 ItemResultIterator<DerivedBioAssay> it = query.iterate(dc); 234 223 while (it.hasNext()) 235 224 { 236 DerivedBioAssay SetbioAssaySet = it.next();225 DerivedBioAssay bioAssaySet = it.next(); 237 226 if (folderNode == null) 238 227 { … … 250 239 derived bioassay set as the parent 251 240 */ 252 private Node createForwardNode(DerivedBioAssay Setparent, DbControl dc, OverviewContext context, Node parentNode)253 { 254 NodeFactory<DerivedBioAssay Set> nf = getNodeFactory(dc, context);241 private Node createForwardNode(DerivedBioAssay parent, DbControl dc, OverviewContext context, Node parentNode) 242 { 243 NodeFactory<DerivedBioAssay> nf = getNodeFactory(dc, context); 255 244 Node folderNode = null; 256 245 int cacheIndex = getCacheIndex(parentNode); 257 ItemQuery<DerivedBioAssay Set> query = context.initQuery(parent.getChildren(), "name");258 ItemResultIterator<DerivedBioAssay Set> it = query.iterate(dc);246 ItemQuery<DerivedBioAssay> query = context.initQuery(parent.getChildren(), "name"); 247 ItemResultIterator<DerivedBioAssay> it = query.iterate(dc); 259 248 while (it.hasNext()) 260 249 { 261 DerivedBioAssay SetbioAssaySet = it.next();250 DerivedBioAssay bioAssaySet = it.next(); 262 251 if (folderNode == null) 263 252 { … … 273 262 private Node createReverseNode(DerivedBioAssay child, DbControl dc, OverviewContext context, Node parentNode) 274 263 { 275 NodeFactory<DerivedBioAssay Set> nf = getNodeFactory(dc, context);276 DerivedBioAssay SetbioAssaySet = null;264 NodeFactory<DerivedBioAssay> nf = getNodeFactory(dc, context); 265 DerivedBioAssay bioAssaySet = null; 277 266 boolean denied = false; 278 267 try 279 268 { 280 bioAssaySet = child.get BioAssaySet();269 bioAssaySet = child.getParent(); 281 270 } 282 271 catch (PermissionDeniedException ex) … … 289 278 } 290 279 291 private Node createReverseNode(DerivedBioAssaySet child, DbControl dc, OverviewContext context, Node parentNode)292 {293 NodeFactory<DerivedBioAssaySet> nf = getNodeFactory(dc, context);294 DerivedBioAssaySet bioAssaySet = null;295 boolean denied = false;296 try297 {298 bioAssaySet = child.getParent();299 }300 catch (PermissionDeniedException ex)301 {302 denied = true;303 }304 Node bioAssaySetNode = createItemNode(nf, bioAssaySet, bioAssaySet, denied,305 parentNode, ChildNodeDirection.REVERSE);306 return bioAssaySetNode;307 }308 309 280 /** 310 281 If we have an extract in the parent chaing we need to keep track of that -
trunk/src/core/net/sf/basedb/util/overview/loader/ExtractLoader.java
r5663 r5685 274 274 try 275 275 { 276 extract = bioAssay.getExtract();276 //extract = bioAssay.getExtract(); 277 277 } 278 278 catch (PermissionDeniedException ex) -
trunk/src/core/net/sf/basedb/util/overview/loader/HardwareLoader.java
r5652 r5685 25 25 import net.sf.basedb.core.BasicItem; 26 26 import net.sf.basedb.core.DbControl; 27 import net.sf.basedb.core.DerivedBioAssay Set;27 import net.sf.basedb.core.DerivedBioAssay; 28 28 import net.sf.basedb.core.Hardware; 29 29 import net.sf.basedb.core.MeasuredBioMaterial; … … 77 77 { 78 78 BasicItem parentItem = (BasicItem)parentNode.getItem(dc); 79 if (parentItem instanceof DerivedBioAssay Set)79 if (parentItem instanceof DerivedBioAssay) 80 80 { 81 hardware = ((DerivedBioAssay Set)parentItem).getHardware();81 hardware = ((DerivedBioAssay)parentItem).getHardware(); 82 82 } 83 83 else if (parentItem instanceof PhysicalBioAssay) -
trunk/src/core/net/sf/basedb/util/overview/loader/PhysicalBioAssayLoader.java
r5662 r5685 24 24 import net.sf.basedb.core.ArraySlide; 25 25 import net.sf.basedb.core.DbControl; 26 import net.sf.basedb.core.DerivedBioAssay Set;26 import net.sf.basedb.core.DerivedBioAssay; 27 27 import net.sf.basedb.core.Extract; 28 28 import net.sf.basedb.core.PhysicalBioAssay; … … 45 45 <ol> 46 46 <li>{@link Extract}:s -> {@link PhysicalBioAssay}:s -> 47 {@link DerivedBioAssay Set}:s.47 {@link DerivedBioAssay}:s. 48 48 <li>{@link ArraySlide}:s -> {@link PhysicalBioAssay}:s -> 49 {@link DerivedBioAssay Set}:s49 {@link DerivedBioAssay}:s 50 50 </ol> 51 51 … … 94 94 95 95 /** 96 Create a reverse-loading bioassay node from the derived bioassay setnode.96 Create a reverse-loading bioassay node from the derived bioassay node. 97 97 @return A bioassay node 98 98 */ 99 99 @Override 100 public Node createReverseNode(DbControl dc, OverviewContext context, Node derivedBioAssay SetNode)100 public Node createReverseNode(DbControl dc, OverviewContext context, Node derivedBioAssayNode) 101 101 { 102 102 NodeFactory<PhysicalBioAssay> nf = getNodeFactory(dc, context); … … 105 105 try 106 106 { 107 DerivedBioAssay Set bas = (DerivedBioAssaySet)derivedBioAssaySetNode.getItem(dc);107 DerivedBioAssay bas = (DerivedBioAssay)derivedBioAssayNode.getItem(dc); 108 108 bioAssay = bas.getPhysicalBioAssay(); 109 Node rbaNode = derivedBioAssay SetNode.getFirstParent(new ItemTypeFilter(Item.RAWBIOASSAY));109 Node rbaNode = derivedBioAssayNode.getFirstParent(new ItemTypeFilter(Item.RAWBIOASSAY)); 110 110 if (rbaNode != null) 111 111 { … … 117 117 denied = true; 118 118 } 119 Node bioAssayNode = createItemNode(nf, bioAssay, bioAssay, denied, derivedBioAssay SetNode, ChildNodeDirection.REVERSE);119 Node bioAssayNode = createItemNode(nf, bioAssay, bioAssay, denied, derivedBioAssayNode, ChildNodeDirection.REVERSE); 120 120 return bioAssayNode; 121 121 } … … 145 145 Load forward-loading child nodes: 146 146 <ul> 147 <li>Derived bioassay sets (root): {@link DerivedBioAssay SetLoader#createForwardNode(DbControl, OverviewContext, Node)}147 <li>Derived bioassay sets (root): {@link DerivedBioAssayLoader#createForwardNode(DbControl, OverviewContext, Node)} 148 148 <li>Array slide in reverse direction (if the parent node is an extract): 149 149 {@link ArraySlideLoader#createReverseNode(DbControl, OverviewContext, Node)} … … 155 155 protected void loadForwardChildNodes(DbControl dc, OverviewContext context, Node bioAssayNode) 156 156 { 157 getNodeLoader(context, Item.DERIVEDBIOASSAY SET).createForwardNode(dc, context, bioAssayNode);157 getNodeLoader(context, Item.DERIVEDBIOASSAY).createForwardNode(dc, context, bioAssayNode); 158 158 Node parent = bioAssayNode.getParent(); 159 159 if (parent != null && parent.getNodeType() == Node.Type.FOLDER) -
trunk/src/core/net/sf/basedb/util/overview/loader/SoftwareLoader.java
r5652 r5685 24 24 import net.sf.basedb.core.BasicItem; 25 25 import net.sf.basedb.core.DbControl; 26 import net.sf.basedb.core.DerivedBioAssay Set;26 import net.sf.basedb.core.DerivedBioAssay; 27 27 import net.sf.basedb.core.Item; 28 28 import net.sf.basedb.core.PermissionDeniedException; … … 71 71 software = ((RawBioAssay)parentItem).getSoftware(); 72 72 } 73 else if (parentItem instanceof DerivedBioAssay Set)73 else if (parentItem instanceof DerivedBioAssay) 74 74 { 75 software = ((DerivedBioAssay Set)parentItem).getSoftware();75 software = ((DerivedBioAssay)parentItem).getSoftware(); 76 76 } 77 77 -
trunk/src/core/net/sf/basedb/util/overview/validator/BasicItemNodeValidatorFactory.java
r5652 r5685 198 198 registerCheckedNodeValidator(Item.ARRAYSLIDE, ArraySlideValidator.class); 199 199 registerCheckedNodeValidator(Item.PHYSICALBIOASSAY, PhysicalBioAssayValidator.class); 200 // registerCheckedNodeValidator(Item.DERIVEDBIOASSAYSET, DerivedBioAssaySetValidator.class);201 200 // registerCheckedNodeValidator(Item.DERIVEDBIOASSAY, DerivedBioAssayValidator.class); 202 201 registerCheckedNodeValidator(Item.RAWBIOASSAY, RawBioAssayValidator.class); -
trunk/src/core/net/sf/basedb/util/overview/validator/RawBioAssayValidator.java
r5657 r5685 28 28 import net.sf.basedb.core.DbControl; 29 29 import net.sf.basedb.core.DerivedBioAssay; 30 import net.sf.basedb.core.PhysicalBioAssay;31 30 import net.sf.basedb.core.Project; 32 31 import net.sf.basedb.core.RawBioAssay; -
trunk/src/plugins/core/net/sf/basedb/plugins/batchimport/ScanImporter.java
r5652 r5685 23 23 24 24 import net.sf.basedb.core.DbControl; 25 import net.sf.basedb.core.DerivedBioAssay Set;25 import net.sf.basedb.core.DerivedBioAssay; 26 26 import net.sf.basedb.core.File; 27 27 import net.sf.basedb.core.Hardware; … … 52 52 */ 53 53 public class ScanImporter 54 extends AbstractItemImporter<DerivedBioAssay Set>54 extends AbstractItemImporter<DerivedBioAssay> 55 55 { 56 56 57 57 private static final Set<GuiContext> guiContexts = 58 Collections.singleton(new GuiContext(Item.DERIVEDBIOASSAY SET, GuiContext.Type.LIST));58 Collections.singleton(new GuiContext(Item.DERIVEDBIOASSAY, GuiContext.Type.LIST)); 59 59 60 60 protected static final PluginParameter<String> hardwareColumnMapping = new PluginParameter<String>( … … 211 211 212 212 /** 213 Calls {@link DerivedBioAssay Set#getQuery()}.214 */ 215 @Override 216 protected ItemQuery<DerivedBioAssay Set> createItemQuery()217 { 218 return DerivedBioAssay Set.getQuery();213 Calls {@link DerivedBioAssay#getQuery()}. 214 */ 215 @Override 216 protected ItemQuery<DerivedBioAssay> createItemQuery() 217 { 218 return DerivedBioAssay.getQuery(); 219 219 } 220 220 … … 223 223 { 224 224 nameMapper = getMapper(ffp, (String)job.getValue("nameColumnMapping"), 225 cropStrings ? DerivedBioAssay Set.MAX_NAME_LENGTH : null, null);225 cropStrings ? DerivedBioAssay.MAX_NAME_LENGTH : null, null); 226 226 descriptionMapper = getMapper(ffp, (String)job.getValue("descriptionColumnMapping"), 227 cropStrings ? DerivedBioAssay Set.MAX_DESCRIPTION_LENGTH : null, null);227 cropStrings ? DerivedBioAssay.MAX_DESCRIPTION_LENGTH : null, null); 228 228 protocolMapper = getMapper(ffp, (String)job.getValue("protocolColumnMapping"), null, null); 229 229 hardwareMapper = getMapper(ffp, (String)job.getValue("hardwareColumnMapping"), null, null); … … 242 242 243 243 @Override 244 protected DerivedBioAssay SetcreateItem(DbControl dc, FlatFileParser.Data data)244 protected DerivedBioAssay createItem(DbControl dc, FlatFileParser.Data data) 245 245 { 246 246 PhysicalBioAssay hyb = null; … … 250 250 } 251 251 252 DerivedBioAssay Set scan = DerivedBioAssaySet.getNew(dc, hyb);252 DerivedBioAssay scan = DerivedBioAssay.getNew(dc, hyb); 253 253 updateItem(dc, scan, data); 254 254 return scan; … … 256 256 257 257 @Override 258 protected void updateItem(DbControl dc, DerivedBioAssay Setscan, FlatFileParser.Data data)258 protected void updateItem(DbControl dc, DerivedBioAssay scan, FlatFileParser.Data data) 259 259 { 260 260 if (nameMapper != null) scan.setName(nameMapper.getValue(data)); … … 290 290 291 291 @Override 292 protected void updateMultiLineItem(DbControl dc, DerivedBioAssay Setscan, FlatFileParser.Data data, int multiLineNum)292 protected void updateMultiLineItem(DbControl dc, DerivedBioAssay scan, FlatFileParser.Data data, int multiLineNum) 293 293 { 294 294 // Image image = null; -
trunk/src/test/TestAll.java
r5652 r5685 115 115 // Physical bioassays and raw data 116 116 results.put("TestPhysicalBioAssay", TestPhysicalBioAssay.test_all()); 117 results.put("TestDerivedBioAssay Set", TestDerivedBioAssaySet.test_all());117 results.put("TestDerivedBioAssay", TestDerivedBioAssay.test_all()); 118 118 results.put("TestRawBioAssay", TestRawBioAssay.test_all()); 119 119 results.put("TestSpotImages", TestSpotImages.test_all()); -
trunk/src/test/TestDerivedBioAssay.java
r5684 r5685 26 26 import java.util.Set; 27 27 28 public class TestDerivedBioAssay Set28 public class TestDerivedBioAssay 29 29 { 30 30 … … 40 40 static boolean test_all() 41 41 { 42 write("++Testing derived bioassay sets");42 write("++Testing derived bioassays"); 43 43 write_header(); 44 44 … … 51 51 52 52 // Standard tests: create, load, list 53 int id = test_create_root("Scan #1", hybridizationId, SystemItems.getId(DerivedBioAssay Set.SCAN), protocolId, scannerId, 0);53 int id = test_create_root("Scan #1", hybridizationId, SystemItems.getId(DerivedBioAssay.SCAN), protocolId, scannerId, 0); 54 54 int id2 = test_create_root("Scan #2", hybridizationId, 0, 0, 0, 0); 55 55 … … 57 57 int child1 = test_create_child("Child #1", id, 0, 0, 0, 0); 58 58 int child2 = test_create_child("Child #2", id, 0, 0, 0, 0); 59 int bioAssay1 = test_add_bioassay(id, extractId1, "Bioassay #1");60 int bioAssay2 = test_add_bioassay(id, extractId2, "Bioassay #2");59 //int bioAssay1 = test_add_bioassay(id, extractId1, "Bioassay #1"); 60 //int bioAssay2 = test_add_bioassay(id, extractId2, "Bioassay #2"); 61 61 62 62 // Listing … … 64 64 test_list(hybridizationId, 2); 65 65 test_list_children(id, 2); 66 test_list_bioassays(id, 2);66 //test_list_bioassays(id, 2); 67 67 68 68 // Adding files 69 69 int samId = TestFile.test_create("data/test.assembly.sam", false, false); 70 TestDataFileType.test_set_file(Item.DERIVEDBIOASSAY, bioAssay1, DataFileType.SAM, samId);70 //TestDataFileType.test_set_file(Item.DERIVEDBIOASSAY, bioAssay1, DataFileType.SAM, samId); 71 71 72 72 // Standard test: Delete … … 81 81 TestHardware.test_delete(scannerId); 82 82 TestProtocol.test_delete(protocolId); 83 write("++Testing derived bioassay sets "+(ok ? "OK" : "Failed")+"\n");83 write("++Testing derived bioassays "+(ok ? "OK" : "Failed")+"\n"); 84 84 return ok; 85 85 } … … 87 87 static int test_create_root(String name, int bioAssayId, int subtypeId, int protocolId, int hardwareId, int softwareId) 88 88 { 89 if (bioAssayId == 0 || !TestUtil.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAY SET)) return 0;89 if (bioAssayId == 0 || !TestUtil.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAY)) return 0; 90 90 int id = 0; 91 91 DbControl dc = null; … … 93 93 { 94 94 dc = TestUtil.getDbControl(); 95 DerivedBioAssay Set dbas = DerivedBioAssaySet.getNew(dc, PhysicalBioAssay.getById(dc, bioAssayId));95 DerivedBioAssay dbas = DerivedBioAssay.getNew(dc, PhysicalBioAssay.getById(dc, bioAssayId)); 96 96 dbas.setName(name); 97 97 dbas.setDescription("Added at "+new Date()); … … 118 118 dc.reattachItem(dbas, false); 119 119 write_item(0, dbas); 120 write("--Create root derived bioassay setOK");121 } 122 catch (Throwable ex) 123 { 124 write("--Create root derived bioassay setFAILED");120 write("--Create root derived bioassay OK"); 121 } 122 catch (Throwable ex) 123 { 124 write("--Create root derived bioassay FAILED"); 125 125 ex.printStackTrace(); 126 126 ok = false; … … 141 141 { 142 142 dc = TestUtil.getDbControl(); 143 DerivedBioAssay Set dbas = DerivedBioAssaySet.getNew(dc, DerivedBioAssaySet.getById(dc, parentId));143 DerivedBioAssay dbas = DerivedBioAssay.getNew(dc, DerivedBioAssay.getById(dc, parentId)); 144 144 dbas.setName(name); 145 145 dbas.setDescription("Added at "+new Date()); … … 166 166 dc.reattachItem(dbas, false); 167 167 write_item(0, dbas); 168 write("--Create child derived bioassay setOK");169 } 170 catch (Throwable ex) 171 { 172 write("--Create child derived bioassay setFAILED");168 write("--Create child derived bioassay OK"); 169 } 170 catch (Throwable ex) 171 { 172 write("--Create child derived bioassay FAILED"); 173 173 ex.printStackTrace(); 174 174 ok = false; … … 189 189 { 190 190 dc = TestUtil.getDbControl(); 191 DerivedBioAssay Set dbas = DerivedBioAssaySet.getById(dc, id);191 DerivedBioAssay dbas = DerivedBioAssay.getById(dc, id); 192 192 write_item(0, dbas); 193 write("--Load derived bioassay setOK");194 } 195 catch (Throwable ex) 196 { 197 write("--Load derived bioassay setFAILED");193 write("--Load derived bioassay OK"); 194 } 195 catch (Throwable ex) 196 { 197 write("--Load derived bioassay FAILED"); 198 198 ex.printStackTrace(); 199 199 ok = false; … … 211 211 { 212 212 dc = TestUtil.getDbControl(); 213 ItemQuery<DerivedBioAssay Set> query = null;213 ItemQuery<DerivedBioAssay> query = null; 214 214 if (physicalBioAssayId == 0) 215 215 { 216 query = DerivedBioAssay Set.getQuery();216 query = DerivedBioAssay.getQuery(); 217 217 } 218 218 else 219 219 { 220 220 PhysicalBioAssay bioAssay = PhysicalBioAssay.getById(dc, physicalBioAssayId); 221 query = bioAssay.getRootDerivedBioAssay Sets();222 } 223 ItemResultList<DerivedBioAssay Set> l = query.list(dc);221 query = bioAssay.getRootDerivedBioAssays(); 222 } 223 ItemResultList<DerivedBioAssay> l = query.list(dc); 224 224 for (int i = 0; i<l.size(); i++) 225 225 { … … 230 230 throw new BaseException("Expected "+expectedResults+" results, not "+l.size()); 231 231 } 232 write("--List derived bioassay sets OK ("+l.size()+")");233 } 234 catch (Throwable ex) 235 { 236 write("--List derived bioassay sets FAILED");232 write("--List derived bioassays OK ("+l.size()+")"); 233 } 234 catch (Throwable ex) 235 { 236 write("--List derived bioassays FAILED"); 237 237 ex.printStackTrace(); 238 238 ok = false; … … 251 251 { 252 252 dc = TestUtil.getDbControl(); 253 DerivedBioAssay Set dbas = DerivedBioAssaySet.getById(dc, id);253 DerivedBioAssay dbas = DerivedBioAssay.getById(dc, id); 254 254 dc.deleteItem(dbas); 255 255 Set<ItemProxy> using = dbas.getUsingItems(); … … 259 259 } 260 260 dc.commit(); 261 write("--Delete derived bioassay setOK");262 } 263 catch (Throwable ex) 264 { 265 write("--Delete derived bioassay setFAILED");261 write("--Delete derived bioassay OK"); 262 } 263 catch (Throwable ex) 264 { 265 write("--Delete derived bioassay FAILED"); 266 266 ex.printStackTrace(); 267 267 ok = false; … … 279 279 { 280 280 dc = TestUtil.getDbControl(); 281 ItemResultList<DerivedBioAssay Set> l = DerivedBioAssaySet.getQuery().list(dc);281 ItemResultList<DerivedBioAssay> l = DerivedBioAssay.getQuery().list(dc); 282 282 Trashcan.delete(dc.getSessionControl(), l, true, null); 283 283 dc.commit(); 284 write("--Delete all derived bioassay sets OK ("+l.size()+")");285 } 286 catch (Throwable ex) 287 { 288 write("--Delete all derived bioassay sets FAILED");284 write("--Delete all derived bioassays OK ("+l.size()+")"); 285 } 286 catch (Throwable ex) 287 { 288 write("--Delete all derived bioassays FAILED"); 289 289 ex.printStackTrace(); 290 290 ok = false; … … 305 305 } 306 306 } 307 static void write_item(int i, DerivedBioAssay Setdbas)307 static void write_item(int i, DerivedBioAssay dbas) 308 308 throws BaseException 309 309 { … … 316 316 } 317 317 318 static void write_item(int i, DerivedBioAssay ba)319 throws BaseException320 {321 if (!TestUtil.getSilent())322 {323 System.out.println(i+":\t"+ba.getId()+"\t"+ba.getName()+"\t"+324 ba.getDescription()+"\t"+ba.getBioAssaySet()+"\t"+ba.getExtract());325 }326 }327 328 329 318 static void write(String message) 330 319 { 331 320 System.out.println(message); 332 }333 334 static int test_add_bioassay(int bioAssaySetid, int extractId, String name)335 {336 if (bioAssaySetid == 0) return 0;337 int id = 0;338 DbControl dc = null;339 try340 {341 dc = TestUtil.getDbControl();342 DerivedBioAssaySet dbas = DerivedBioAssaySet.getById(dc, bioAssaySetid);343 Extract extract = null;344 if (extractId != 0) extract = Extract.getById(dc, extractId);345 DerivedBioAssay ba = dbas.newBioAssay(extract);346 ba.setName(name);347 ba.setDescription("Added at "+new Date());348 dc.saveItem(ba);349 dc.commit();350 id = ba.getId();351 dc = TestUtil.getDbControl();352 dc.reattachItem(ba, false);353 write_item(0, ba);354 write("--Add bioassay to bioassay set OK");355 }356 catch (Throwable ex)357 {358 write("--Add bioassay to bioassay set FAILED");359 ex.printStackTrace();360 ok = false;361 }362 finally363 {364 if (dc != null) dc.close();365 }366 return id;367 321 } 368 322 … … 374 328 { 375 329 dc = TestUtil.getDbControl(); 376 DerivedBioAssay Set parent = DerivedBioAssaySet.getById(dc, id);377 ItemResultList<DerivedBioAssay Set> l = parent.getChildren().list(dc);330 DerivedBioAssay parent = DerivedBioAssay.getById(dc, id); 331 ItemResultList<DerivedBioAssay> l = parent.getChildren().list(dc); 378 332 for (int i = 0; i<l.size(); i++) 379 333 { … … 384 338 throw new BaseException("Expected "+expectedResults+" results, not "+l.size()); 385 339 } 386 write("--List child derived bioassay sets OK ("+l.size()+")");387 }388 catch (Throwable ex)389 {390 write("--List child derived bioassay sets FAILED");391 ex.printStackTrace();392 ok = false;393 }394 finally395 {396 if (dc != null) dc.close();397 }398 }399 400 static void test_list_bioassays(int id, int expectedResults)401 {402 if (id == 0) return;403 DbControl dc = null;404 try405 {406 dc = TestUtil.getDbControl();407 DerivedBioAssaySet parent = DerivedBioAssaySet.getById(dc, id);408 ItemResultList<DerivedBioAssay> l = parent.getBioAssays().list(dc);409 for (int i = 0; i<l.size(); i++)410 {411 write_item(i, l.get(i));412 }413 if (expectedResults >= 0 && expectedResults != l.size())414 {415 throw new BaseException("Expected "+expectedResults+" results, not "+l.size());416 }417 340 write("--List child derived bioassays OK ("+l.size()+")"); 418 341 } -
trunk/src/test/TestGenericOverview.java
r5663 r5685 25 25 import net.sf.basedb.core.DataFileType; 26 26 import net.sf.basedb.core.DbControl; 27 import net.sf.basedb.core.DerivedBioAssay Set;27 import net.sf.basedb.core.DerivedBioAssay; 28 28 import net.sf.basedb.core.Extract; 29 29 import net.sf.basedb.core.Hardware; … … 73 73 int milliWatt = TestUnit.test_load_by_symbol(power, "mW"); 74 74 int scanPower = TestAnnotationType.test_create("Power", Type.FLOAT, milliWatt, 75 null, null, Item.DERIVEDBIOASSAY SET, 1, null, false);75 null, null, Item.DERIVEDBIOASSAY, 1, null, false); 76 76 TestProtocol.test_set_protocol_parameter(scanningProtocol, scanPower); 77 77 … … 128 128 129 129 // Scan 130 int scan = TestDerivedBioAssay Set.test_create_root("Scanned hyb", hyb,131 SystemItems.getId(DerivedBioAssay Set.SCAN), scanningProtocol, scanner, 0);132 TestAnnotation.test_annotatate(Item.DERIVEDBIOASSAY SET, scan, scanPower, 0, 15.0f);133 int scannedAssayId1 = TestDerivedBioAssaySet.test_add_bioassay(scan, labeledExtract1, "Scanned GO #1");134 int scannedAssayId2 = TestDerivedBioAssaySet.test_add_bioassay(scan, labeledExtract2, "Scanned GO #2");130 int scan = TestDerivedBioAssay.test_create_root("Scanned hyb", hyb, 131 SystemItems.getId(DerivedBioAssay.SCAN), scanningProtocol, scanner, 0); 132 TestAnnotation.test_annotatate(Item.DERIVEDBIOASSAY, scan, scanPower, 0, 15.0f); 133 // int scannedAssayId1 = TestDerivedBioAssaySet.test_add_bioassay(scan, labeledExtract1, "Scanned GO #1"); 134 // int scannedAssayId2 = TestDerivedBioAssaySet.test_add_bioassay(scan, labeledExtract2, "Scanned GO #2"); 135 135 136 136 // Raw bioassay #1 137 int rawBioAssay1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #1", scan nedAssayId1, software, featureProtocol, arrayDesign, false);137 int rawBioAssay1 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #1", scan, software, featureProtocol, arrayDesign, false); 138 138 TestDataFileType.test_set_file(Item.RAWBIOASSAY, rawBioAssay1, DataFileType.GENERIC_RAW_DATA, genePixFile); 139 139 TestDataFileType.test_set_file(Item.RAWBIOASSAY, rawBioAssay1, DataFileType.AFFYMETRIX_CEL, celFile); … … 141 141 142 142 // Raw bioassay #2 143 int rawBioAssay2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #2", scan nedAssayId2, software, featureProtocol, arrayDesign, false);143 int rawBioAssay2 = TestRawBioAssay.test_create(Platform.GENERIC, "genepix", "RBA #2", scan, software, featureProtocol, arrayDesign, false); 144 144 TestDataFileType.test_set_file(Item.RAWBIOASSAY, rawBioAssay2, DataFileType.GENERIC_RAW_DATA, genePixFile); 145 145 … … 156 156 157 157 // Sequencing 158 int sequencing = TestDerivedBioAssaySet.test_create_root("Sequenced GO", flowCell, 159 SystemItems.getId(DerivedBioAssaySet.SEQUENCED), sequencingProtocol, sequencer, 0); 160 int assembly = TestDerivedBioAssaySet.test_create_child("Assembly GO", sequencing, 161 SystemItems.getId(DerivedBioAssaySet.ASSEMBLY), 0, 0, alignmentSoftware); 162 int alignedAssayId1 = TestDerivedBioAssaySet.test_add_bioassay(assembly, library1, "Aligned GO #1"); 163 int alignedAssayId2 = TestDerivedBioAssaySet.test_add_bioassay(assembly, library2, "Aligned GO #2"); 158 int sequencing = TestDerivedBioAssay.test_create_root("Sequenced GO", flowCell, 159 SystemItems.getId(DerivedBioAssay.SEQUENCED), sequencingProtocol, sequencer, 0); 160 161 int alignedAssayId1 = TestDerivedBioAssay.test_create_child("Aligned GO #1", sequencing, 162 SystemItems.getId(DerivedBioAssay.ASSEMBLY), 0, 0, alignmentSoftware); 163 int alignedAssayId2 = TestDerivedBioAssay.test_create_child("Aligned GO #2", sequencing, 164 SystemItems.getId(DerivedBioAssay.ASSEMBLY), 0, 0, alignmentSoftware); 164 165 TestDataFileType.test_set_file(Item.DERIVEDBIOASSAY, alignedAssayId1, DataFileType.SAM, samFile); 165 166 TestDataFileType.test_set_file(Item.DERIVEDBIOASSAY, alignedAssayId2, DataFileType.SAM, samFile); … … 187 188 TestRawBioAssay.test_delete(seqRaw1); 188 189 TestRawBioAssay.test_delete(seqRaw2); 189 TestDerivedBioAssaySet.test_delete(assembly); 190 TestDerivedBioAssaySet.test_delete(sequencing); 190 TestDerivedBioAssay.test_delete(alignedAssayId1); 191 TestDerivedBioAssay.test_delete(alignedAssayId2); 192 TestDerivedBioAssay.test_delete(sequencing); 191 193 TestPhysicalBioAssay.test_delete(flowCell); 192 194 TestExtract.test_delete(library1); … … 195 197 TestRawBioAssay.test_delete(rawBioAssay1); 196 198 TestRawBioAssay.test_delete(rawBioAssay2); 197 TestDerivedBioAssay Set.test_delete(scan);199 TestDerivedBioAssay.test_delete(scan); 198 200 TestPhysicalBioAssay.test_delete(hyb); 199 201 TestArraySlide.test_delete(arraySlide); -
trunk/src/test/TestMetadata.java
r5657 r5685 28 28 import net.sf.basedb.core.DbControl; 29 29 import net.sf.basedb.core.DerivedBioAssay; 30 import net.sf.basedb.core.DerivedBioAssaySet;31 30 import net.sf.basedb.core.Extract; 32 31 import net.sf.basedb.core.Formula; … … 60 59 test_create_property_path(RawBioAssay.class, "name", false); 61 60 // Association + id property 62 PropertyPath<RawBioAssay, DerivedBioAssay Set> scan =61 PropertyPath<RawBioAssay, DerivedBioAssay> scan = 63 62 test_create_property_path(RawBioAssay.class, "parent.bioAssaySet.id", false); 64 63 // Null association … … 84 83 85 84 // Collection of entities should fail 86 test_create_property_path(DerivedBioAssay Set.class, "bioAssays", true);85 test_create_property_path(DerivedBioAssay.class, "bioAssays", true); 87 86 88 87 int designId = TestArrayDesign.test_create(Platform.GENERIC, true); -
trunk/src/test/TestRawBioAssay.java
r5657 r5685 55 55 56 56 int hybridizationId = TestPhysicalBioAssay.test_create(0, "Test hyb", 0, 1); 57 int bioAssaySetId = TestDerivedBioAssaySet.test_create_root("Scan", hybridizationId, 58 SystemItems.getId(DerivedBioAssaySet.SCAN), 0, 0, 0); 59 int bioAssayId = TestDerivedBioAssaySet.test_add_bioassay(bioAssaySetId, 0, "Bioassay 1"); 57 int bioAssaySetId = TestDerivedBioAssay.test_create_root("Scan", hybridizationId, 58 SystemItems.getId(DerivedBioAssay.SCAN), 0, 0, 0); 60 59 int arrayDesignId = TestArrayDesign.test_create(Platform.GENERIC, false); 61 60 int arrayDesignId2 = TestArrayDesign.test_create(Platform.GENERIC, false); … … 72 71 73 72 // Standard tests: create, load, list 74 int id = test_create(Platform.GENERIC, "genepix", null, bioAssay Id, softwareId, protocolId, arrayDesignId, true);73 int id = test_create(Platform.GENERIC, "genepix", null, bioAssaySetId, softwareId, protocolId, arrayDesignId, true); 75 74 int id2 = test_create(Platform.GENERIC, "genepix", null, 0, 0, 0, 0, false); 76 75 int id3 = test_create(Platform.AFFYMETRIX, null, null, 0, 0, 0, 0, false); … … 105 104 106 105 TestFile.test_delete(celId); 107 TestDerivedBioAssay Set.test_delete(bioAssaySetId);106 TestDerivedBioAssay.test_delete(bioAssaySetId); 108 107 TestPhysicalBioAssay.test_delete(hybridizationId); 109 108 TestArrayDesign.test_delete(arrayDesignId); -
trunk/src/test/net/sf/basedb/test/roles/PowerUserTest.java
r5652 r5685 134 134 Unit volt = potential.getUnit("V"); 135 135 AnnotationType pmtGain = createProtocolParameter(dc, "PMT gain", 136 Type.FLOAT, volt, null, new Item[] { Item.DERIVEDBIOASSAY SET}136 Type.FLOAT, volt, null, new Item[] { Item.DERIVEDBIOASSAY } 137 137 ); 138 138 -
trunk/src/test/net/sf/basedb/test/roles/UserTest.java
r5663 r5685 33 33 import net.sf.basedb.core.DataFileType; 34 34 import net.sf.basedb.core.DbControl; 35 import net.sf.basedb.core.DerivedBioAssay Set;35 import net.sf.basedb.core.DerivedBioAssay; 36 36 import net.sf.basedb.core.Experiment; 37 37 import net.sf.basedb.core.Extract; … … 169 169 Sample sRef = null; 170 170 171 DerivedBioAssay Setsc1 = null;172 DerivedBioAssay Setsc2 = null;173 DerivedBioAssay Setsc1DyeSwap = null;174 DerivedBioAssay Setsc2DyeSwap = null;175 DerivedBioAssay SetaffyScan1 = null;176 DerivedBioAssay SetaffyScan2 = null;177 DerivedBioAssay SetaffyScan3 = null;171 DerivedBioAssay sc1 = null; 172 DerivedBioAssay sc2 = null; 173 DerivedBioAssay sc1DyeSwap = null; 174 DerivedBioAssay sc2DyeSwap = null; 175 DerivedBioAssay affyScan1 = null; 176 DerivedBioAssay affyScan2 = null; 177 DerivedBioAssay affyScan3 = null; 178 178 179 179 RawBioAssay rba1 = null; … … 278 278 importHybridizations(hybridizationBatchImporter, batchImportFile_Hybridization); 279 279 importScans(scanBatchImporter, batchImportFile_Scan); 280 importAnnotations(annotationImporter, batchImportFile_Scan, Item.DERIVEDBIOASSAY SET, getScanColumnHeaders(), "\\t");280 importAnnotations(annotationImporter, batchImportFile_Scan, Item.DERIVEDBIOASSAY, getScanColumnHeaders(), "\\t"); 281 281 importRawBioAssays(rawBioAssayBatchImporter, batchImportFile_RawBioAssay); 282 282 bioSource = Util.findBioSource(dc, "Biosource A"); … … 458 458 Create a scan. 459 459 */ 460 public static DerivedBioAssay SetcreateScan(DbControl dc, String name, PhysicalBioAssay hyb, Float pmtGain, Unit unit)460 public static DerivedBioAssay createScan(DbControl dc, String name, PhysicalBioAssay hyb, Float pmtGain, Unit unit) 461 461 { 462 462 TestUtil.write("--Creating scan: " + name + "\n"); 463 DerivedBioAssay Set scan = DerivedBioAssaySet.getNew(dc, hyb);464 scan.setItemSubtype(ItemSubtype.getById(dc, SystemItems.getId(DerivedBioAssay Set.SCAN)));463 DerivedBioAssay scan = DerivedBioAssay.getNew(dc, hyb); 464 scan.setItemSubtype(ItemSubtype.getById(dc, SystemItems.getId(DerivedBioAssay.SCAN))); 465 465 scan.setName(name); 466 466 scan.setProtocol(Util.findProtocol(dc, "Scanning A")); … … 470 470 if (pmtGain != null) 471 471 { 472 AnnotationType at = Util.findAnnotationType(dc, "PMT gain", Item.DERIVEDBIOASSAY SET);472 AnnotationType at = Util.findAnnotationType(dc, "PMT gain", Item.DERIVEDBIOASSAY); 473 473 Util.setAnnotation(scan, at, pmtGain, unit); 474 474 } … … 481 481 */ 482 482 public static RawBioAssay createRawBioAssay(DbControl dc, Platform platform, 483 RawDataType rawDataType, String name, DerivedBioAssay Setscan, ArrayDesign design)483 RawDataType rawDataType, String name, DerivedBioAssay scan, ArrayDesign design) 484 484 { 485 485 TestUtil.write("--Creating raw bioassay: " + name + "\n"); -
trunk/src/test/net/sf/basedb/test/roles/Util.java
r5652 r5685 35 35 import net.sf.basedb.core.BioSource; 36 36 import net.sf.basedb.core.DbControl; 37 import net.sf.basedb.core.DerivedBioAssay Set;37 import net.sf.basedb.core.DerivedBioAssay; 38 38 import net.sf.basedb.core.Experiment; 39 39 import net.sf.basedb.core.Formula; … … 321 321 Returns the first scan that was found with a certain name 322 322 */ 323 public static DerivedBioAssay SetfindScan(DbControl dc, String name)324 { 325 ItemQuery<DerivedBioAssay Set> query = DerivedBioAssaySet.getQuery();326 query.restrict(Restrictions.eq(Hql.property("itemSubtype"), Expressions.integer(SystemItems.getId(DerivedBioAssay Set.SCAN))));323 public static DerivedBioAssay findScan(DbControl dc, String name) 324 { 325 ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery(); 326 query.restrict(Restrictions.eq(Hql.property("itemSubtype"), Expressions.integer(SystemItems.getId(DerivedBioAssay.SCAN)))); 327 327 query.restrict(Restrictions.eq(Hql.property("name"), Expressions.string(name))); 328 328 return query.list(dc).get(0); -
trunk/www/include/menu.jsp
r5657 r5685 464 464 final boolean createMessages = sc.hasPermission(Permission.CREATE, Item.MESSAGE); 465 465 466 final boolean hasPhysicalBioAssays 467 final boolean hasDerivedBioAssay Sets = !sc.hasPermission(Permission.DENIED, Item.DERIVEDBIOASSAYSET);466 final boolean hasPhysicalBioAssays = !sc.hasPermission(Permission.DENIED, Item.PHYSICALBIOASSAY); 467 final boolean hasDerivedBioAssays = !sc.hasPermission(Permission.DENIED, Item.DERIVEDBIOASSAY); 468 468 469 469 final boolean hasRawBioAssays = !sc.hasPermission(Permission.DENIED, Item.RAWBIOASSAY); … … 550 550 /> 551 551 <m:menuitem 552 title="<%=common.getString("item.derivedbioassay set+")%>"553 onclick="<%="Menu.openUrl('"+root+"views/derivedbioassays ets/index.jsp?ID="+ID+"')"%>"554 tooltip="<%=menu.getString("derivedbioassays ets.tooltip", hasDerivedBioAssaySets)%>"555 enabled="<%=hasDerivedBioAssay Sets%>"552 title="<%=common.getString("item.derivedbioassay+")%>" 553 onclick="<%="Menu.openUrl('"+root+"views/derivedbioassays/index.jsp?ID="+ID+"')"%>" 554 tooltip="<%=menu.getString("derivedbioassays.tooltip", hasDerivedBioAssays)%>" 555 enabled="<%=hasDerivedBioAssays%>" 556 556 /> 557 557 <m:menuitem -
trunk/www/include/scripts/main.js
r5657 r5685 531 531 this.controllers['FORMULA'] = { url:'views/formulas/index.jsp', width:850, height:600 }; 532 532 this.controllers['PHYSICALBIOASSAY'] = { url:'views/physicalbioassays/index.jsp', width:800, height:500 }; 533 this.controllers['DERIVEDBIOASSAYSET'] = { url:'views/derivedbioassaysets/index.jsp', width:800, height:500 }; 534 this.controllers['DERIVEDBIOASSAY'] = { url:'views/derivedbioassaysets/bioassays/index.jsp', width:800, height:500 }; 533 this.controllers['DERIVEDBIOASSAY'] = { url:'views/derivedbioassays/index.jsp', width:800, height:500 }; 535 534 this.controllers['RAWBIOASSAY'] = { url:'views/rawbioassays/index.jsp', width:800, height:500 }; 536 535 this.controllers['RAWDATA'] = { url:'views/rawbioassays/rawdata/index.jsp', width:700, height:500, popup: true, edit:false }; -
trunk/www/views/derivedbioassays/edit_bioassay.jsp
r5684 r5685 20 20 ------------------------------------------------------------------ 21 21 --%> 22 <%@page import="net.sf.basedb.core.PhysicalBioAssay"%>23 22 <%@ page pageEncoding="UTF-8" session="false" 24 23 import="net.sf.basedb.core.SessionControl" 25 24 import="net.sf.basedb.core.DbControl" 26 import="net.sf.basedb.core.DerivedBioAssaySet" 25 import="net.sf.basedb.core.DerivedBioAssay" 26 import="net.sf.basedb.core.PhysicalBioAssay" 27 import="net.sf.basedb.core.Extract" 27 28 import="net.sf.basedb.core.ItemSubtype" 28 29 import="net.sf.basedb.core.Protocol" … … 53 54 <%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> 54 55 <% 55 final Item itemType = Item.DERIVEDBIOASSAY SET;56 final Item itemType = Item.DERIVEDBIOASSAY; 56 57 final SessionControl sc = Base.getExistingSessionControl(pageContext, true); 57 58 final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); … … 62 63 try 63 64 { 64 DerivedBioAssay Set bioAssaySet= null;65 DerivedBioAssay bioAssay = null; 65 66 String title = null; 66 67 … … 70 71 boolean readCurrentPhysicalBioAssay = true; 71 72 PhysicalBioAssay currentPhysicalBioAssay = null; 72 DerivedBioAssaySet currentParentBioAssaySet = null;73 73 74 boolean readCurrentParentBioAssay = true; 75 DerivedBioAssay currentParentBioAssay = null; 76 77 boolean readCurrentExtract = true; 78 Extract currentExtract = null; 79 74 80 boolean readCurrentProtocol = true; 75 81 Protocol currentProtocol = null; … … 86 92 // Load recently used items 87 93 List<PhysicalBioAssay> recentPhysicalBioAssays = (List<PhysicalBioAssay>)cc.getRecent(dc, Item.PHYSICALBIOASSAY); 88 List<DerivedBioAssay Set> recentParentBioAssaySets = (List<DerivedBioAssaySet>)cc.getRecent(dc, Item.DERIVEDBIOASSAYSET);94 List<DerivedBioAssay> recentParentBioAssays = (List<DerivedBioAssay>)cc.getRecent(dc, Item.DERIVEDBIOASSAY); 89 95 List<Protocol> recentProtocols = (List<Protocol>)cc.getRecent(dc, Item.PROTOCOL); 90 96 List<Hardware> recentHardware = (List<Hardware>)cc.getRecent(dc, Item.HARDWARE); … … 93 99 if (itemId == 0) 94 100 { 95 title = "New bioassay set";101 title = "New derived bioassay"; 96 102 cc.removeObject("item"); 97 103 currentSubtypeId = Values.getInt(request.getParameter("subtype_id")); … … 105 111 if (parentId != 0) 106 112 { 107 currentParentBioAssay Set = DerivedBioAssaySet.getById(dc, parentId);113 currentParentBioAssay = DerivedBioAssay.getById(dc, parentId); 108 114 try 109 115 { 110 currentPhysicalBioAssay = currentParentBioAssay Set.getPhysicalBioAssay();116 currentPhysicalBioAssay = currentParentBioAssay.getPhysicalBioAssay(); 111 117 } 112 118 catch (PermissionDeniedException ex) … … 114 120 readCurrentPhysicalBioAssay = false; 115 121 } 122 try 123 { 124 currentExtract = currentParentBioAssay.getExtract(); 125 } 126 catch (PermissionDeniedException ex) 127 {} 116 128 } 117 129 else … … 127 139 else 128 140 { 129 bioAssay Set = DerivedBioAssaySet.getById(dc, itemId);130 bioAssay Set.checkPermission(Permission.WRITE);131 cc.setObject("item", bioAssay Set);132 title = "Edit bioassay set -- " + HTML.encodeTags(bioAssaySet.getName());141 bioAssay = DerivedBioAssay.getById(dc, itemId); 142 bioAssay.checkPermission(Permission.WRITE); 143 cc.setObject("item", bioAssay); 144 title = "Edit bioassay -- " + HTML.encodeTags(bioAssay.getName()); 133 145 134 146 try 135 147 { 136 ItemSubtype subtype = bioAssay Set.getItemSubtype();148 ItemSubtype subtype = bioAssay.getItemSubtype(); 137 149 if (subtype != null) currentSubtypeId = subtype.getId(); 138 150 } … … 143 155 try 144 156 { 145 currentP hysicalBioAssay = bioAssaySet.getPhysicalBioAssay();157 currentParentBioAssay = bioAssay.getParent(); 146 158 } 147 159 catch (PermissionDeniedException ex) 148 160 { 161 readCurrentParentBioAssay = false; 162 } 163 try 164 { 165 currentPhysicalBioAssay = bioAssay.getPhysicalBioAssay(); 166 } 167 catch (PermissionDeniedException ex) 168 { 149 169 readCurrentPhysicalBioAssay = false; 150 170 } 151 171 try 152 172 { 153 current Protocol = bioAssaySet.getProtocol();173 currentExtract = bioAssay.getExtract(); 154 174 } 155 175 catch (PermissionDeniedException ex) 156 176 { 177 readCurrentExtract = false; 178 } 179 try 180 { 181 currentProtocol = bioAssay.getProtocol(); 182 } 183 catch (PermissionDeniedException ex) 184 { 157 185 readCurrentProtocol = false; 158 186 } 159 187 try 160 188 { 161 currentHardware = bioAssay Set.getHardware();189 currentHardware = bioAssay.getHardware(); 162 190 } 163 191 catch (PermissionDeniedException ex) … … 167 195 try 168 196 { 169 currentSoftware = bioAssay Set.getSoftware();197 currentSoftware = bioAssay.getSoftware(); 170 198 } 171 199 catch (PermissionDeniedException ex) … … 180 208 final String clazz = "class=\"text\""; 181 209 final String requiredClazz = "class=\"text required\""; 182 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), bioAssay Set);210 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), bioAssay); 183 211 ExtensionsInvoker invoker = EditUtil.useEditExtensions(jspContext); 184 212 %> … … 188 216 <ext:stylesheets context="<%=jspContext%>" /> 189 217 <script language="JavaScript"> 190 // Validate the "BioAssay Set" tab191 function validateBioAssay Set()192 { 193 var frm = document.forms['bioAssay Set'];218 // Validate the "BioAssay" tab 219 function validateBioAssay() 220 { 221 var frm = document.forms['bioAssay']; 194 222 if (Main.trimString(frm.name.value) == '') 195 223 { … … 213 241 if (frm.parent_id.selectedIndex < 0) 214 242 { 215 alert("You must select a parent bioassay set");243 alert("You must select a parent bioassay"); 216 244 frm.parent_id.focus(); 217 245 return false; … … 226 254 function saveSettings() 227 255 { 228 var frm = document.forms['bioAssay Set'];256 var frm = document.forms['bioAssay']; 229 257 if (TabControl.validateActiveTab('settings')) 230 258 { … … 290 318 function getProtocolId() 291 319 { 292 var frm = document.forms['bioAssay Set'];320 var frm = document.forms['bioAssay']; 293 321 var protocolId = 0; 294 322 if (frm.protocol_id.length > 0 && !frm.protocol_id.disabled) … … 301 329 function getParents() 302 330 { 303 var frm = document.forms['bioAssay Set'];331 var frm = document.forms['bioAssay']; 304 332 if (!frm.physicalbioassay_id) return; 305 333 … … 312 340 else 313 341 { 314 var bioAssay SetId = Math.abs(parseInt(frm.parent_id[frm.parent_id.selectedIndex].value));315 if (bioAssay SetId > 0) parents[parents.length] = 'DERIVEDBIOASSAYSET:'+bioAssaySetId;342 var bioAssayId = Math.abs(parseInt(frm.parent_id[frm.parent_id.selectedIndex].value)); 343 if (bioAssayId > 0) parents[parents.length] = 'DERIVEDBIOASSAY:'+bioAssayId; 316 344 } 317 345 return parents; 318 319 346 } 320 347 321 348 function selectProtocolOnClick() 322 349 { 323 var frm = document.forms['bioAssay Set'];350 var frm = document.forms['bioAssay']; 324 351 var url = '../../../admin/protocols/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone'; 325 352 url += '&callback=setProtocolCallback&resetTemporary=1'; 326 url += ItemSubtype.createRelatedFilter('bioAssay Set', 'PROTOCOL');353 url += ItemSubtype.createRelatedFilter('bioAssay', 'PROTOCOL'); 327 354 if (frm.protocol_id.length > 1) 328 355 { … … 334 361 function setProtocolCallback(id, name) 335 362 { 336 var frm = document.forms['bioAssay Set'];363 var frm = document.forms['bioAssay']; 337 364 var list = frm.protocol_id; 338 365 if (list.length < 2 || list[1].value == '0') // > … … 352 379 function selectPhysicalBioAssayOnClick() 353 380 { 354 var frm = document.forms['bioAssay Set'];381 var frm = document.forms['bioAssay']; 355 382 var url = '../physicalbioassays/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone'; 356 383 url += '&callback=setPhysicalBioAssayCallback&resetTemporary=1'; 357 url += ItemSubtype.createRelatedFilter('bioAssay Set', 'PHYSICALBIOASSAY');384 url += ItemSubtype.createRelatedFilter('bioAssay', 'PHYSICALBIOASSAY'); 358 385 if (frm.physicalbioassay_id.selectedIndex >= 0) 359 386 { … … 365 392 function setPhysicalBioAssayCallback(id, name) 366 393 { 367 var frm = document.forms['bioAssay Set'];394 var frm = document.forms['bioAssay']; 368 395 var list = frm.physicalbioassay_id; 396 if (list.length < 1 || list[0].value == '0') // > 397 { 398 Forms.addListOption(list, 0, new Option()); 399 } 400 list[0].value = id; 401 list[0].text = name; 402 list.selectedIndex = 0; 403 physicalBioAssayOnChange(); 404 } 405 function physicalBioAssayOnChange() 406 { 407 parentsChanged = true; 408 var frm = document.forms['bioAssay']; 409 initExtracts(); 410 } 411 412 function selectParentBioAssayOnClick() 413 { 414 var frm = document.forms['bioAssay']; 415 var url = 'index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone'; 416 url += '&callback=setParentBioAssayCallback&resetTemporary=1'; 417 url += ItemSubtype.createRelatedFilter('bioAssay', 'DERIVEDBIOASSAY'); 418 if (frm.parent_id.selectedIndex >= 0) 419 { 420 var id = Math.abs(parseInt(frm.physicalbioassay_id[frm.parent_id.selectedIndex].value)); 421 url += '&item_id='+id; 422 } 423 Main.openPopup(url, 'SelectParentBioAssay', 1000, 700); 424 } 425 function setParentBioAssayCallback(id, name) 426 { 427 var frm = document.forms['bioAssay']; 428 var list = frm.parent_id; 369 429 if (list.length < 1 || list[0].value == '0') // > 370 430 { … … 376 436 parentsChanged = true; 377 437 } 378 function p hysicalBioAssayOnChange()438 function parentBioAssayOnChange() 379 439 { 380 440 parentsChanged = true; 381 441 } 382 442 383 function selectParentBioAssaySetOnClick()384 {385 var frm = document.forms['bioAssaySet'];386 var url = 'index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone';387 url += '&callback=setParentBioAssaySetCallback&resetTemporary=1';388 url += ItemSubtype.createRelatedFilter('bioAssaySet', 'DERIVEDBIOASSAYSET');389 if (frm.parent_id.selectedIndex >= 0)390 {391 var id = Math.abs(parseInt(frm.physicalbioassay_id[frm.parent_id.selectedIndex].value));392 url += '&item_id='+id;393 }394 Main.openPopup(url, 'SelectParentBioAssaySet', 1000, 700);395 }396 function setParentBioAssaySetCallback(id, name)397 {398 var frm = document.forms['bioAssaySet'];399 var list = frm.parent_id;400 if (list.length < 1 || list[0].value == '0') // >401 {402 Forms.addListOption(list, 0, new Option());403 }404 list[0].value = id;405 list[0].text = name;406 list.selectedIndex = 0;407 parentsChanged = true;408 }409 function parentBioAssaySetOnChange()410 {411 parentsChanged = true;412 }413 414 443 function selectHardwareOnClick() 415 444 { 416 var frm = document.forms['bioAssay Set'];445 var frm = document.forms['bioAssay']; 417 446 var url = '../../../admin/hardware/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone'; 418 447 url += '&callback=setHardwareCallback&resetTemporary=1'; 419 url += ItemSubtype.createRelatedFilter('bioAssay Set', 'HARDWARE');448 url += ItemSubtype.createRelatedFilter('bioAssay', 'HARDWARE'); 420 449 if (frm.hardware_id.length > 1) 421 450 { … … 427 456 function setHardwareCallback(id, name) 428 457 { 429 var frm = document.forms['bioAssay Set'];458 var frm = document.forms['bioAssay']; 430 459 var list = frm.hardware_id; 431 460 if (list.length < 2 || list[1].value == '0') // > … … 439 468 function selectSoftwareOnClick() 440 469 { 441 var frm = document.forms['bioAssay Set'];470 var frm = document.forms['bioAssay']; 442 471 var url = '../../../admin/software/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone'; 443 472 url += '&callback=setSoftwareCallback&resetTemporary=1'; 444 url += ItemSubtype.createRelatedFilter('bioAssay Set', 'SOFTWARE');473 url += ItemSubtype.createRelatedFilter('bioAssay', 'SOFTWARE'); 445 474 if (frm.software_id.length > 1) 446 475 { … … 452 481 function setSoftwareCallback(id, name) 453 482 { 454 var frm = document.forms['bioAssay Set'];483 var frm = document.forms['bioAssay']; 455 484 var list = frm.software_id; 456 485 if (list.length < 2 || list[1].value == '0') // > … … 463 492 } 464 493 465 466 494 function init() 467 495 { 468 var frm = document.forms['bioAssay Set'];496 var frm = document.forms['bioAssay']; 469 497 <% 470 if (bioAssay Set== null)498 if (bioAssay == null) 471 499 { 472 500 %> … … 476 504 } 477 505 %> 478 isRootOnChange(); 506 if (frm.isRoot) 507 { 508 isRootOnChange(); 509 } 510 else 511 { 512 initExtracts(); 513 } 479 514 } 480 515 481 516 function isRootOnChange() 482 517 { 483 var frm = document.forms['bioAssay Set'];518 var frm = document.forms['bioAssay']; 484 519 var isRoot = frm.isRoot[0].checked; 485 520 Main.showHide('physicalBioAssaySection', isRoot); 486 Main.showHide('parentBioAssaySetSection', !isRoot); 487 } 488 521 Main.showHide('parentBioAssaySection', !isRoot); 522 initExtracts(); 523 } 524 525 function initExtracts() 526 { 527 var frm = document.forms['bioAssay']; 528 frm.extract_id.length = 0; 529 var extracts; 530 <% 531 if (bioAssay == null) 532 { 533 %> 534 if (frm.isRoot[0].checked) 535 { 536 extracts = getExtractsFromPhysicalBioAssay(frm.physicalbioassay_id[frm.physicalbioassay_id.selectedIndex].value); 537 } 538 else 539 { 540 extracts = getExtractsFromParentBioassay(frm.parent_id[frm.parent_id.selectedIndex].value); 541 } 542 <% 543 } 544 else 545 { 546 if (currentParentBioAssay != null) 547 { 548 %> 549 extracts = getExtractsFromParentBioassay(<%=currentParentBioAssay.getId()%>); 550 <% 551 } 552 else if (currentPhysicalBioAssay != null) 553 { 554 %> 555 extracts = getExtractsFromPhysicalBioAssay(<%=currentPhysicalBioAssay.getId()%>); 556 <% 557 } 558 } 559 %> 560 561 var frm = document.forms['bioAssay']; 562 frm.extract_id.length = 0; 563 frm.extract_id[frm.extract_id.length] = new Option('- none -', 0); 564 var currentExtractId = <%=currentExtract == null ? 0 : currentExtract.getId()%>; 565 var currentWasFound = 0; 566 for (var i = 0; i < extracts.length; i++) 567 { 568 var position = extracts[i].position; 569 var prefix = position ? position + ': ' : ''; 570 frm.extract_id[frm.extract_id.length] = new Option(prefix + extracts[i].name, extracts[i].id); 571 if (currentExtractId == extracts[i].id) 572 { 573 frm.extract_id.selectedIndex = frm.extract_id.length - 1; 574 currentWasFound = 1; 575 } 576 } 577 <% 578 if (currentExtract != null) 579 { 580 %> 581 if (currentExtractId && !currentWasFound) 582 { 583 frm.extract_id[frm.extract_id.length] = new Option('<%=HTML.javaScriptEncode(currentExtract.getName())%>', currentExtractId); 584 frm.extract_id.selectedIndex = frm.extract_id.length - 1; 585 } 586 <% 587 } 588 %> 589 } 590 591 function getExtractsFromPhysicalBioAssay(physicalBioAssayId) 592 { 593 var request = Ajax.getXmlHttpRequest(); 594 var url = '../physicalbioassays/ajax.jsp?ID=<%=ID%>&cmd=GetSources'; 595 url += '&item_id=' + physicalBioAssayId; 596 request.open("GET", url, false); 597 request.send(null); 598 599 var response = JSON.parse(request.responseText); 600 if (response.status != 'ok') 601 { 602 alert(response.message); 603 return; 604 } 605 return response.sources; 606 } 607 608 function getExtractsFromParentBioassay(bioAssayId) 609 { 610 var request = Ajax.getXmlHttpRequest(); 611 var url = 'ajax.jsp?ID=<%=ID%>&cmd=GetExtracts'; 612 url += '&item_id=' + bioAssayId; 613 request.open("GET", url, false); 614 request.send(null); 615 616 var response = JSON.parse(request.responseText); 617 if (response.status != 'ok') 618 { 619 alert(response.message); 620 return; 621 } 622 623 return response.sources; 624 } 489 625 </script> 490 626 </base:head> 491 627 <base:body onload="init()"> 492 628 <p> 493 <form action="index.jsp?ID=<%=ID%>" method="post" name="bioAssay Set" onsubmit="return false;">629 <form action="index.jsp?ID=<%=ID%>" method="post" name="bioAssay" onsubmit="return false;"> 494 630 <input type="hidden" name="cmd" value="UpdateItem"> 495 631 496 632 <h3 class="docked"><%=title%> <base:help tabcontrol="settings" /></h3> 497 633 <t:tabcontrol id="settings" contentstyle="<%="height: "+(int)(scale*370)+"px;"%>" 498 position="bottom" remember="<%=bioAssay Set!= null%>" switch="switchTab"634 position="bottom" remember="<%=bioAssay != null%>" switch="switchTab" 499 635 extensions="<%=invoker%>"> 500 <t:tab id="info" title="Bioassay set" validate="validateBioAssaySet()" helpid="bioassayset.edit">636 <t:tab id="info" title="Bioassay" validate="validateBioAssay()" helpid="derivedbioassay.edit"> 501 637 <table class="form" cellspacing=0> 502 638 <tr> 503 639 <td class="prompt" width="120px">Name</td> 504 640 <td><input <%=requiredClazz%> type="text" name="name" 505 value="<%=HTML.encodeTags(bioAssay Set == null ? Values.getString(cc.getPropertyValue("name"), "New bioassay set") : bioAssaySet.getName())%>"506 size="40" maxlength="<%=DerivedBioAssay Set.MAX_NAME_LENGTH%>"></td>641 value="<%=HTML.encodeTags(bioAssay == null ? Values.getString(cc.getPropertyValue("name"), "New derived bioassay") : bioAssay.getName())%>" 642 size="40" maxlength="<%=DerivedBioAssay.MAX_NAME_LENGTH%>"></td> 507 643 </tr> 508 644 … … 529 665 if (id != currentSubtypeId && subtype.isRemoved()) continue; 530 666 %> 531 <option value="<%=id == currentSubtypeId && bioAssay Set!= null ? -id : id%>"667 <option value="<%=id == currentSubtypeId && bioAssay != null ? -id : id%>" 532 668 <%=id == currentSubtypeId ? "selected" : ""%> 533 669 title="<%=HTML.encodeTags(subtype.getDescription()) %>" … … 541 677 </tr> 542 678 <% 543 if (bioAssay Set== null)679 if (bioAssay == null) 544 680 { 545 681 %> … … 548 684 <td> 549 685 <input id="isRoot" type="radio" name="isRoot" value="1" 550 <%=currentParentBioAssay Set== null ? "checked" : "" %>686 <%=currentParentBioAssay == null ? "checked" : "" %> 551 687 onchange="isRootOnChange()"><label for="isRoot">Physical bioassay</label> 552 688 <input id="isChild" type="radio" name="isRoot" value="0" 553 <%=currentParentBioAssay Set== null ? "" : "checked" %>554 onchange="isRootOnChange()"><label for="isChild"> Other bioassay set</label><br>689 <%=currentParentBioAssay == null ? "" : "checked" %> 690 onchange="isRootOnChange()"><label for="isChild">Derived bioassay</label><br> 555 691 </td> 556 692 </tr> … … 570 706 </td> 571 707 </tr> 572 <tr id="parentBioAssaySe tSection" style="display: none;">573 <td class="subprompt">-bioassay set</td>708 <tr id="parentBioAssaySection" style="display: none;"> 709 <td class="subprompt">-bioassay</td> 574 710 <td> 575 711 <base:select … … 577 713 clazz="selectionlist unchangeable" 578 714 required="true" 579 current="<%=currentParentBioAssay Set%>"580 recent="<%=recentParentBioAssay Sets%>"715 current="<%=currentParentBioAssay%>" 716 recent="<%=recentParentBioAssays%>" 581 717 newitem="true" 582 onselect="selectParentBioAssay SetOnClick()"583 onchange="parentBioAssay SetOnChange()"718 onselect="selectParentBioAssayOnClick()" 719 onchange="parentBioAssayOnChange()" 584 720 /> 585 721 </td> … … 588 724 } 589 725 %> 726 <tr> 727 <td class="prompt">Extract</td> 728 <td> 729 <select name="extract_id" class="selectionlist"></select> 730 </td> 731 </tr> 590 732 <tr> 591 733 <td class="prompt">Protocol</td> … … 599 741 recent="<%=recentProtocols%>" 600 742 defaultitem="<%=defaultProtocol%>" 601 newitem="<%=bioAssay Set== null%>"743 newitem="<%=bioAssay == null%>" 602 744 onselect="selectProtocolOnClick()" 603 745 onchange="protocolOnChange()" … … 616 758 recent="<%=recentHardware%>" 617 759 defaultitem="<%=defaultHardware%>" 618 newitem="<%=bioAssay Set== null%>"760 newitem="<%=bioAssay == null%>" 619 761 onselect="selectHardwareOnClick()" 620 762 /> … … 632 774 recent="<%=recentSoftware%>" 633 775 defaultitem="<%=defaultSoftware%>" 634 newitem="<%=bioAssay Set== null%>"776 newitem="<%=bioAssay == null%>" 635 777 onselect="selectSoftwareOnClick()" 636 778 /> … … 642 784 <td nowrap> 643 785 <textarea <%=clazz%> rows="4" cols="40" name="description" wrap="virtual" 644 ><%=HTML.encodeTags(bioAssay Set == null ? cc.getPropertyValue("description") : bioAssaySet.getDescription())%></textarea>645 <a href="javascript:Main.zoom('Description', 'bioAssay Set', 'description')"786 ><%=HTML.encodeTags(bioAssay == null ? cc.getPropertyValue("description") : bioAssay.getDescription())%></textarea> 787 <a href="javascript:Main.zoom('Description', 'bioAssay', 'description')" 646 788 title="Edit in larger window"><base:icon image="zoom.gif" /></a> 647 789 </td> … … 649 791 </table> 650 792 <div align=right> <i><base:icon image="required.gif" /> = required information</i> 651 <%if (bioAssay Set== null) {%><br>793 <%if (bioAssay == null) {%><br> 652 794 <i><base:icon image="unchangeable.gif" /> = can't be changed later</i> 653 795 <%}%> -
trunk/www/views/derivedbioassays/index.jsp
r5657 r5685 26 26 import="net.sf.basedb.core.SessionControl" 27 27 import="net.sf.basedb.core.DbControl" 28 import="net.sf.basedb.core.DerivedBioAssay Set"28 import="net.sf.basedb.core.DerivedBioAssay" 29 29 import="net.sf.basedb.core.PhysicalBioAssay" 30 import="net.sf.basedb.core.RawBioAssay" 30 31 import="net.sf.basedb.core.ItemSubtype" 32 import="net.sf.basedb.core.Extract" 31 33 import="net.sf.basedb.core.Protocol" 32 34 import="net.sf.basedb.core.Software" … … 44 46 import="net.sf.basedb.core.PermissionDeniedException" 45 47 import="net.sf.basedb.core.ItemAlreadyExistsException" 46 import="net.sf.basedb.core.query.Restriction" 48 import="net.sf.basedb.core.query.Hql" 49 import="net.sf.basedb.core.query.Orders" 50 import="net.sf.basedb.core.query.Restrictions" 51 import="net.sf.basedb.core.query.Expressions" 47 52 import="net.sf.basedb.util.RemovableUtil" 48 53 import="net.sf.basedb.util.ShareableUtil" … … 54 59 import="net.sf.basedb.core.plugin.GuiContext" 55 60 import="net.sf.basedb.util.extensions.ExtensionsInvoker" 61 import="net.sf.basedb.util.formatter.NameableFormatter" 56 62 import="net.sf.basedb.clients.web.extensions.ExtensionsControl" 57 63 import="net.sf.basedb.clients.web.extensions.JspContext" 58 64 import="net.sf.basedb.clients.web.extensions.edit.EditUtil" 59 65 import="net.sf.basedb.clients.web.extensions.edit.OnSaveRenderer" 66 import="net.sf.basedb.clients.web.plugins.ItemQueryLoader" 60 67 import="java.util.Enumeration" 61 68 import="java.util.Set" … … 68 75 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> 69 76 <%! 70 private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,itemSubtype,physicalBioAssay,parent,description"); 71 private static final Item itemType = Item.DERIVEDBIOASSAYSET; 77 private static final ItemContext defaultContext = Base.createDefaultContext("name", "name,itemSubtype,physicalBioAssay,extract,parent,description"); 78 private static final Item itemType = Item.DERIVEDBIOASSAY; 79 80 private static void registerExportUtils(ItemContext cc) 81 { 82 // Register formatters 83 cc.setObject("export.formatter.&children(name)", new NameableFormatter()); 84 cc.setObject("export.formatter.&rawBioAssays(name)", new NameableFormatter()); 85 86 // Register dataloaders 87 String bioassayParameter = "bioassay"; 88 // Child bioassays 89 ItemQuery<DerivedBioAssay> dbasQuery = DerivedBioAssay.getQuery(); 90 dbasQuery.include(cc.getInclude()); 91 dbasQuery.restrict(Restrictions.eq(Hql.property("parent"), Expressions.parameter(bioassayParameter))); 92 dbasQuery.order(Orders.asc(Hql.property("name"))); 93 cc.setObject("export.dataloader.&children(name)", new ItemQueryLoader(dbasQuery, bioassayParameter)); 94 95 // Child raw bioassays 96 ItemQuery<RawBioAssay> rawQuery = RawBioAssay.getQuery(); 97 rawQuery.include(cc.getInclude()); 98 rawQuery.restrict(Restrictions.eq(Hql.property("parentBioAssay"), Expressions.parameter(bioassayParameter))); 99 rawQuery.order(Orders.asc(Hql.property("name"))); 100 cc.setObject("export.dataloader.&rawBioAssays(name)", new ItemQueryLoader(rawQuery, bioassayParameter)); 101 102 } 103 72 104 %> 73 105 <% … … 79 111 final String callback = request.getParameter("callback"); 80 112 final String itemId = request.getParameter("item_id"); 81 final String listPage = "list_bioassays ets.jsp?ID="+ID+"&item_id="+itemId113 final String listPage = "list_bioassays.jsp?ID="+ID+"&item_id="+itemId 82 114 +(mode == null ? "" : "&mode="+mode) 83 115 +(callback == null ? "" : "&callback="+callback) 84 116 +(itemId == null ? "" : "&item_id="+itemId); 85 final String viewPage = "view_bioassay set.jsp?ID="+ID;86 final String editPage = "edit_bioassay set.jsp?ID="+ID;117 final String viewPage = "view_bioassay.jsp?ID="+ID; 118 final String editPage = "edit_bioassay.jsp?ID="+ID; 87 119 88 120 String forward = null; … … 142 174 dc = sc.newDbControl(); 143 175 144 DerivedBioAssay Set bas = (DerivedBioAssaySet)cc.getObject("item");176 DerivedBioAssay bas = (DerivedBioAssay)cc.getObject("item"); 145 177 if (bas == null) 146 178 { … … 150 182 { 151 183 PhysicalBioAssay bioAssay = PhysicalBioAssay.getById(dc, physicalBioAssayId); 152 bas = DerivedBioAssay Set.getNew(dc, bioAssay);184 bas = DerivedBioAssay.getNew(dc, bioAssay); 153 185 cc.setRecent(bioAssay, maxRecent); 154 186 } 155 187 else 156 188 { 157 DerivedBioAssay Set parent = DerivedBioAssaySet.getById(dc, parentId);158 bas = DerivedBioAssay Set.getNew(dc, parent);189 DerivedBioAssay parent = DerivedBioAssay.getById(dc, parentId); 190 bas = DerivedBioAssay.getNew(dc, parent); 159 191 cc.setRecent(parent, maxRecent); 160 192 } 161 193 dc.saveItem(bas); 162 message = " Bioassay setcreated";194 message = "Derived bioassay created"; 163 195 } 164 196 else 165 197 { 166 198 dc.reattachItem(bas, false); 167 message = " Bioassay setupdated";199 message = "Derived bioassay updated"; 168 200 } 169 201 … … 181 213 bas.setItemSubtype(subtype); 182 214 if (subtype != null) cc.setRecent(subtype, maxRecent); 215 } 216 217 int extractId = Values.getInt(request.getParameter("extract_id"), -1); 218 if (extractId >= 0) // < 0 = denied or unchanged 219 { 220 Extract extract = extractId == 0 ? null : Extract.getById(dc, extractId); 221 bas.setExtract(extract); 183 222 } 184 223 … … 322 361 // Run an export plugin in a list context 323 362 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 324 final ItemQuery<DerivedBioAssaySet> query = DerivedBioAssaySet.getQuery(); 363 final ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery(); 364 registerExportUtils(cc); 325 365 dc = sc.newDbControl(); 326 366 cc.configureQuery(dc, query, true); … … 333 373 // Run an export plugin in single-item context 334 374 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 375 registerExportUtils(cc); 335 376 redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=ITEM&title=Export+bioassay+set"; 336 377 } … … 339 380 // Run an import plugin in a list context 340 381 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 341 final ItemQuery<DerivedBioAssay Set> query = DerivedBioAssaySet.getQuery();382 final ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery(); 342 383 dc = sc.newDbControl(); 343 384 cc.configureQuery(dc, query, true); … … 356 397 // Run another plugin in a list context 357 398 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext); 358 final ItemQuery<DerivedBioAssay Set> query = DerivedBioAssaySet.getQuery();399 final ItemQuery<DerivedBioAssay> query = DerivedBioAssay.getQuery(); 359 400 dc = sc.newDbControl(); 360 401 cc.configureQuery(dc, query, true); -
trunk/www/views/derivedbioassays/list_bioassays.jsp
r5684 r5685 26 26 import="net.sf.basedb.core.Item" 27 27 import="net.sf.basedb.core.PhysicalBioAssay" 28 import="net.sf.basedb.core.DerivedBioAssaySet" 28 import="net.sf.basedb.core.DerivedBioAssay" 29 import="net.sf.basedb.core.RawBioAssay" 29 30 import="net.sf.basedb.core.BioMaterialEvent" 30 31 import="net.sf.basedb.core.AnnotationType" … … 72 73 <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> 73 74 <%! 74 private static final Item itemType = Item.DERIVEDBIOASSAY SET;75 private static final Item itemType = Item.DERIVEDBIOASSAY; 75 76 private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST); 76 77 %> … … 79 80 final String ID = sc.getId(); 80 81 final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType); 82 final boolean createRawBioAssayPermission = sc.hasPermission(Permission.CREATE, Item.RAWBIOASSAY); 81 83 final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); 82 84 83 85 final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); 84 86 final String callback = request.getParameter("callback"); 85 final String title = mode.generateTitle("derived bioassay set", "derived bioassay sets");87 final String title = mode.generateTitle("derived bioassay", "derived bioassays"); 86 88 final DbControl dc = sc.newDbControl(); 87 ItemResultIterator<DerivedBioAssay Set> bioAssaySets = null;89 ItemResultIterator<DerivedBioAssay> bioAssays = null; 88 90 ItemResultList<AnnotationType> annotationTypes = null; 89 91 try … … 92 94 final ItemQuery<ItemSubtype> subtypesQuery = Base.getSubtypesQuery(itemType); 93 95 94 // Query for extracts relatated to the current bioassay 95 /* 96 final ItemQuery<Extract> extractQuery = Extract.getQuery(); 97 extractQuery.include(cc.getInclude()); 98 extractQuery.join(Hql.innerJoin("sourceEvents", "srcevt")); 99 extractQuery.join(Hql.innerJoin("srcevt", "event", "evt")); 100 extractQuery.restrict(Restrictions.eq(Hql.property("evt", "physicalBioAssay"), Expressions.parameter("bioAssay"))); 101 extractQuery.order(Orders.asc(Hql.property("srcevt", "sourceGroup"))); 102 extractQuery.order(Orders.asc(Hql.property("name"))); 103 */ 104 105 // Query for child bioassay sets to the current bioassay set 106 final ItemQuery<DerivedBioAssaySet> childQuery = DerivedBioAssaySet.getQuery(); 96 // Query for child bioassays to the current bioassay 97 final ItemQuery<DerivedBioAssay> childQuery = DerivedBioAssay.getQuery(); 107 98 childQuery.include(cc.getInclude()); 108 childQuery.restrict(Restrictions.eq(Hql.property("parent"), Expressions.parameter("bioAssay Set")));99 childQuery.restrict(Restrictions.eq(Hql.property("parent"), Expressions.parameter("bioAssay"))); 109 100 childQuery.order(Orders.asc(Hql.property("name"))); 101 102 // Query for raw bioassays to the current bioassay 103 final ItemQuery<RawBioAssay> rawBioAssayQuery = RawBioAssay.getQuery(); 104 rawBioAssayQuery.include(cc.getInclude()); 105 rawBioAssayQuery.restrict(Restrictions.eq(Hql.property("parentBioAssay"), Expressions.parameter("bioAssay"))); 106 rawBioAssayQuery.order(Orders.asc(Hql.property("name"))); 110 107 111 108 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); … … 113 110 try 114 111 { 115 final ItemQuery<DerivedBioAssay Set> query = Base.getConfiguredQuery(dc, cc, true, DerivedBioAssaySet.getQuery(), mode);116 bioAssay Sets = query.iterate(dc);112 final ItemQuery<DerivedBioAssay> query = Base.getConfiguredQuery(dc, cc, true, DerivedBioAssay.getQuery(), mode); 113 bioAssays = query.iterate(dc); 117 114 } 118 115 catch (Throwable t) … … 126 123 ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); 127 124 %> 128 <base:page title="<%=title==null ? "Derived bioassay sets" : title%>" type="<%=mode.getPageType()%>">125 <base:page title="<%=title==null ? "Derived bioassays" : title%>" type="<%=mode.getPageType()%>"> 129 126 <base:head scripts="menu.js,table.js" styles="menu.css,table.css"> 130 127 <ext:scripts context="<%=jspContext%>" /> … … 132 129 <script language="JavaScript"> 133 130 var submitPage = 'index.jsp'; 134 var formId = 'bioassays ets';131 var formId = 'bioassays'; 135 132 function newItem() 136 133 { … … 206 203 Table.presetOnChange('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>'); 207 204 } 208 function newChildBioAssaySet(parentId) 209 { 210 Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAYSET', 0, true, '&parent_id='+parentId); 205 function newChildBioAssay(parentId) 206 { 207 Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAY', 0, true, '&parent_id='+parentId); 208 } 209 function newRawBioAssay(parentId) 210 { 211 Main.viewOrEditItem('<%=ID%>', 'RAWBIOASSAY', 0, true, '&bioassay_id='+parentId); 211 212 } 212 213 </script> … … 224 225 %> 225 226 <tbl:table 226 id="bioassays ets"227 id="bioassays" 227 228 clazz="itemlist" 228 229 columns="<%=cc.getSetting("columns")%>" … … 288 289 property="parent.name" 289 290 datatype="string" 290 title="Parent bioassay set"291 title="Parent bioassay" 291 292 sortable="true" 292 293 filterable="true" … … 295 296 <tbl:columndef 296 297 id="children" 297 title="Child bioassay sets"298 title="Child bioassays" 298 299 property="&children(name)" 300 datatype="string" 301 filterable="true" 302 exportable="true" 303 /> 304 <tbl:columndef 305 id="extract" 306 property="extract.name" 307 datatype="string" 308 title="Extract" 309 sortable="true" 310 filterable="true" 311 exportable="true" 312 /> 313 <tbl:columndef 314 id="rawBioAssays" 315 title="Raw bioassays" 316 property="&rawBioAssays(name)" 299 317 datatype="string" 300 318 filterable="true" … … 408 426 onclick="newItem()" 409 427 title="New…" 410 tooltip="<%=createPermission ? "Create new derived bioassay set" : "You do not have permission to create derived bioassay sets"%>"428 tooltip="<%=createPermission ? "Create new derived bioassay" : "You do not have permission to create derived bioassays"%>" 411 429 /> 412 430 <tbl:button … … 467 485 page="<%=cc.getPage()%>" 468 486 rowsperpage="<%=cc.getRowsPerPage()%>" 469 totalrows="<%=bioAssay Sets == null ? 0 : bioAssaySets.getTotalCount()%>"487 totalrows="<%=bioAssays == null ? 0 : bioAssays.getTotalCount()%>" 470 488 visible="<%=mode.hasNavigator()%>" 471 489 /> … … 506 524 int index = cc.getPage()*cc.getRowsPerPage(); 507 525 int selectedItemId = cc.getId(); 508 if (bioAssay Sets != null)526 if (bioAssays != null) 509 527 { 510 while (bioAssay Sets.hasNext())528 while (bioAssays.hasNext()) 511 529 { 512 DerivedBioAssay Set item = bioAssaySets.next();530 DerivedBioAssay item = bioAssays.next(); 513 531 int itemId = item.getId(); 514 532 boolean usePermission = item.hasPermission(Permission.USE); … … 574 592 <tbl:cell column="children"> 575 593 <% 576 childQuery.setParameter("bioAssay Set", itemId, Type.INT);594 childQuery.setParameter("bioAssay", itemId, Type.INT); 577 595 try 578 596 { 579 597 String separator = ""; 580 for (DerivedBioAssay Setchild : childQuery.list(dc))598 for (DerivedBioAssay child : childQuery.list(dc)) 581 599 { 582 600 out.write(separator); … … 601 619 <base:icon 602 620 image="add.png" 603 onclick="<%="newChildBioAssay Set("+itemId+")"%>"604 tooltip="Create new child bioassay set"621 onclick="<%="newChildBioAssay("+itemId+")"%>" 622 tooltip="Create new child bioassay" 605 623 visible="<%=mode.hasEditLink() && createPermission && usePermission %>" 624 /> 625 </tbl:cell> 626 <tbl:cell column="rawBioAssays"> 627 <% 628 rawBioAssayQuery.setParameter("bioAssay", itemId, Type.INT); 629 try 630 { 631 String separator = ""; 632 for (RawBioAssay rba : rawBioAssayQuery.list(dc)) 633 { 634 out.write(separator); 635 if (mode.hasPropertyLink()) 636 { 637 out.write(Base.getLinkedName(ID, rba, false, mode.hasEditLink())); 638 } 639 else 640 { 641 out.write(HTML.encodeTags(rba.getName())); 642 } 643 separator = ", "; 644 } 645 } 646 catch (Throwable t) 647 { 648 %> 649 <div class="error"><%=t.getMessage()%></div> 650 <% 651 } 652 %> 653 <base:icon 654 image="add.png" 655 onclick="<%="newRawBioAssay("+itemId+")"%>" 656 tooltip="Create new raw bioassay" 657 visible="<%=mode.hasEditLink() && createRawBioAssayPermission && usePermission %>" 606 658 /> 607 659 </tbl:cell> … … 617 669 item="<%=item%>" 618 670 property="parent" 671 enableEditLink="<%=mode.hasEditLink()%>" 672 enablePropertyLink="<%=mode.hasPropertyLink()%>" 673 /></tbl:cell> 674 <tbl:cell column="extract" 675 ><base:propertyvalue 676 item="<%=item%>" 677 property="extract" 619 678 enableEditLink="<%=mode.hasEditLink()%>" 620 679 enablePropertyLink="<%=mode.hasPropertyLink()%>" … … 703 762 { 704 763 %> 705 <tbl:panel><%=bioAssay Sets == null || bioAssaySets.getTotalCount() == 0 ? "No bioassay sets were found" : "No bioassay sets on this page. Please select another page!" %></tbl:panel>764 <tbl:panel><%=bioAssays == null || bioAssays.getTotalCount() == 0 ? "No bioassays were found" : "No bioassays on this page. Please select another page!" %></tbl:panel> 706 765 <% 707 766 } … … 712 771 page="<%=cc.getPage()%>" 713 772 rowsperpage="<%=cc.getRowsPerPage()%>" 714 totalrows="<%=bioAssay Sets == null ? 0 : bioAssaySets.getTotalCount()%>"773 totalrows="<%=bioAssays == null ? 0 : bioAssays.getTotalCount()%>" 715 774 visible="<%=mode.hasNavigator()%>" 716 775 locked="true" … … 732 791 finally 733 792 { 734 if (bioAssay Sets != null) bioAssaySets.close();793 if (bioAssays != null) bioAssays.close(); 735 794 if (dc != null) dc.close(); 736 795 } -
trunk/www/views/derivedbioassays/view_bioassay.jsp
r5684 r5685 21 21 22 22 --%> 23 <%@page import="net.sf.basedb.core.RawBioAssay"%> 23 24 <%@ page pageEncoding="UTF-8" session="false" 24 25 import="net.sf.basedb.core.SessionControl" 25 26 import="net.sf.basedb.core.DbControl" 26 import="net.sf.basedb.core.DerivedBioAssaySet"27 27 import="net.sf.basedb.core.DerivedBioAssay" 28 28 import="net.sf.basedb.core.PhysicalBioAssay" … … 75 75 <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> 76 76 <%! 77 private static final Item itemType = Item.DERIVEDBIOASSAY SET;77 private static final Item itemType = Item.DERIVEDBIOASSAY; 78 78 private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM); 79 79 %> … … 93 93 94 94 String title = null; 95 final DerivedBioAssay Set bioAssaySet = DerivedBioAssaySet.getById(dc, itemId);95 final DerivedBioAssay bioAssay = DerivedBioAssay.getById(dc, itemId); 96 96 97 97 Job job = null; … … 104 104 try 105 105 { 106 job = bioAssay Set.getJob();106 job = bioAssay.getJob(); 107 107 } 108 108 catch (PermissionDeniedException ex) … … 132 132 } 133 133 134 final boolean usePermission = bioAssay Set.hasPermission(Permission.USE);135 final boolean writePermission = bioAssay Set.hasPermission(Permission.WRITE);136 final boolean deletePermission = bioAssay Set.hasPermission(Permission.DELETE);137 final boolean sharePermission = bioAssay Set.hasPermission(Permission.SET_PERMISSION);138 final boolean setOwnerPermission = bioAssay Set.hasPermission(Permission.SET_OWNER);139 final boolean isRemoved = bioAssay Set.isRemoved();140 final boolean isUsed = isRemoved && bioAssay Set.isUsed();134 final boolean usePermission = bioAssay.hasPermission(Permission.USE); 135 final boolean writePermission = bioAssay.hasPermission(Permission.WRITE); 136 final boolean deletePermission = bioAssay.hasPermission(Permission.DELETE); 137 final boolean sharePermission = bioAssay.hasPermission(Permission.SET_PERMISSION); 138 final boolean setOwnerPermission = bioAssay.hasPermission(Permission.SET_OWNER); 139 final boolean isRemoved = bioAssay.isRemoved(); 140 final boolean isUsed = isRemoved && bioAssay.isUsed(); 141 141 final boolean deletePermanentlyPermission = deletePermission && !isUsed; 142 final boolean isOwner = bioAssay Set.isOwner();142 final boolean isOwner = bioAssay.isOwner(); 143 143 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); 144 144 Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); 145 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, bioAssay Set);145 JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, bioAssay); 146 146 ExtensionsInvoker toolbarInvoker = ToolbarUtil.useExtensions(jspContext); 147 147 %> … … 165 165 function shareItem() 166 166 { 167 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id=<%=itemId%>', 'ShareBioAssay Set', 600, 400);167 Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id=<%=itemId%>', 'ShareBioAssay', 600, 400); 168 168 } 169 169 function setOwner() … … 187 187 Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540); 188 188 } 189 function newChildBioAssaySet() 190 { 191 Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAYSET', 0, true, '&parent_id=<%=itemId%>'); 189 function newChildBioAssay() 190 { 191 Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAY', 0, true, '&parent_id=<%=itemId%>'); 192 } 193 function newRawBioAssay() 194 { 195 Main.viewOrEditItem('<%=ID%>', 'RAWBIOASSAY', 0, true, '&bioassay_id=<%=itemId%>'); 192 196 } 193 197 </script> … … 196 200 <p> 197 201 <p:path> 198 <p:pathelement title="Derived bioassay sets" href="<%="index.jsp?ID="+ID%>" />199 <p:pathelement title="<%=HTML.encodeTags(bioAssay Set.getName())%>" />202 <p:pathelement title="Derived bioassays" href="<%="index.jsp?ID="+ID%>" /> 203 <p:pathelement title="<%=HTML.encodeTags(bioAssay.getName())%>" /> 200 204 </p:path> 201 205 … … 209 213 onclick="editItem()" 210 214 title="Edit…" 211 tooltip="<%=writePermission ? "Edit this bioassay set" : "You do not have permission to edit this bioassay set"%>"215 tooltip="<%=writePermission ? "Edit this bioassay" : "You do not have permission to edit this bioassay"%>" 212 216 /> 213 217 <tbl:button … … 216 220 onclick="deleteItem()" 217 221 title="Delete" 218 visible="<%=!bioAssay Set.isRemoved()%>"219 tooltip="<%=deletePermission ? "Delete this bioassay set" : "You do not have permission to delete this bioassay set"%>"222 visible="<%=!bioAssay.isRemoved()%>" 223 tooltip="<%=deletePermission ? "Delete this bioassay" : "You do not have permission to delete this bioassay"%>" 220 224 /> 221 225 <tbl:button … … 224 228 onclick="restoreItem()" 225 229 title="Restore" 226 visible="<%=bioAssay Set.isRemoved()%>"227 tooltip="<%=writePermission ? "Restore this bioassay set" : "You do not have permission to restore this bioassay set"%>"230 visible="<%=bioAssay.isRemoved()%>" 231 tooltip="<%=writePermission ? "Restore this bioassay" : "You do not have permission to restore this bioassay"%>" 228 232 /> 229 233 <tbl:button … … 232 236 onclick="shareItem()" 233 237 title="Share…" 234 tooltip="<%=sharePermission ? "Share this bioassay set to other user, groups and projects" : "You do not have permission to share this bioassay set"%>"238 tooltip="<%=sharePermission ? "Share this bioassay to other user, groups and projects" : "You do not have permission to share this bioassay"%>" 235 239 /> 236 240 <tbl:button … … 243 247 <tbl:button 244 248 image="add.png" 245 onclick="newChildBioAssaySet()" 246 title="New child bioassay set…" 247 tooltip="Create a child bioassay set from this bioassay set" 248 visible="<%=sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAYSET) && usePermission%>" 249 onclick="newChildBioAssay()" 250 title="New child bioassay…" 251 tooltip="Create a child bioassay from this bioassay" 252 visible="<%=sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAY) && usePermission%>" 253 /> 254 <tbl:button 255 image="add.png" 256 onclick="newRawBioAssay()" 257 title="New raw bioassay…" 258 tooltip="Create a raw bioassay from this bioassay" 259 visible="<%=sc.hasPermission(Permission.CREATE, Item.RAWBIOASSAY) && usePermission%>" 249 260 /> 250 261 <tbl:button … … 273 284 <tbl:button 274 285 image="help.gif" 275 onclick="<%="Main.openHelp('" + ID +"', 'derivedbioassay set.view.properties')"%>"286 onclick="<%="Main.openHelp('" + ID +"', 'derivedbioassay.view.properties')"%>" 276 287 title="Help…" 277 288 tooltip="Get help about this page" … … 279 290 </tbl:toolbar> 280 291 <div class="boxedbottom"> 281 <div class="itemstatus">Permissions on this item: <i><%=PermissionUtil.getFullPermissionNames(bioAssay Set)%></i></div>292 <div class="itemstatus">Permissions on this item: <i><%=PermissionUtil.getFullPermissionNames(bioAssay)%></i></div> 282 293 <% 283 if (isRemoved || bioAssay Set.isShared())294 if (isRemoved || bioAssay.isShared()) 284 295 { 285 296 %> … … 295 306 visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon> 296 307 <base:icon image="shared.gif" 297 visible="<%=bioAssay Set.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon>308 visible="<%=bioAssay.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon> 298 309 </div> 299 310 <% … … 308 319 <tr> 309 320 <td class="prompt">Name</td> 310 <td><%=HTML.encodeTags(bioAssay Set.getName())%></td>321 <td><%=HTML.encodeTags(bioAssay.getName())%></td> 311 322 </tr> 312 323 <tr> 313 324 <td class="prompt">Type</td> 314 <td><base:propertyvalue item="<%=bioAssay Set%>" property="itemSubtype" /></td>325 <td><base:propertyvalue item="<%=bioAssay%>" property="itemSubtype" /></td> 315 326 </tr> 316 327 <tr> 317 328 <td class="prompt">Physical bioassay</td> 318 <td><base:propertyvalue item="<%=bioAssaySet%>" property="physicalBioAssay" /></td> 319 </tr> 320 <tr> 321 <td class="prompt">Parent bioassay set</td> 322 <td><base:propertyvalue item="<%=bioAssaySet%>" property="parent" /></td> 329 <td><base:propertyvalue item="<%=bioAssay%>" property="physicalBioAssay" /></td> 330 </tr> 331 <tr> 332 <td class="prompt">Parent bioassay</td> 333 <td><base:propertyvalue item="<%=bioAssay%>" property="parent" /></td> 334 </tr> 335 <tr> 336 <td class="prompt">Extract</td> 337 <td><base:propertyvalue item="<%=bioAssay%>" property="extract" /></td> 323 338 </tr> 324 339 <tr> 325 340 <td class="prompt">Protocol</td> 326 <td><base:propertyvalue item="<%=bioAssay Set%>" property="protocol" /></td>341 <td><base:propertyvalue item="<%=bioAssay%>" property="protocol" /></td> 327 342 </tr> 328 343 <tr> 329 344 <td class="prompt">Hardware</td> 330 <td><base:propertyvalue item="<%=bioAssay Set%>" property="hardware" /></td>345 <td><base:propertyvalue item="<%=bioAssay%>" property="hardware" /></td> 331 346 </tr> 332 347 <tr> 333 348 <td class="prompt">Software</td> 334 <td><base:propertyvalue item="<%=bioAssay Set%>" property="software" /></td>349 <td><base:propertyvalue item="<%=bioAssay%>" property="software" /></td> 335 350 </tr> 336 351 <tr> 337 352 <td class="prompt">Owner</td> 338 <td><base:propertyvalue item="<%=bioAssay Set%>" property="owner" /></td>353 <td><base:propertyvalue item="<%=bioAssay%>" property="owner" /></td> 339 354 </tr> 340 355 <tr> 341 356 <td class="prompt">Description</td> 342 <td><%=HTML.niceFormat(bioAssay Set.getDescription())%></td>357 <td><%=HTML.niceFormat(bioAssay.getDescription())%></td> 343 358 </tr> 344 359 </table> … … 469 484 470 485 <% 471 ItemQuery<DerivedBioAssay> bioAssayQuery = bioAssaySet.getBioAssays();472 bioAssayQuery.include(Include.ALL);473 bioAssayQuery.order(Orders.asc(Hql.property("name")));474 ItemResultList<DerivedBioAssay> bioAssays = bioAssayQuery.list(dc);475 if ( bioAssays.size() == 0)486 ItemQuery<DerivedBioAssay> childQuery = bioAssay.getChildren(); 487 childQuery.include(Include.ALL); 488 childQuery.order(Orders.asc(Hql.property("name"))); 489 ItemResultList<DerivedBioAssay> children = childQuery.list(dc); 490 if (children.size() == 0) 476 491 { 477 492 %> 478 <h4>Bioassays</h4> 479 This bioassay set doesn't have any bioassays. 493 <h4>Child bioassays</h4> 494 This bioassay doesn't have any child bioassays 495 (or you don't have permission to view them). 480 496 <% 481 497 } … … 484 500 %> 485 501 <base:section 486 id="bioAssays"487 title="<%="Bioassays (" + bioAssays.size() + ")"%>"488 context="<%=cc%>"489 >490 <tbl:table491 id="bioAssays"492 clazz="itemlist"493 columns="all"494 >495 <tbl:columndef496 id="name"497 title="Name"498 />499 <tbl:columndef500 id="extract"501 title="Extract"502 />503 <tbl:columndef504 id="description"505 title="Description"506 />507 <tbl:data>508 <tbl:columns>509 </tbl:columns>510 <tbl:rows>511 <%512 for (DerivedBioAssay item : bioAssays)513 {514 %>515 <tbl:row>516 <tbl:cell column="name"><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell>517 <tbl:cell column="extract"><base:propertyvalue item="<%=item%>" property="extract" /></tbl:cell>518 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>519 </tbl:row>520 <%521 }522 %>523 </tbl:rows>524 </tbl:data>525 </tbl:table>526 </base:section>527 <%528 }529 %>530 531 <%532 ItemQuery<DerivedBioAssaySet> childQuery = bioAssaySet.getChildren();533 childQuery.include(Include.ALL);534 childQuery.order(Orders.asc(Hql.property("name")));535 ItemResultList<DerivedBioAssaySet> children = childQuery.list(dc);536 if (children.size() == 0)537 {538 %>539 <h4>Child bioassay sets</h4>540 This bioassay set doesn't have any child bioassay set.541 <%542 }543 else544 {545 %>546 <base:section547 502 id="children" 548 title="<%="Child bioassay sets (" + children.size() + ")"%>"503 title="<%="Child bioassays (" + children.size() + ")"%>" 549 504 context="<%=cc%>" 550 505 > … … 571 526 <tbl:rows> 572 527 <% 573 for (DerivedBioAssay Setitem : children)528 for (DerivedBioAssay item : children) 574 529 { 575 530 %> … … 590 545 %> 591 546 547 <% 548 ItemQuery<RawBioAssay> rawQuery = bioAssay.getRawBioAssays(); 549 rawQuery.include(Include.ALL); 550 rawQuery.order(Orders.asc(Hql.property("name"))); 551 ItemResultList<RawBioAssay> rawBioAssays = rawQuery.list(dc); 552 if (rawBioAssays.size() == 0) 553 { 554 %> 555 <h4>Raw bioassays</h4> 556 This bioassay doesn't have any child raw bioassays 557 (or you don't have permission to view them). 558 <% 559 } 560 else 561 { 562 %> 563 <base:section 564 id="children" 565 title="<%="Raw bioassays (" + rawBioAssays.size() + ")"%>" 566 context="<%=cc%>" 567 > 568 <tbl:table 569 id="rawBioAssays" 570 clazz="itemlist" 571 columns="all" 572 > 573 <tbl:columndef 574 id="name" 575 title="Name" 576 /> 577 <tbl:columndef 578 id="platform" 579 title="Platform" 580 /> 581 <tbl:columndef 582 id="description" 583 title="Description" 584 /> 585 <tbl:data> 586 <tbl:columns> 587 </tbl:columns> 588 <tbl:rows> 589 <% 590 for (RawBioAssay item : rawBioAssays) 591 { 592 %> 593 <tbl:row> 594 <tbl:cell column="name"><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 595 <tbl:cell column="platform"><base:propertyvalue item="<%=item%>" property="platform" /></tbl:cell> 596 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 597 </tbl:row> 598 <% 599 } 600 %> 601 </tbl:rows> 602 </tbl:data> 603 </tbl:table> 604 </base:section> 605 <% 606 } 607 %> 592 608 593 609 <jsp:include page="../../common/datafiles/list_files.jsp"> -
trunk/www/views/physicalbioassays/index.jsp
r5662 r5685 37 37 import="net.sf.basedb.core.Hardware" 38 38 import="net.sf.basedb.core.ItemSubtype" 39 import="net.sf.basedb.core.DerivedBioAssay Set"39 import="net.sf.basedb.core.DerivedBioAssay" 40 40 import="net.sf.basedb.core.ItemQuery" 41 41 import="net.sf.basedb.core.ItemResultIterator" … … 83 83 { 84 84 // Register formatters 85 cc.setObject("export.formatter.&creationEvent.source BioMaterials(name)", new NameableFormatter());86 cc.setObject("export.formatter.& scans(name)", new NameableFormatter());85 cc.setObject("export.formatter.&creationEvent.sources(bioMaterial.name)", new NameableFormatter()); 86 cc.setObject("export.formatter.&rootDerivedBioAssays(name)", new NameableFormatter()); 87 87 88 88 // Register dataloaders … … 90 90 ItemQuery<Extract> extractQuery = Extract.getQuery(); 91 91 extractQuery.include(cc.getInclude()); 92 extractQuery.join(Hql.innerJoin(" sourceEvents", "srcevt"));93 extractQuery.join(Hql.innerJoin(" srcevt", "event", "evt"));92 extractQuery.join(Hql.innerJoin("childCreationEvents", "cce")); 93 extractQuery.join(Hql.innerJoin("cce", "event", "evt")); 94 94 extractQuery.restrict(Restrictions.eq(Hql.property("evt", "physicalBioAssay"), Expressions.parameter(bioassayParameter))); 95 95 extractQuery.order(Orders.asc(Hql.property("name"))); 96 cc.setObject("export.dataloader.&creationEvent.source BioMaterials(name)", new ItemQueryLoader(extractQuery, bioassayParameter));97 98 ItemQuery<DerivedBioAssay Set> dbasQuery = DerivedBioAssaySet.getQuery();96 cc.setObject("export.dataloader.&creationEvent.sources(bioMaterial.name)", new ItemQueryLoader(extractQuery, bioassayParameter)); 97 98 ItemQuery<DerivedBioAssay> dbasQuery = DerivedBioAssay.getQuery(); 99 99 dbasQuery.include(cc.getInclude()); 100 100 dbasQuery.restrict(Restrictions.eq(Hql.property("physicalBioAssay"), Expressions.parameter(bioassayParameter))); 101 101 dbasQuery.restrict(Restrictions.eq(Hql.property("parent"), null)); 102 102 dbasQuery.order(Orders.asc(Hql.property("name"))); 103 cc.setObject("export.dataloader.&rootDerivedBioAssay Sets(name)", new ItemQueryLoader(dbasQuery, bioassayParameter));103 cc.setObject("export.dataloader.&rootDerivedBioAssays(name)", new ItemQueryLoader(dbasQuery, bioassayParameter)); 104 104 } 105 105 %> -
trunk/www/views/physicalbioassays/list_bioassays.jsp
r5674 r5685 31 31 import="net.sf.basedb.core.Extract" 32 32 import="net.sf.basedb.core.Tag" 33 import="net.sf.basedb.core.DerivedBioAssay Set"33 import="net.sf.basedb.core.DerivedBioAssay" 34 34 import="net.sf.basedb.core.BioMaterialEvent" 35 35 import="net.sf.basedb.core.BioMaterialEventSource" … … 108 108 109 109 // Query for derived bioassay sets from to the current bioassay 110 final ItemQuery<DerivedBioAssay Set> dbasQuery = DerivedBioAssaySet.getQuery();110 final ItemQuery<DerivedBioAssay> dbasQuery = DerivedBioAssay.getQuery(); 111 111 dbasQuery.include(cc.getInclude()); 112 112 dbasQuery.restrict(Restrictions.eq(Hql.property("physicalBioAssay"), Expressions.parameter("bioAssay"))); 113 113 dbasQuery.restrict(Restrictions.eq(Hql.property("parent"), null)); 114 114 dbasQuery.order(Orders.asc(Hql.property("name"))); 115 final boolean createDerivedBioAssay SetPermission = sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAYSET);115 final boolean createDerivedBioAssayPermission = sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAY); 116 116 117 117 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); … … 212 212 Table.presetOnChange('<%=ID%>', formId, '<%=itemType.name()%>', '<%=(String)cc.getObject("defaultColumns")%>'); 213 213 } 214 function newDerivedBioAssay Set(bioAssayId)215 { 216 Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAY SET', 0, true, '&physicalbioassay_id='+bioAssayId);214 function newDerivedBioAssay(bioAssayId) 215 { 216 Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAY', 0, true, '&physicalbioassay_id='+bioAssayId); 217 217 } 218 218 </script> … … 308 308 /> 309 309 <tbl:columndef 310 id="derivedBioAssay Sets"311 title="Derived bioassay sets"312 property="&rootDerivedBioAssay Sets(name)"310 id="derivedBioAssays" 311 title="Derived bioassays" 312 property="&rootDerivedBioAssays(name)" 313 313 datatype="string" 314 314 filterable="true" … … 641 641 enablePropertyLink="<%=mode.hasPropertyLink()%>" 642 642 /></tbl:cell> 643 <tbl:cell column="derivedBioAssay Sets">643 <tbl:cell column="derivedBioAssays"> 644 644 <% 645 645 dbasQuery.setParameter("bioAssay", itemId, Type.INT); … … 647 647 { 648 648 String separator = ""; 649 for (DerivedBioAssay Setdbas : dbasQuery.list(dc))649 for (DerivedBioAssay dbas : dbasQuery.list(dc)) 650 650 { 651 651 out.write(separator); … … 670 670 <base:icon 671 671 image="add.png" 672 onclick="<%="newDerivedBioAssay Set("+itemId+")"%>"673 tooltip="Create new derived bioassay set"674 visible="<%=mode.hasEditLink() && createDerivedBioAssay SetPermission && usePermission %>"672 onclick="<%="newDerivedBioAssay("+itemId+")"%>" 673 tooltip="Create new derived bioassay" 674 visible="<%=mode.hasEditLink() && createDerivedBioAssayPermission && usePermission %>" 675 675 /> 676 676 </tbl:cell> -
trunk/www/views/physicalbioassays/view_bioassay.jsp
r5664 r5685 39 39 import="net.sf.basedb.core.BioMaterialEventSource" 40 40 import="net.sf.basedb.core.Protocol" 41 import="net.sf.basedb.core.DerivedBioAssay Set"41 import="net.sf.basedb.core.DerivedBioAssay" 42 42 import="net.sf.basedb.core.Group" 43 43 import="net.sf.basedb.core.Hardware" … … 167 167 } 168 168 } 169 function newDerivedBioAssay Set()170 { 171 Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAY SET', 0, true, '&physicalbioassay_id=<%=itemId%>');169 function newDerivedBioAssay() 170 { 171 Main.viewOrEditItem('<%=ID%>', 'DERIVEDBIOASSAY', 0, true, '&physicalbioassay_id=<%=itemId%>'); 172 172 } 173 173 </script> … … 223 223 <tbl:button 224 224 image="add.png" 225 onclick="newDerivedBioAssay Set()"226 title="New derived bioassay set…"227 tooltip="Create a derived bioassay setfrom this bioassay"228 visible="<%=sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAY SET) && usePermission%>"225 onclick="newDerivedBioAssay()" 226 title="New derived bioassay…" 227 tooltip="Create a derived bioassay from this bioassay" 228 visible="<%=sc.hasPermission(Permission.CREATE, Item.DERIVEDBIOASSAY) && usePermission%>" 229 229 /> 230 230 <tbl:button … … 280 280 } 281 281 %> 282 <a href="ajax.jsp?ID=<%=ID%>&item_id=<%=itemId %>&cmd=GetSources">test sources</a> 282 283 <table class="form" cellspacing="0"> 283 284 <tr> … … 412 413 413 414 <% 414 ItemQuery<DerivedBioAssay Set> childQuery = pba.getDerivedBioAssaySets();415 ItemQuery<DerivedBioAssay> childQuery = pba.getRootDerivedBioAssays(); 415 416 childQuery.include(Include.ALL); 416 417 childQuery.order(Orders.asc(Hql.property("name"))); 417 ItemResultList<DerivedBioAssay Set> children = childQuery.list(dc);418 ItemResultList<DerivedBioAssay> children = childQuery.list(dc); 418 419 if (children.size() == 0) 419 420 { 420 421 %> 421 <h4>Derived bioassay sets</h4>422 This bioassay doesn't have any derived bioassay sets.422 <h4>Derived bioassays</h4> 423 This bioassay doesn't have any derived bioassays. 423 424 <% 424 425 } … … 428 429 <base:section 429 430 id="children" 430 title="<%="Derived bioassay sets (" + children.size() + ")"%>"431 title="<%="Derived bioassays (" + children.size() + ")"%>" 431 432 context="<%=cc%>" 432 433 > … … 453 454 <tbl:rows> 454 455 <% 455 for (DerivedBioAssay Setitem : children)456 for (DerivedBioAssay item : children) 456 457 { 457 458 %> -
trunk/www/views/rawbioassays/edit_rawbioassay.jsp
r5657 r5685 40 40 import="net.sf.basedb.core.Software" 41 41 import="net.sf.basedb.core.ArrayDesign" 42 import="net.sf.basedb.core.Extract" 43 import="net.sf.basedb.core.DerivedBioAssay" 42 44 import="net.sf.basedb.core.ItemSubtype" 43 45 import="net.sf.basedb.core.File" … … 87 89 PlatformVariant defaultVariant = null; 88 90 91 boolean readCurrentBioAssay = true; 92 DerivedBioAssay currentBioAssay = null; 93 boolean readCurrentExtract = true; 94 Extract currentExtract = null; 89 95 boolean readCurrentProtocol = true; 90 96 Protocol currentProtocol = null; … … 104 110 List<ArrayDesign> recentArrayDesigns = (List<ArrayDesign>)cc.getRecent(dc, Item.ARRAYDESIGN); 105 111 List<File> recentFiles = (List<File>)cc.getRecent(dc, Item.FILE); 112 List<DerivedBioAssay> recentBioAssays = (List<DerivedBioAssay>)cc.getRecent(dc, Item.DERIVEDBIOASSAY); 113 List<Extract> recentExtracts = (List<Extract>)cc.getRecent(dc, Item.EXTRACT); 106 114 107 115 int activeProjectId = sc.getActiveProjectId(); … … 178 186 if (currentRawDataType == null) currentRawDataType = defaultRawDataType; 179 187 180 name = Values.getString(cc.getPropertyValue("name"), "New raw bioassay"); 188 189 int bioAssayId = Values.getInt(request.getParameter("bioassay_id")); 190 if (bioAssayId != 0) 191 { 192 currentBioAssay = DerivedBioAssay.getById(dc, bioAssayId); 193 } 194 else if (cc.getPropertyFilter("derivedBioAssay.name") != null) 195 { 196 currentBioAssay = Base.getFirstMatching(dc, DerivedBioAssay.getQuery(), "name", cc.getPropertyFilter("derivedBioAssay.name")); 197 } 198 199 if (currentBioAssay != null) 200 { 201 name = currentBioAssay.getName() + ".r" + (currentBioAssay.countRawBioAssays() + 1); 202 } 203 else 204 { 205 name = Values.getString(cc.getPropertyValue("name"), "New raw bioassay"); 206 } 207 181 208 if (cc.getPropertyFilter("protocol.name") != null) 182 209 { … … 188 215 currentSoftware = Base.getFirstMatching(dc, Software.getQuery(), "name", cc.getPropertyFilter("software.name")); 189 216 } 190 /* 191 if (current Scan!= null)217 218 if (currentBioAssay != null) 192 219 { 193 220 try 194 221 { 195 currentArrayDesign = current Scan.getArrayDesign();222 currentArrayDesign = currentBioAssay.getArrayDesign(); 196 223 } 197 224 catch (PermissionDeniedException ex) 198 225 {} 199 } 200 */ 226 try 227 { 228 currentExtract = currentBioAssay.getExtract(); 229 } 230 catch (PermissionDeniedException ex) 231 {} 232 } 201 233 if (currentArrayDesign == null && cc.getPropertyFilter("arrayDesign.name") != null) 202 234 { … … 229 261 } 230 262 263 try 264 { 265 currentBioAssay = rawBioAssay.getParentBioAssay(); 266 } 267 catch (PermissionDeniedException ex) 268 { 269 readCurrentBioAssay = false; 270 } 271 try 272 { 273 currentExtract = rawBioAssay.getParentExtract(); 274 } 275 catch (PermissionDeniedException ex) 276 { 277 readCurrentExtract = false; 278 } 231 279 try 232 280 { … … 396 444 var parents = new Array(); 397 445 446 var bioAssayId = Math.abs(parseInt(frm.bioassay_id[frm.bioassay_id.selectedIndex].value)); 447 if (bioAssayId > 0) parents[parents.length] = 'DERIVEDBIOASSAY:'+bioAssayId; 448 var extractId = Math.abs(parseInt(frm.bioassay_id[frm.extract_id.selectedIndex].value)); 449 if (extractId > 0) parents[parents.length] = 'EXTRACT:'+extractId; 398 450 if (frm.arraydesign_id) 399 451 { … … 433 485 protocolChanged = true; 434 486 } 487 488 function bioAssayOnChange() 489 { 490 var frm = document.forms['rawbioassay']; 491 var selectedIndex = frm.bioassay_id.selectedIndex 492 var bioAssayId = frm.bioassay_id[selectedIndex].value; 493 if (bioAssayId > 0) updateArrayDesign(bioAssayId); 494 parentsChanged = true; 495 } 496 function selectBioAssayOnClick() 497 { 498 var frm = document.forms['rawbioassay']; 499 var url = '../derivedbioassays/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setBioAssayCallback'; 500 if (frm.bioassay_id.length > 1) 501 { 502 var id = Math.abs(parseInt(frm.bioassay_id[1].value)); 503 url += '&item_id='+id; 504 } 505 Main.openPopup(url, 'SelectDerivedBioAssay', 1000, 700); 506 } 507 function setBioAssayCallback(id, name) 508 { 509 var frm = document.forms['rawbioassay']; 510 var list = frm.bioassay_id; 511 if (list.length < 2 || list[1].value == '0') // > 512 { 513 Forms.addListOption(list, 1, new Option()); 514 } 515 list[1].value = id; 516 list[1].text = name; 517 list.selectedIndex = 1; 518 updateArrayDesign(id) 519 parentsChanged = true; 520 } 521 435 522 436 523 function selectSoftwareOnClick() … … 507 594 parentsChanged = true; 508 595 arrayDesignOnChange(); 596 } 597 598 function updateArrayDesign(bioAssayId) 599 { 600 var request = Ajax.getXmlHttpRequest(); 601 if (request != null) 602 { 603 var url = '../derivedbioassays/ajax.jsp?ID=<%=ID%>&cmd=GetArrayDesign&item_id=' + bioAssayId; 604 request.open("GET", url, true); 605 Ajax.setReadyStateHandler(request, updateArrayDesignCallback); 606 request.send(null); 607 } 608 return request != null; 609 } 610 function updateArrayDesignCallback(request) 611 { 612 var frm = document.forms['rawbioassay']; 613 var response = Ajax.parseJsonResponse(request.responseText); 614 if (response.status != 'ok') 615 { 616 alert(response.message); 617 return false; 618 } 619 620 if (response.id) 621 { 622 var designList = frm.arraydesign_id; 623 if (designList.length < 2 || designList[1].value == '0') // > 624 { 625 Forms.addListOption(designList, 1, new Option()); 626 } 627 designList[1].value = response.id; 628 designList[1].text = response.name; 629 designList.selectedIndex = 1; 630 } 509 631 } 510 632 … … 608 730 </td> 609 731 </tr> 610 732 <tr> 733 <td class="prompt">Parent bioassay</td> 734 <td> 735 <base:select 736 id="bioassay_id" 737 clazz="selectionlist" 738 required="false" 739 current="<%=currentBioAssay%>" 740 denied="<%=!readCurrentBioAssay%>" 741 recent="<%=recentBioAssays%>" 742 newitem="<%=rawBioAssay == null%>" 743 onselect="selectBioAssayOnClick()" 744 onchange="bioAssayOnChange()" 745 /> 746 </td> 747 </tr> 748 <tr> 749 <td class="prompt">Parent extract</td> 750 <td> 751 <base:select 752 id="extract_id" 753 clazz="selectionlist" 754 required="false" 755 current="<%=currentExtract%>" 756 denied="<%=!readCurrentExtract%>" 757 recent="<%=recentExtracts%>" 758 newitem="<%=rawBioAssay == null%>" 759 onselect="selectExtractOnClick()" 760 onchange="extractOnChange()" 761 /> 762 </td> 763 </tr> 611 764 <tr> 612 765 <td class="prompt">Array design</td> -
trunk/www/views/rawbioassays/index.jsp
r5657 r5685 36 36 import="net.sf.basedb.core.Software" 37 37 import="net.sf.basedb.core.ArrayDesign" 38 import="net.sf.basedb.core.Extract" 39 import="net.sf.basedb.core.DerivedBioAssay" 38 40 import="net.sf.basedb.core.Experiment" 39 41 import="net.sf.basedb.core.File" … … 311 313 if (sw != null) cc.setRecent(sw, maxRecent); 312 314 } 315 int bioAssayId = Values.getInt(request.getParameter("bioassay_id"), -1); 316 if (bioAssayId >= 0) // < 0 = denied or unchanged 317 { 318 DerivedBioAssay bioAssay = bioAssayId == 0 ? null : DerivedBioAssay.getById(dc, bioAssayId); 319 rba.setParentBioAssay(bioAssay); 320 if (bioAssay != null) cc.setRecent(bioAssay, maxRecent); 321 } 322 int extractId = Values.getInt(request.getParameter("extract_id"), -1); 323 if (extractId >= 0) // < 0 = denied or unchanged 324 { 325 Extract extract = extractId == 0 ? null : Extract.getById(dc, extractId); 326 rba.setParentExtract(extract); 327 if (extract != null) cc.setRecent(extract, maxRecent); 328 } 313 329 314 330 Job job = null; -
trunk/www/views/rawbioassays/list_rawbioassays.jsp
r5674 r5685 373 373 /> 374 374 <tbl:columndef 375 id="parent" 376 property="parent.name" 377 datatype="string" 378 title="Parent" 375 id="parentBioAssay" 376 property="parentBioAssay.name" 377 datatype="string" 378 title="Parent bioassay" 379 sortable="true" 380 filterable="true" 381 exportable="true" 382 /> 383 <tbl:columndef 384 id="parentExtract" 385 property="parentExtract.name" 386 datatype="string" 387 title="Parent extract" 379 388 sortable="true" 380 389 filterable="true" … … 714 723 <tbl:cell column="rawDataType"><%=HTML.encodeTags(item.getRawDataType().getName())%></tbl:cell> 715 724 <tbl:cell column="hasData"><%=item.hasData()%></tbl:cell> 716 <tbl:cell column="parent "725 <tbl:cell column="parentBioAssay" 717 726 ><base:propertyvalue 718 727 item="<%=item%>" 719 property="parent" 728 property="parentBioAssay" 729 enableEditLink="<%=mode.hasEditLink()%>" 730 enablePropertyLink="<%=mode.hasPropertyLink()%>" 731 /></tbl:cell> 732 <tbl:cell column="parentExtract" 733 ><base:propertyvalue 734 item="<%=item%>" 735 property="parentExtract" 720 736 enableEditLink="<%=mode.hasEditLink()%>" 721 737 enablePropertyLink="<%=mode.hasPropertyLink()%>" -
trunk/www/views/rawbioassays/view_rawbioassay.jsp
r5657 r5685 335 335 </tr> 336 336 <tr> 337 <td class="prompt">Array index</td>338 <td><%=rawBioAssay.getArrayNum()%></td>339 </tr>340 <tr>341 337 <td class="prompt">Spots</td> 342 338 <td><%=rawBioAssay.hasData() ? "yes (db: " + rawBioAssay.getNumDbSpots() + … … 344 340 </tr> 345 341 <tr> 342 <td class="prompt">Parent bioassay</td> 343 <td><base:propertyvalue item="<%=rawBioAssay%>" property="parentBioAssay" /></td> 344 </tr> 345 <tr> 346 <td class="prompt">Parent extract</td> 347 <td><base:propertyvalue item="<%=rawBioAssay%>" property="parentExtract" /></td> 348 </tr> 349 <tr> 346 350 <td class="prompt">Protocol</td> 347 351 <td><base:propertyvalue item="<%=rawBioAssay%>" property="protocol" /></td> 348 </tr>349 <tr>350 <td class="prompt">Parent bioassay</td>351 <td><base:propertyvalue item="<%=rawBioAssay%>" property="parent" /></td>352 352 </tr> 353 353 <tr>
Note: See TracChangeset
for help on using the changeset viewer.