Changeset 6992
- Timestamp:
- Nov 3, 2015, 8:19:18 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/Extract.java
r6881 r6992 156 156 @Override 157 157 @SupportsPushAnnotations 158 @SubtypableRelatedItems({Item.PROTOCOL, Item. HARDWARE, Item.TAG, Item.SAMPLE, Item.EXTRACT})158 @SubtypableRelatedItems({Item.PROTOCOL, Item.KIT, Item.HARDWARE, Item.TAG, Item.SAMPLE, Item.EXTRACT}) 159 159 public ItemSubtype getItemSubtype() 160 160 { -
trunk/src/core/net/sf/basedb/core/Install.java
r6990 r6992 456 456 ItemSubtypeData labelingProtocol = createItemSubtype(Item.PROTOCOL, Protocol.LABELING, 457 457 "Labeling", "Protocols used for creating labeled extracts.", protocolFileType); 458 ItemSubtypeData libraryPrep aration= createItemSubtype(Item.PROTOCOL, Protocol.LIBRARY_PREPARATION,458 ItemSubtypeData libraryPrepProtocol = createItemSubtype(Item.PROTOCOL, Protocol.LIBRARY_PREPARATION, 459 459 "Library preparation", "Protocols used for library preparation", protocolFileType); 460 460 createItemSubtype(Item.PROTOCOL, Protocol.POOLING, "Pooling", "Protocols used for creating pooled biomaterails.", protocolFileType); … … 473 473 createItemSubtype(Item.PROTOCOL, Protocol.FEATURE_EXTRACTION, "Feature extraction", "Protocols used for extracting features from microarray images.", protocolFileType); 474 474 475 // Kit subtypes 476 createItemSubtype(Item.KIT, Kit.EXTRACTION, "Extraction", "Kits used for creating extracts."); 477 ItemSubtypeData labelingKit = createItemSubtype(Item.KIT, Kit.LABELING, 478 "Labeling", "Kits used for creating labeled extracts."); 479 ItemSubtypeData libraryPrepKit = createItemSubtype(Item.KIT, Kit.LIBRARY_PREPARATION, 480 "Library preparation", "Kits used for creating libraries."); 481 475 482 // Hardware subtypes 476 483 ItemSubtypeData scanner = createItemSubtype(Item.HARDWARE, Hardware.SCANNER, … … 502 509 ItemSubtypeData labeledExtract = createItemSubtype(Item.EXTRACT, Extract.LABELED, 503 510 "Labeled extract", "A labeled extract is an extract which has been tagged with a label", 504 labelTag, labelingProtocol );511 labelTag, labelingProtocol, labelingKit); 505 512 ItemSubtypeData library = createItemSubtype(Item.EXTRACT, Extract.LIBRARY, 506 513 "Library", "An extract that has been prepared with an adaptor sequence before sequencing", 507 barcodeTag, libraryPrep aration);514 barcodeTag, libraryPrepProtocol, libraryPrepKit); 508 515 509 516 // Physical bioassay subtypes … … 1698 1705 if (subtype != null) 1699 1706 { 1707 if (related != null) 1708 { 1709 // Add related subtypes that are missing 1710 Map<Integer, ItemSubtypeData> allRelated = subtype.getRelatedSubtypes(); 1711 for (ItemSubtypeData rel : related) 1712 { 1713 if (!allRelated.containsKey(rel.getItemType())) 1714 { 1715 allRelated.put(rel.getItemType(), rel); 1716 } 1717 } 1718 } 1719 1700 1720 log.info("createItemSubtype: EXISTS [SYSTEM ID="+systemId+"; name="+name+"]"); 1701 1721 HibernateUtil.commit(tx); -
trunk/src/core/net/sf/basedb/core/Kit.java
r6990 r6992 46 46 private static final Item TYPE = Item.KIT; 47 47 48 /** 49 The ID for the extraction kit type, for example a kit 50 used when creating an {@link Extract} from a {@link 51 Sample}. 52 */ 53 public static final String EXTRACTION = "net.sf.basedb.core.KitType.EXTRACTION"; 54 55 /** 56 The ID for the labeling kit type, for example a kit 57 used when creating a labeled extract from an {@link Extract}. 58 */ 59 public static final String LABELING = "net.sf.basedb.core.KitType.LABELING"; 60 61 /** 62 The ID for the library preparation kit type, for example a kit 63 used when creating a library extract from an {@link Extract}. 64 */ 65 public static final String LIBRARY_PREPARATION = "net.sf.basedb.core.KitType.LIBRARY_PREPARATION"; 66 48 67 /** 49 68 Create a new <code>Kit</code> item. -
trunk/www/biomaterials/extracts/edit_extract.jsp
r6947 r6992 40 40 import="net.sf.basedb.core.BioPlate" 41 41 import="net.sf.basedb.core.BioWell" 42 import="net.sf.basedb.core.Kit" 42 43 import="net.sf.basedb.core.Protocol" 43 44 import="net.sf.basedb.core.Project" … … 102 103 boolean readCurrentProtocol = true; 103 104 Protocol currentProtocol = null; 105 boolean readCurrentKit = true; 106 Kit currentKit = null; 104 107 boolean readCurrentTag = true; 105 108 Tag currentTag = null; … … 123 126 currentProtocol = Base.getFirstMatching(dc, Protocol.getQuery(), "name", cc.getPropertyFilter("creationEvent.protocol.name")); 124 127 } 128 if (cc.getPropertyFilter("creationEvent.kit.name") != null) 129 { 130 currentKit = Base.getFirstMatching(dc, Kit.getQuery(), "name", cc.getPropertyFilter("creationEvent.kit.name")); 131 } 125 132 if (cc.getPropertyFilter("tag.name") != null) 126 133 { … … 212 219 { 213 220 readCurrentProtocol = false; 221 } 222 223 try 224 { 225 currentKit = creationEvent.getKit(); 226 } 227 catch (PermissionDeniedException ex) 228 { 229 readCurrentKit = false; 214 230 } 215 231 … … 272 288 273 289 // Load recently used items 290 List<Kit> recentKits = (List<Kit>)cc.getRecent(dc, Item.KIT, currentSubtype); 274 291 List<Protocol> recentProtocols = (List<Protocol>)cc.getRecent(dc, Item.PROTOCOL, currentSubtype); 275 292 List<Sample> recentSamples = (List<Sample>)cc.getRecent(dc, Item.SAMPLE); … … 324 341 <div id="page-data" class="datacontainer" 325 342 data-extraction-protocoltype-id="<%=SystemItems.getId(Protocol.EXTRACTION)%>" 343 data-extraction-kittype-id="<%=SystemItems.getId(Kit.EXTRACTION) %>" 326 344 data-extract-type="<%=Item.EXTRACT.getValue()%>" 327 345 <% … … 450 468 recent="<%=recentProtocols%>" 451 469 defaultitems="<%=defaultProtocols%>" 470 newitem="<%=extract == null%>" 471 disabled="<%=lockEventProperties%>" 472 /> 473 </td> 474 <td></td> 475 </tr> 476 <tr> 477 <th>Kit</th> 478 <td> 479 <base:select 480 id="kit_id" 481 clazz="selectionlist" 482 required="false" 483 current="<%=currentKit%>" 484 denied="<%=!readCurrentKit%>" 485 recent="<%=recentKits%>" 452 486 newitem="<%=extract == null%>" 453 487 disabled="<%=lockEventProperties%>" -
trunk/www/biomaterials/extracts/extracts.js
r6947 r6992 53 53 Buttons.addClickHandler('protocol_id.select', extracts.selectProtocol); 54 54 Events.addEventHandler('protocol_id', 'base-selected', extracts.setProtocolCallback); 55 // Kit 56 Buttons.addClickHandler('kit_id.select', extracts.selectKit); 57 Events.addEventHandler('kit_id', 'base-selected', extracts.setKitCallback); 55 58 // Subtype 56 59 Events.addEventHandler('subtype_id', 'change', extracts.subtypeOnChange); … … 266 269 var tagId = Math.abs(parseInt(frm.tag_id.value)); 267 270 if (tagId > 0) parents[parents.length] = 'TAG:'+tagId; 271 var kitId = Math.abs(parseInt(frm.kit_id.value)); 272 if (kitId > 0) parents[parents.length] = 'KIT:'+kitId; 273 var protocolId = Math.abs(parseInt(frm.protocol_id.value)); 274 if (protocolId > 0) parents[parents.length] = 'PROTOCOL:'+protocolId; 268 275 return parents; 269 276 } … … 333 340 } 334 341 342 extracts.selectKit = function() 343 { 344 var frm = document.forms['extract']; 345 var url = '&resetTemporary=1'; 346 url += ItemSubtype.createRelatedFilter('subtype_id', 'KIT', Data.int('page-data', 'extraction-kittype-id')); 347 if (frm.kit_id.length > 1) 348 { 349 var id = Math.abs(parseInt(frm.kit_id[1].value)); 350 url += '&item_id='+id; 351 } 352 Dialogs.selectItem('KIT', 'kit_id', 0, url); 353 } 354 355 extracts.setKitCallback = function(event) 356 { 357 var frm = document.forms['extract']; 358 var list = frm.kit_id; 359 if (list.length < 2 || list[1].value == '0') 360 { 361 Forms.addListOption(list, 1, new Option()); 362 } 363 list[1].value = event.detail.id; 364 list[1].text = event.detail.name; 365 list.selectedIndex = 1; 366 } 367 368 335 369 extracts.selectBioPlate = function() 336 370 { -
trunk/www/biomaterials/extracts/index.jsp
r6756 r6992 35 35 import="net.sf.basedb.core.BioPlateEventType" 36 36 import="net.sf.basedb.core.BioWell" 37 import="net.sf.basedb.core.Kit" 37 38 import="net.sf.basedb.core.Protocol" 38 39 import="net.sf.basedb.core.Tag" … … 262 263 if (pt != null) cc.setRecent(pt, subtype, maxRecent); 263 264 } 265 int kitId = Values.getInt(request.getParameter("kit_id"), -1); 266 if (kitId >= 0) // < 0 = denied or unchanged 267 { 268 Kit kit = kitId == 0 ? null : Kit.getById(dc, kitId); 269 creationEvent.setKit(kit); 270 if (kit != null) cc.setRecent(kit, subtype, maxRecent); 271 } 264 272 } 265 273 -
trunk/www/biomaterials/extracts/list_extracts.jsp
r6834 r6992 310 310 /> 311 311 <tbl:columndef 312 id="kit" 313 property="creationEvent.kit" 314 sortproperty="creationEvent.kit.name" 315 filterproperty="creationEvent.kit.name" 316 exportproperty="creationEvent.kit.name" 317 datatype="string" 318 title="Kit" 319 sortable="true" 320 filterable="true" 321 exportable="true" 322 /> 323 <tbl:columndef 312 324 id="eventDate" 313 325 property="creationEvent.eventDate" … … 758 770 item="<%=creationEvent%>" 759 771 property="protocol" 772 enableEditLink="<%=mode.hasEditLink()%>" 773 enablePropertyLink="<%=mode.hasPropertyLink()%>" 774 /></tbl:cell> 775 <tbl:cell column="kit" 776 ><base:propertyvalue 777 item="<%=creationEvent%>" 778 property="kit" 760 779 enableEditLink="<%=mode.hasEditLink()%>" 761 780 enablePropertyLink="<%=mode.hasPropertyLink()%>" -
trunk/www/biomaterials/extracts/view_extract.jsp
r6605 r6992 285 285 <th>Protocol</th> 286 286 <td><base:propertyvalue item="<%=creationEvent%>" property="protocol"/></td> 287 </tr> 288 <tr> 289 <th>Kit</th> 290 <td><base:propertyvalue item="<%=creationEvent%>" property="kit"/></td> 287 291 </tr> 288 292 <tr>
Note: See TracChangeset
for help on using the changeset viewer.