Changeset 2484
- Timestamp:
- Aug 3, 2006, 8:41:17 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/HardwareType.java
r2474 r2484 62 62 */ 63 63 public static final String PRINT_ROBOT = "net.sf.basedb.core.HardwareType.PRINT_ROBOT"; 64 65 /** 66 The id for the <code>HardwareType</code> object representing a 67 hybridization station. 68 */ 69 public static final String HYBRIDIZATION_STATION = "net.sf.basedb.core.HarwareType.HYBRIDIZATION_STATION"; 70 71 /** 72 Create a new <code>HardwareType</code> item. 73 74 @param dc The <code>DbControl</code> which will be used for 75 permission checking and database access 76 @return The new <code>HardwareType</code> item 77 @throws BaseException If there is an error 78 */ 79 public static HardwareType getNew(DbControl dc) 80 throws BaseException 81 { 82 HardwareType hwt = dc.newItem(HardwareType.class); 83 hwt.setName("New hardware type"); 84 return hwt; 85 } 64 86 65 87 /** -
trunk/src/core/net/sf/basedb/core/Install.java
r2480 r2484 382 382 HardwareTypeData scanner = createHardwareType(HardwareType.SCANNER, "Scanner", "Scans the microarray images."); 383 383 HardwareTypeData robot = createHardwareType(HardwareType.PRINT_ROBOT, "Print robot", "Spot the probe on the array."); 384 384 HardwareTypeData hybStation = createHardwareType(HardwareType.HYBRIDIZATION_STATION, "Hybridization station", "Automate the hybridization of microarrays on slides."); 385 385 386 386 // Hardware -
trunk/src/core/net/sf/basedb/core/Item.java
r2382 r2484 160 160 The item is a {@link HardwareType}. 161 161 */ 162 HARDWARETYPE(122, "Hardware type", "htp", HardwareType.class, HardwareTypeData.class, DefinedPermissions. write),162 HARDWARETYPE(122, "Hardware type", "htp", HardwareType.class, HardwareTypeData.class, DefinedPermissions.basic), 163 163 /** 164 164 The item is a {@link Software}. -
trunk/www/views/hybridizations/edit_hybridization.jsp
r2465 r2484 34 34 import="net.sf.basedb.core.Permission" 35 35 import="net.sf.basedb.core.Include" 36 import="net.sf.basedb.core.Hardware" 37 import="net.sf.basedb.core.HardwareType" 36 38 import="net.sf.basedb.core.Hybridization" 37 39 import="net.sf.basedb.core.BioMaterialEvent" … … 78 80 boolean readCurrentProtocol = true; 79 81 Protocol currentProtocol = null; 82 83 boolean readCurrentHybStation = true; 84 Hardware currentHybStation = null; 80 85 81 86 if (itemId == 0) … … 86 91 { 87 92 currentProtocol = Base.getFirstMatching(dc, Protocol.getQuery(), "name", cc.getPropertyFilter("creationEvent.protocol.name")); 93 } 94 if (cc.getPropertyFilter("creationEvent.hardware.name") != null) 95 { 96 currentHybStation = Base.getFirstMatching(dc, Hardware.getQuery(), "name", cc.getPropertyFilter("creationEvent.hardware.name")); 88 97 } 89 98 if (cc.getPropertyFilter("arraySlide.name") != null) … … 124 133 { 125 134 readCurrentProtocol = false; 135 } 136 try 137 { 138 currentHybStation = creationEvent.getHardware(); 139 } 140 catch (PermissionDeniedException ex) 141 { 142 readCurrentHybStation = false; 126 143 } 127 144 … … 217 234 frm.protocol_id[1].text = name; 218 235 frm.protocol_id.selectedIndex = 1; 236 } 237 238 239 240 function selectHybStationOnClick() 241 { 242 var frm = document.forms['hybridization']; 243 var url = '../../admin/hardware/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setHybStationCallback'; 244 if (frm.hardware_id.length > 1) 245 { 246 var id = Math.abs(parseInt(frm.hardware_id[1].value)); 247 url += '&item_id='+id; 248 } 249 url += '&filter:INT:hardwareType=<%=SystemItems.getId(HardwareType.HYBRIDIZATION_STATION)%>'; 250 Main.openPopup(url, 'SelectHybStation', 1000, 700); 251 } 252 function setHybStationCallback(hybStationId, name) 253 { 254 var frm = document.forms['hybridization']; 255 if (frm.hardware_id.length < 2) // > 256 { 257 frm.hardware_id[frm.hardware_id.length] = new Option(); 258 } 259 frm.hardware_id[1].value = hybStationId; 260 frm.hardware_id[1].text = name; 261 frm.hardware_id.selectedIndex = 1; 219 262 } 220 263 … … 414 457 </tr> 415 458 <tr> 459 <td class="prompt">Hardware</td> 460 <td> 461 <table border="0" cellspacing="0" cellpadding="0"> 462 <tr> 463 <td> 464 <select name="hardware_id" size="1" 465 <%=!readCurrentHybStation ? "disabled readonly class=\"disabled\"" : ""%> 466 style="width: 20em;"> 467 <% 468 if (!readCurrentHybStation) 469 { 470 %> 471 <option value="-1">- denied - 472 <% 473 } 474 else 475 { 476 %> 477 <option value="0">- none - 478 <% 479 if (currentHybStation != null) 480 { 481 %> 482 <option value="<%=hyb == null ? currentHybStation.getId() : -currentHybStation.getId()%>" 483 selected><%=HTML.encodeTags(currentHybStation.getName())%> 484 <% 485 } 486 } 487 %> 488 </select> 489 490 </td> 491 <td><base:button onclick="selectHybStationOnClick()" 492 title="Select…" disabled="<%=!readCurrentHybStation%>" /></td> 493 </tr> 494 </table> 495 </td> 496 </tr> 497 <tr> 416 498 <td class="prompt">Array slide</td> 417 499 <td> -
trunk/www/views/hybridizations/index.jsp
r2465 r2484 35 35 import="net.sf.basedb.core.LabeledExtract" 36 36 import="net.sf.basedb.core.Protocol" 37 import="net.sf.basedb.core.Hardware" 37 38 import="net.sf.basedb.core.ItemQuery" 38 39 import="net.sf.basedb.core.ItemResultIterator" … … 163 164 } 164 165 166 //Hybridization station 167 int hybStationId = Values.getInt(request.getParameter("hardware_id"), -1); 168 if (hybStationId >= 0) // < 0 denied or unchanged 169 { 170 Hardware hw = hybStationId == 0 ? null : Hardware.getById(dc, hybStationId); 171 creationEvent.setHardware(hw); 172 } 173 165 174 // Labeled extracts 166 175 String[] modifiedLabeledExtracts = Values.getString(request.getParameter("modifiedLabeledExtracts")).split(","); -
trunk/www/views/hybridizations/list_hybridizations.jsp
r2437 r2484 256 256 exportable="true" 257 257 show="<%=mode.isCompact() ? "never" : "auto"%>" 258 /> 259 <tbl:columndef 260 id="hybStation" 261 property="creationEvent.hardware" 262 datatype="string" 263 title="Hardware" 264 sortable="true" 265 filterable="true" 266 exportable="true" 267 show="<%=mode.isCompact() ? "never" : "auto"%>" 258 268 /> 259 269 <tbl:columndef … … 569 579 enablePropertyLink="<%=mode.hasPropertyLink()%>" 570 580 /></tbl:cell> 581 <tbl:cell column="hybStation" 582 ><base:propertyvalue 583 item="<%=creationEvent%>" 584 property="hardware" 585 enableEditLink="<%=mode.hasEditLink()%>" 586 enablePropertyLink="<%=mode.hasPropertyLink()%>" 587 /></tbl:cell> 571 588 <tbl:cell column="eventDate"><%=Values.formatDate(creationEvent.getEventDate())%></tbl:cell> 572 589 <tbl:cell column="entryDate"><%=Values.formatDate(creationEvent.getEntryDate())%></tbl:cell> -
trunk/www/views/hybridizations/view_hybridization.jsp
r2478 r2484 235 235 </tr> 236 236 <tr> 237 <td class="prompt">Hardware</td> 238 <td><base:propertyvalue item="<%=creationEvent%>" property="hardware" /></td> 239 </tr> 240 <tr> 237 241 <td class="prompt">Owner</td> 238 242 <td><base:propertyvalue item="<%=hyb%>" property="owner" /></td>
Note: See TracChangeset
for help on using the changeset viewer.