Changeset 6994
- Timestamp:
- Nov 3, 2015, 9:47:41 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/Install.java
r6993 r6994 480 480 ItemSubtypeData libraryPrepKit = createItemSubtype(Item.KIT, Kit.LIBRARY_PREPARATION, 481 481 "Library preparation", "Kits used for creating libraries."); 482 ItemSubtypeData hybKit = createItemSubtype(Item.KIT, Kit.HYBRIDIZATION, 483 "Hybridization", "Kits used for creating hybridizations."); 484 ItemSubtypeData clusterKit = createItemSubtype(Item.KIT, Kit.CLUSTER_GENERATION, 485 "Cluster generation", "Kits used for cluster generation in a flow cell"); 482 486 483 487 // Hardware subtypes … … 518 522 ItemSubtypeData hybridization = createItemSubtype(Item.PHYSICALBIOASSAY, PhysicalBioAssay.HYBRIDIZATION, 519 523 "Hybridization", "A bioassay representing a microarray slide with labeled extracts.", 520 hybProtocol, hybStation, labeledExtract);524 hybProtocol, hybStation, hybKit, labeledExtract); 521 525 ItemSubtypeData clonalAmplification = createItemSubtype(Item.PHYSICALBIOASSAY, PhysicalBioAssay.CLONAL_AMPLIFICATION, 522 "Clonal amplification", "A bioassay representing extracts that has been amplified in preparation for sequencing.", clusterProtocol, clusterGenerator, library); 526 "Clonal amplification", "A bioassay representing extracts that has been amplified in preparation for sequencing.", 527 clusterProtocol, clusterGenerator, clusterKit, library); 523 528 524 529 // Derived bioassay set subtypes -
trunk/src/core/net/sf/basedb/core/Kit.java
r6993 r6994 72 72 public static final String LIBRARY_PREPARATION = "net.sf.basedb.core.KitType.LIBRARY_PREPARATION"; 73 73 74 /** 75 The ID for the hybridization kit type, for example a kit 76 used when creating a {@link PhysicalBioAssay} from a set of 77 (labeled) {@link Extract}:s. 78 */ 79 public static final String HYBRIDIZATION = "net.sf.basedb.core.KitType.HYBRIDIZATION"; 80 81 /** 82 The ID for the cluster generation (in a flow cell) kit type, for example 83 a protocol used when creating a {@link PhysicalBioAssay}. 84 */ 85 public static final String CLUSTER_GENERATION = "net.sf.basedb.core.KitType.CLUSTER_GENERATION"; 86 87 /** 88 Get the system id for the kit subtype that should be used on an item 89 that doesn't have a subtype. This includes {@link Subtypable} items with a 90 null {@link ItemSubtype} and all other non-subtypable items which can be 91 linked to a kit. 92 @param itemType The item type 93 @return The system id of the default kit type or null 94 */ 95 public static String getDefaultSystemId(Item itemType) 96 { 97 String defaultId = null; 98 if (itemType == Item.SAMPLE) 99 { 100 defaultId = SAMPLING; 101 } 102 else if (itemType == Item.EXTRACT) 103 { 104 defaultId = EXTRACTION; 105 } 106 return defaultId; 107 } 108 74 109 /** 75 110 Create a new <code>Kit</code> item. -
trunk/src/core/net/sf/basedb/core/PhysicalBioAssay.java
r6881 r6994 197 197 @Override 198 198 @SupportsPushAnnotations 199 @SubtypableRelatedItems({Item.HARDWARE, Item.PROTOCOL, Item. EXTRACT})199 @SubtypableRelatedItems({Item.HARDWARE, Item.PROTOCOL, Item.KIT, Item.EXTRACT}) 200 200 public ItemSubtype getItemSubtype() 201 201 { -
trunk/www/views/physicalbioassays/bioassays.js
r6947 r6994 56 56 Buttons.addClickHandler('hardware_id.select', bioassays.selectHardware); 57 57 Events.addEventHandler('hardware_id', 'base-selected', bioassays.setHardwareCallback); 58 59 // Kit 60 Buttons.addClickHandler('kit_id.select', bioassays.selectKit); 61 Events.addEventHandler('kit_id', 'base-selected', bioassays.setKitCallback); 58 62 59 63 // Array slide … … 238 242 } 239 243 244 bioassays.selectKit = function() 245 { 246 var frm = document.forms['bioassay']; 247 var url = '&resetTemporary=1'; 248 url += '&tmpfilter:BOOLEAN:inactive=0'; 249 url += ItemSubtype.createRelatedFilter('subtype_id', 'KIT'); 250 if (frm.kit_id.length > 1) 251 { 252 var id = Math.abs(parseInt(frm.kit_id[1].value)); 253 url += '&item_id='+id; 254 } 255 Dialogs.selectItem('KIT', 'kit_id', 0, url); 256 } 257 258 bioassays.setKitCallback = function(event) 259 { 260 var frm = document.forms['bioassay']; 261 var list = frm.kit_id; 262 if (list.length < 2 || list[1].value == '0') 263 { 264 Forms.addListOption(list, 1, new Option()); 265 } 266 list[1].value = event.detail.id; 267 list[1].text = event.detail.name; 268 list.selectedIndex = 1; 269 } 270 240 271 bioassays.subtypeOnChange = function() 241 272 { -
trunk/www/views/physicalbioassays/edit_bioassay.jsp
r6947 r6994 38 38 import="net.sf.basedb.core.ItemSubtype" 39 39 import="net.sf.basedb.core.ArraySlide" 40 import="net.sf.basedb.core.Kit" 40 41 import="net.sf.basedb.core.Protocol" 41 42 import="net.sf.basedb.core.Project" … … 101 102 boolean readCurrentHardware = true; 102 103 Hardware currentHardware = null; 104 105 boolean readCurrentKit = true; 106 Kit currentKit = null; 103 107 104 108 if (itemId == 0) … … 113 117 { 114 118 currentHardware = Base.getFirstMatching(dc, Hardware.getQuery(), "name", cc.getPropertyFilter("creationEvent.hardware.name")); 119 } 120 if (cc.getPropertyFilter("creationEvent.kit.name") != null) 121 { 122 currentKit = Base.getFirstMatching(dc, Kit.getQuery(), "name", cc.getPropertyFilter("creationEvent.kit.name")); 115 123 } 116 124 if (cc.getPropertyFilter("arraySlide.name") != null) … … 213 221 readCurrentHardware = false; 214 222 } 223 try 224 { 225 currentKit = creationEvent.getKit(); 226 } 227 catch (PermissionDeniedException ex) 228 { 229 readCurrentKit = false; 230 } 215 231 216 232 // Query to retrieve source extracts … … 237 253 List<Protocol> recentProtocols = (List<Protocol>)cc.getRecent(dc, Item.PROTOCOL, currentSubtype); 238 254 List<Hardware> recentHardware = (List<Hardware>)cc.getRecent(dc, Item.HARDWARE, currentSubtype); 255 List<Kit> recentKits = (List<Kit>)cc.getRecent(dc, Item.KIT, currentSubtype); 239 256 240 257 // Query to retrieve item types … … 391 408 recent="<%=recentHardware%>" 392 409 defaultitems="<%=defaultHardware%>" 410 newitem="<%=pba == null%>" 411 /> 412 </td> 413 <td></td> 414 </tr> 415 <tr> 416 <th>Kit</th> 417 <td> 418 <base:select 419 id="kit_id" 420 clazz="selectionlist" 421 required="false" 422 current="<%=currentKit%>" 423 denied="<%=!readCurrentKit%>" 424 recent="<%=recentKits%>" 393 425 newitem="<%=pba == null%>" 394 426 /> -
trunk/www/views/physicalbioassays/index.jsp
r6813 r6994 34 34 import="net.sf.basedb.core.BioMaterialEventSource" 35 35 import="net.sf.basedb.core.Extract" 36 import="net.sf.basedb.core.Kit" 36 37 import="net.sf.basedb.core.Protocol" 37 38 import="net.sf.basedb.core.Hardware" … … 233 234 } 234 235 236 int kitId = Values.getInt(request.getParameter("kit_id"), -1); 237 if (kitId >= 0) // < 0 = denied or unchanged 238 { 239 Kit kit = kitId == 0 ? null : Kit.getById(dc, kitId); 240 creationEvent.setKit(kit); 241 if (kit != null) cc.setRecent(kit, subtype, maxRecent); 242 } 243 235 244 // Extracts 236 245 String[] modifiedExtracts = Values.getString(request.getParameter("+EXTRACT")).split(","); -
trunk/www/views/physicalbioassays/list_bioassays.jsp
r6834 r6994 262 262 title="Hardware" 263 263 sortable="true" 264 filterable="true" 265 exportable="true" 266 /> 267 <tbl:columndef 268 id="kit" 269 property="creationEvent.kit.name" 270 datatype="string" 271 title="Kit" 272 sortable="true" 264 273 filterable="true" 265 274 exportable="true" … … 721 730 enablePropertyLink="<%=mode.hasPropertyLink()%>" 722 731 /></tbl:cell> 732 <tbl:cell column="kit" 733 ><base:propertyvalue 734 item="<%=creationEvent%>" 735 property="kit" 736 enableEditLink="<%=mode.hasEditLink()%>" 737 enablePropertyLink="<%=mode.hasPropertyLink()%>" 738 /></tbl:cell> 723 739 <tbl:cell column="eventDate" value="<%=creationEvent.getEventDate()%>" /> 724 740 <tbl:cell column="entryDate" value="<%=creationEvent.getEntryDate()%>" /> -
trunk/www/views/physicalbioassays/view_bioassay.jsp
r6605 r6994 274 274 <th>Hardware</th> 275 275 <td><base:propertyvalue item="<%=creationEvent%>" property="hardware" /></td> 276 </tr> 277 <tr> 278 <th>Kit</th> 279 <td><base:propertyvalue item="<%=creationEvent%>" property="kit" /></td> 276 280 </tr> 277 281 <tr>
Note: See TracChangeset
for help on using the changeset viewer.