Changeset 7447
- Timestamp:
- Feb 22, 2018, 8:52:16 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/3.11-stable merged: 7427,7441-7444 /tags/3.11.3 (added) merged: 7445
- Property svn:mergeinfo changed
-
trunk/src/core/net/sf/basedb/core/RawBioAssay.java
r7381 r7447 603 603 604 604 /** 605 Get the job that imported data to this raw bioassay. 605 Set the job on this raw bioassay that was used to create or import 606 data for it. 607 608 @param job The job or null to clear the existing job 609 @throws PermissionDeniedException If the logged in user doesn't have 610 write permission 611 @since 3.11.3 612 */ 613 public void setJob(Job job) 614 throws PermissionDeniedException 615 { 616 checkPermission(Permission.WRITE); 617 if (job != null) job.checkPermission(Permission.USE); 618 getData().setJob(job == null ? null : job.getData()); 619 } 620 621 /** 622 Get the job that created or imported data to this raw bioassay. 606 623 @return A <code>Job</code> object, ot null if this information is 607 624 not available … … 1058 1075 { 1059 1076 rawDataBatcher = RawDataBatcher.getNew(getDbControl(), this, fiMethod); 1060 getData().setJob(job == null ? null :job.getData());1077 if (job != null) getData().setJob(job.getData()); 1061 1078 } 1062 1079 return rawDataBatcher; -
trunk/www/include/scripts/main-2.js
r7428 r7447 3850 3850 // Position the dropdown 3851 3851 var pos = select.getFixedDropDownPosition(element); 3852 dropdownDiv.style.width = (pos.width)+'px'; 3853 dropdownDiv.style.left = (pos.left)+'px'; 3854 3852 dropdownDiv.style.left = pos.left; 3853 dropdownDiv.style.right = pos.right; 3854 dropdownDiv.style.width = pos.width; 3855 dropdownDiv.style.minWidth = pos.minWidth; 3856 dropdownDiv.style.maxWidth = pos.maxWidth; 3857 3855 3858 // Show it 3856 3859 Doc.addClass(element, 'active'); … … 3870 3873 // Position the dropdown div relative the main element 3871 3874 var fpos = Doc.getElementPosition(element); 3872 3873 // Assume the same as the main element 3875 3874 3876 var dpos = {}; 3875 dpos.left = fpos.left+1; 3876 dpos.width = fpos.width; 3877 3878 if (dpos.width < 150) 3879 { 3880 // The dropdown should be at least 150px wide. 3881 dpos.width = 150; 3882 3877 3878 // The default is to make the drop-down the same size as the filter 3879 dpos.left = (fpos.left+1)+'px'; 3880 dpos.width = (fpos.width)+'px'; 3881 dpos.right = 'auto'; 3882 dpos.minWidth = (Math.max(fpos.width, 150))+'px'; 3883 dpos.maxWidth = 'auto'; 3884 3885 if (fpos.width < 300) 3886 { 3887 // If the width is smaller than 300 we should open up either 3888 // to the left or to the right, we need to check how close we are to 3889 // the right side 3883 3890 try 3884 3891 { … … 3892 3899 } 3893 3900 if (p==null) p = document.body; 3894 3901 3895 3902 // Get position data for the parent 3896 // + 30should be safe to account for a scrollbar3903 // +16 should be safe to account for a scrollbar 3897 3904 var ppos = Doc.getElementPosition(p); 3898 var scrollbar = p.scrollHeight > p.clientHeight ? 30: 0;3905 var scrollbar = p.scrollHeight > p.clientHeight ? 16 : 0; 3899 3906 var maxRight = ppos.width + p.scrollLeft - scrollbar; 3900 3901 // Right-align the dropdown if it overflows 3902 if (dpos.left + dpos.width > maxRight) 3907 3908 dpos.width = 'auto'; 3909 dpos.maxWidth = '300px'; 3910 if (fpos.left + 300 > maxRight) 3903 3911 { 3904 dpos.left = fpos.right - 148; 3912 // Align to right 3913 dpos.left = 'auto'; 3914 dpos.right = (ppos.right-fpos.right-scrollbar)+'px'; 3905 3915 if (fpos.right > maxRight) 3906 3916 { … … 3920 3930 } 3921 3931 } 3922 3923 3932 return dpos; 3924 3933 } … … 4079 4088 optionDiv.innerHTML = options[i].value; 4080 4089 options[i].div = optionDiv; 4090 optionDiv.title = options[i].value; 4081 4091 allOptionsDiv.appendChild(optionDiv); 4082 4092 Events.addEventHandler(optionDiv, 'click', internal.optionOnClick); … … 4269 4279 // Position the dropdown 4270 4280 var pos = select.getFixedDropDownPosition(activeSelect); 4271 dropdownDiv.style.width = (pos.width)+'px'; 4272 dropdownDiv.style.left = (pos.left)+'px'; 4281 dropdownDiv.style.left = pos.left; 4282 dropdownDiv.style.right = pos.right; 4283 dropdownDiv.style.width = pos.width; 4284 dropdownDiv.style.minWidth = pos.minWidth; 4285 dropdownDiv.style.maxWidth = pos.maxWidth; 4273 4286 } 4274 4287 … … 4314 4327 // Position the dropdown 4315 4328 var pos = MultiSelect.getFixedDropDownPosition(element); 4316 dropdownDiv.style.width = (pos.width)+'px'; 4317 dropdownDiv.style.left = (pos.left)+'px'; 4329 dropdownDiv.style.left = pos.left; 4330 dropdownDiv.style.right = pos.right; 4331 dropdownDiv.style.width = pos.width; 4332 dropdownDiv.style.minWidth = pos.minWidth; 4333 dropdownDiv.style.maxWidth = pos.maxWidth; 4318 4334 4319 4335 // Show it … … 4665 4681 // Position the dropdown 4666 4682 var pos = MultiSelect.getFixedDropDownPosition(activeEnum); 4667 dropdownDiv.style.width = (pos.width)+'px'; 4668 dropdownDiv.style.left = (pos.left)+'px'; 4683 dropdownDiv.style.left = pos.left; 4684 dropdownDiv.style.right = pos.right; 4685 dropdownDiv.style.width = pos.width; 4686 dropdownDiv.style.minWidth = pos.minWidth; 4687 dropdownDiv.style.maxWidth = pos.maxWidth; 4669 4688 } 4670 4689 -
trunk/www/include/styles/main.css
r7335 r7447 977 977 margin-left: -2px; 978 978 margin-top: 2px; 979 min-width: 150px; 979 980 } 980 981 981 982 div.smartenum 982 983 { 983 height: 20em; 984 min-height: 15em; 985 max-height: 30em; 984 986 } 985 987 … … 1045 1047 .multioptionoptions 1046 1048 { 1047 height: 20em; 1049 min-height: 15em; 1050 max-height: 30em; 1048 1051 overflow: auto; 1049 1052 } -
trunk/www/views/derivedbioassays/list_bioassays.jsp
r7337 r7447 117 117 118 118 final ItemQuery<ItemSubtype> subtypesQuery = Base.getSubtypesQuery(itemType); 119 final ItemQuery<ItemSubtype> jobSubtypesQuery = Base.getSubtypesQuery(Item.JOB); 119 120 120 121 // Query for parent physical bioassays to the current bioassay … … 262 263 property="&rawBioAssays(name)" 263 264 datatype="string" 265 filterable="true" 266 exportable="true" 267 /> 268 <tbl:columndef 269 id="jobType" 270 property="job.itemSubtype" 271 sortproperty="job.itemSubtype.name" 272 exportproperty="job.itemSubtype.name:string" 273 datatype="int" 274 enumeration="<%=Enumeration.fromItems(jobSubtypesQuery.list(dc), "-none-")%>" 275 title="Job type" 276 sortable="true" 264 277 filterable="true" 265 278 exportable="true" … … 790 803 enablePropertyLink="<%=mode.hasPropertyLink()%>" 791 804 /></tbl:cell> 805 <tbl:cell column="jobType"><base:propertyvalue 806 item="<%=item%>" 807 property="job.itemSubtype" 808 enableEditLink="<%=mode.hasEditLink()%>" 809 enablePropertyLink="<%=mode.hasPropertyLink()%>" 810 /></tbl:cell> 792 811 <tbl:cell column="plugin" 793 812 ><base:propertyvalue -
trunk/www/views/derivedbioassays/view_bioassay.jsp
r7265 r7447 332 332 <td style="width: 50%; height: 100%;" class="leftborder"> 333 333 <table class="fullform"> 334 <tbody class="sectionheader">335 <tr>336 <th colspan="2">Job & plug-in parameters</th>337 </tr>338 </tbody>339 334 <tr> 340 335 <th>Job</th> … … 343 338 <tr> 344 339 <th>Plugin</th> 345 <td><%=Base.getLinkedName(ID, plugin, 346 !readPlugin, plugin != null && plugin.hasPermission(Permission.WRITE))%></td> 347 </tr> 348 <tr> 349 <th>Plugin configuration</th> 350 <td><%=Base.getLinkedName(ID, configuration, !readConfiguration, 351 configuration != null && configuration.hasPermission(Permission.WRITE))%></td> 340 <td> 341 <base:propertyvalue item="<%=bioAssay%>" property="job.pluginDefinition" nulltext="<i>External</i>" /> 342 <%=job != null && job.getPluginVersion() != null ? "(" + HTML.encodeTags(job.getPluginVersion()) + ")" : ""%> 343 </td> 352 344 </tr> 353 345 <% 346 if (configuration != null) 347 { 348 %> 349 <tr> 350 <th>Plugin configuration</th> 351 <td><%=Base.getLinkedName(ID, configuration, !readConfiguration, true)%></td> 352 </tr> 353 <% 354 } 354 355 if (job != null) 355 356 { 356 357 %> 358 <tr> 359 <th>Type</th> 360 <td><base:propertyvalue item="<%=job%>" property="itemSubtype" /></td> 361 </tr> 357 362 <tr> 358 363 <th>Started</th> … … 367 372 </td> 368 373 </tr> 369 <tr> 370 <th>Server</th> 371 <td> 372 <%=HTML.encodeTags(job.getServerAndNode())%> 373 </td> 374 </tr> 375 <% 374 <% 375 if (job.getServer() != null) 376 { 377 %> 378 <tr> 379 <th>Server</th> 380 <td> 381 <%=HTML.encodeTags(job.getServerAndNode())%> 382 </td> 383 </tr> 384 <% 385 } 376 386 for (String name : job.getParameterNames()) 377 387 { -
trunk/www/views/rawbioassays/list_rawbioassays.jsp
r7337 r7447 40 40 import="net.sf.basedb.core.FileSet" 41 41 import="net.sf.basedb.core.DataFileType" 42 import="net.sf.basedb.core.ItemSubtype" 42 43 import="net.sf.basedb.core.ItemQuery" 43 44 import="net.sf.basedb.core.Include" … … 126 127 List<DataFileType> fileTypeColumns = new ArrayList<DataFileType>(Base.getDataFileColumns(itemType, null).list(dc)); 127 128 129 final ItemQuery<ItemSubtype> jobSubtypesQuery = Base.getSubtypesQuery(Item.JOB); 130 128 131 // Query for experiments relatated to the current raw bioassay 129 132 final ItemQuery<Experiment> experimentQuery = Experiment.getQuery(); … … 345 348 /> 346 349 <tbl:columndef 350 id="jobType" 351 property="job.itemSubtype" 352 sortproperty="job.itemSubtype.name" 353 exportproperty="job.itemSubtype.name:string" 354 datatype="int" 355 enumeration="<%=Enumeration.fromItems(jobSubtypesQuery.list(dc), "-none-")%>" 356 title="Job type" 357 sortable="true" 358 filterable="true" 359 exportable="true" 360 /> 361 <tbl:columndef 347 362 id="plugin" 348 363 property="job.pluginDefinition.name" … … 352 367 filterable="true" 353 368 exportable="true" 354 tooltip="The plug-in that was used to import raw data"369 tooltip="The plug-in that was used to create data for the raw bioassay" 355 370 /> 356 371 <tbl:columndef … … 362 377 filterable="true" 363 378 exportable="true" 364 tooltip="The configuration/file format that was used to import raw data"379 tooltip="The configuration/file format that was used to create data for the raw bioassay" 365 380 /> 366 381 <tbl:columndef … … 769 784 enablePropertyLink="<%=mode.hasPropertyLink()%>" 770 785 /></tbl:cell> 786 <tbl:cell column="jobType"><base:propertyvalue 787 item="<%=item%>" 788 property="job.itemSubtype" 789 enableEditLink="<%=mode.hasEditLink()%>" 790 enablePropertyLink="<%=mode.hasPropertyLink()%>" 791 /></tbl:cell> 771 792 <tbl:cell column="plugin"> 772 793 <base:propertyvalue -
trunk/www/views/rawbioassays/view_rawbioassay.jsp
r7166 r7447 53 53 import="net.sf.basedb.core.MultiPermissions" 54 54 import="net.sf.basedb.core.PermissionDeniedException" 55 import="net.sf.basedb.core.ParameterInfo" 56 import="net.sf.basedb.core.BasicItem" 57 import="net.sf.basedb.core.Nameable" 55 58 import="net.sf.basedb.core.PluginDefinition" 59 import="net.sf.basedb.core.PluginConfiguration" 56 60 import="net.sf.basedb.core.plugin.GuiContext" 57 61 import="net.sf.basedb.core.plugin.Plugin" … … 113 117 Job job = null; 114 118 boolean readJob = true; 119 PluginDefinition plugin = null; 120 boolean readPlugin = true; 121 PluginConfiguration configuration = null; 122 boolean readConfiguration = true; 123 115 124 try 116 125 { … … 120 129 { 121 130 readJob = false; 131 readPlugin = false; 132 readConfiguration = false; 122 133 } 134 if (job != null) 135 { 136 try 137 { 138 plugin = job.getPluginDefinition(); 139 } 140 catch (PermissionDeniedException ex) 141 { 142 readPlugin = false; 143 } 144 try 145 { 146 configuration = job.getPluginConfiguration(); 147 } 148 catch (PermissionDeniedException ex) 149 { 150 readConfiguration = false; 151 } 152 } 153 154 123 155 final Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc); 124 156 Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); … … 317 349 <td style="width: 50%; height: 100%;" class="leftborder"> 318 350 <table class="fullform"> 319 <tbody class="sectionheader">320 <tr>321 <th colspan="4">Raw data import</th>322 </tr>323 </tbody>324 351 <tr> 325 352 <th>Job</th> … … 327 354 </tr> 328 355 <tr> 329 <th>Date / time</th>330 <td colspan="3"><%=job == null ? "" : dateTimeFormatter.format(job.getEnded())%></td>331 </tr>332 <tr>333 356 <th>Plugin</th> 334 <td colspan="3"><base:propertyvalue item="<%=rawBioAssay%>" property="job.pluginDefinition" /></td> 335 </tr> 336 <tr> 337 <th>Configuration / file format</th> 338 <td colspan="3"><base:propertyvalue item="<%=rawBioAssay%>" property="job.pluginConfiguration" /></td> 339 </tr> 340 <tbody class="sectionheader"> 341 <tr> 342 <th colspan="4">Spot images</th> 343 </tr> 344 </tbody> 357 <td colspan="3"> 358 <base:propertyvalue item="<%=rawBioAssay%>" property="job.pluginDefinition" nulltext="<i>External</i>" /> 359 <%=job != null && job.getPluginVersion() != null ? "(" + HTML.encodeTags(job.getPluginVersion()) + ")" : ""%> 360 </td> 361 </tr> 345 362 <% 346 if ( !rawBioAssay.hasSpotImages())363 if (configuration != null) 347 364 { 348 365 %> 349 <tr class="dynamic"> 350 <td colspan="4"> 351 <div class="messagecontainer note"> 352 No spot images has been created for this raw bioassay. 353 </div> 366 <tr> 367 <th>Configuration / file format</th> 368 <td colspan="3"><%=Base.getLinkedName(ID, configuration, !readConfiguration, true)%></td> 369 </tr> 370 <% 371 } 372 if (job != null) 373 { 374 %> 375 <tr> 376 <th>Type</th> 377 <td><base:propertyvalue item="<%=job%>" property="itemSubtype" /></td> 378 </tr> 379 <tr> 380 <th>Started</th> 381 <td> 382 <%=dateTimeFormatter.format(job.getStarted())%> 354 383 </td> 355 384 </tr> 356 <% 385 <tr> 386 <th>Ended</th> 387 <td> 388 <%=dateTimeFormatter.format(job.getEnded())%> 389 </td> 390 </tr> 391 <% 392 if (job.getServer() != null) 393 { 394 %> 395 <tr> 396 <th>Server</th> 397 <td> 398 <%=HTML.encodeTags(job.getServerAndNode())%> 399 </td> 400 </tr> 401 <% 402 } 403 for (String name : job.getParameterNames()) 404 { 405 StringBuilder sb = new StringBuilder(); 406 String displayValue = ""; 407 String description = ""; 408 try 409 { 410 ParameterInfo pi = job.getParameterInfo(name); 411 if (pi.getLabel() != null) name = HTML.encodeTags(pi.getLabel()); 412 description = HTML.encodeTags(pi.getDescription()); 413 List<?> values = pi.getValuesOrMask(); 414 int i = 0; 415 for (Object value : values) 416 { 417 if (value != null) 418 { 419 if (i > 0) sb.append(", "); 420 i++; 421 if (value instanceof BasicItem) 422 { 423 BasicItem item = (BasicItem)value; 424 String itemName = ""; 425 if (item instanceof File) 426 { 427 itemName = ((File)item).getPath().toString(); 428 } 429 else if (item instanceof Nameable) 430 { 431 itemName = ((Nameable)item).getName(); 432 } 433 else 434 { 435 itemName = item.toString(); 436 } 437 sb.append(Base.getLink(ID, HTML.encodeTags(itemName), 438 item.getType(), item.getId(), item.hasPermission(Permission.WRITE))); 439 } 440 else if (value instanceof Date) 441 { 442 sb.append(dateFormatter.format((Date)value)); 443 } 444 else 445 { 446 sb.append(HTML.encodeTags(value.toString())); 447 } 448 } 449 } 450 displayValue = sb.toString(); 451 } 452 catch (Throwable ex) 453 { 454 displayValue = "<i>ERROR: "+ex.getMessage()+"</i>"; 455 } 456 %> 457 <tr> 458 <th><span title="<%=description%>"><%=name%></span></th> 459 <td> 460 <%=displayValue%> 461 </td> 462 </tr> 463 <% 464 } 357 465 } 358 else466 if (rawBioAssay.hasSpotImages()) 359 467 { 360 468 SpotImages spi = rawBioAssay.getSpotImages(); 361 469 %> 470 <tbody class="sectionheader"> 471 <tr> 472 <th colspan="4">Spot images</th> 473 </tr> 474 </tbody> 362 475 <tr> 363 476 <th>X scale</th> … … 403 516 } 404 517 %> 518 <tr class="dynamic"> 519 <th></th> 520 <td colspan="3"></td> 521 </tr> 405 522 </table> 406 523 </td>
Note: See TracChangeset
for help on using the changeset viewer.