Changeset 7635
- Timestamp:
- Mar 11, 2019, 11:01:10 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/config/dist/web.xml
r7608 r7635 138 138 <servlet-name>upload</servlet-name> 139 139 <url-pattern>/filemanager/upload/Upload</url-pattern> 140 </servlet-mapping>141 142 <!-- The SpotImage servlet used to view spot images in a raw bioassay -->143 <servlet>144 <description>Servlet for viewing spot images created from raw bioassay data</description>145 <display-name>Spot images servlet</display-name>146 <servlet-name>spotimage</servlet-name>147 <servlet-class>148 net.sf.basedb.clients.web.servlet.ViewSpotImage149 </servlet-class>150 </servlet>151 <servlet-mapping>152 <servlet-name>spotimage</servlet-name>153 <url-pattern>/views/rawbioassays/rawdata/spotimage/*</url-pattern>154 140 </servlet-mapping> 155 141 -
trunk/www/views/experiments/explorer/view/view.jsp
r6833 r7635 70 70 import="net.sf.basedb.util.formatter.Formatter" 71 71 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 72 import="net.sf.basedb.clients.web.formatter.SpotImageFormatter"73 72 import="net.sf.basedb.clients.web.taglib.table.TableColumn" 74 73 import="java.util.Date" … … 130 129 { 131 130 DynamicUtil.addRawDataColumns(spotColumns, dc, rawDataType, "raw.", "$", "[Raw] "); 132 spotColumns.add(new TableColumn("raw.spotimage", "$id", "raw('id')", Type.INT,133 "[Raw] Spotimage", "", "auto", false, false, false, null,134 new SpotImageFormatter(dc, rawDataType, root)));135 131 } 136 132 -
trunk/www/views/rawbioassays/bioassays.js
r7604 r7635 83 83 Buttons.addClickHandler('btnShare', Buttons.shareItem, attributes); 84 84 Buttons.addClickHandler('btnSetOwner', Buttons.setOwner, attributes); 85 Buttons.addClickHandler('btnEditSpotImages', bioassays.editSpotImages, attributes);86 85 Buttons.addClickHandler('btnExport', Buttons.runPlugin, attributes); 87 86 Buttons.addClickHandler('btnImport', Buttons.runPlugin, attributes); … … 131 130 } 132 131 133 134 bioassays.editSpotImages = function()135 {136 var url = 'index.jsp?ID='+App.getSessionId();137 url += '&cmd=EditSpotImages&item_id='+Data.get('page-data', 'item-id');138 Dialogs.openPopup(url, 'EditSpotImages', 600, 400);139 }140 141 132 bioassays.viewRawData = function() 142 133 { -
trunk/www/views/rawbioassays/index.jsp
r7605 r7635 231 231 forward = editPage; 232 232 } 233 else if ("EditSpotImages".equals(cmd))234 {235 // Display the spot images edit page for a single item (should be opened in a popup)236 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);237 redirect = "edit_spotimages.jsp?ID="+ID;238 }239 233 else if ("NewItem".equals(cmd)) 240 234 { … … 585 579 redirect = "../../views/itemlists/index.jsp?ID="+ID+"&cmd=NewItem&addItems=1&memberType=RAWBIOASSAY&formId=rawbioassays"; 586 580 } 587 else if ("CreateSpotImages".equals(cmd))588 {589 dc = sc.newDbControl();590 ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);591 RawBioAssay rba = RawBioAssay.getById(dc, cc.getId());592 593 int redFileId = Values.getInt(request.getParameter("redfile_id"));594 File red = redFileId == 0 ? null : File.getById(dc, redFileId);595 int greenFileId = Values.getInt(request.getParameter("greenfile_id"));596 File green = greenFileId == 0 ? null : File.getById(dc, greenFileId);597 int blueFileId = Values.getInt(request.getParameter("bluefile_id"));598 File blue = blueFileId == 0 ? null : File.getById(dc, blueFileId);599 600 String path = Values.getStringOrNull(request.getParameter("path"));601 if (path.startsWith("~/"))602 {603 User user = User.getById(dc, sc.getLoggedInUserId());604 path = "~"+user.getLogin()+path.substring(1);605 }606 Path p = new Path(path, Path.Type.FILE);607 File saveAs = File.getByPath(dc, p, true);608 if (saveAs.isInDatabase() && !Values.getBoolean(request.getParameter("overwrite")))609 {610 throw new ItemAlreadyExistsException("File[path="+path+"]");611 }612 613 IntegerParameterType integerParameter = new IntegerParameterType();614 FloatParameterType floatParameter = new FloatParameterType();615 FileParameterType fileParameter = new FileParameterType();616 ItemParameterType<RawBioAssay> itemParameter = new ItemParameterType<>(RawBioAssay.class, null);617 StringParameterType stringParameter = new StringParameterType();618 BooleanParameterType booleanParameter = new BooleanParameterType();619 620 PluginDefinition plugin = PluginDefinition.getByClassName(dc, "net.sf.basedb.plugins.SpotImageCreator");621 Job job = Job.getNew(dc, plugin, null, null);622 job.setName("Create spot images for raw bioassay: " + rba.getName());623 job.setParameterValue("rawBioAssay", "Raw bioassay",624 "The raw bioassay to create spot images for", itemParameter, rba);625 job.setParameterValue("xScale", "X scale factor",626 "The raw data X value will be divided by this value to get the pixel coordinate",627 integerParameter, Values.getInt(request.getParameter("x_scale")));628 job.setParameterValue("yScale", "Y scale factor",629 "The raw data Y value will be divided by this value to get the pixel coordinate",630 integerParameter, Values.getInt(request.getParameter("y_scale")));631 job.setParameterValue("xOffset", "X offset value",632 "The offset is subtracted from the raw data X value",633 integerParameter, Values.getInt(request.getParameter("x_offset")));634 job.setParameterValue("yOffset", "Y offset value",635 "The offset is subtracted from the raw data Y value",636 integerParameter, Values.getInt(request.getParameter("y_offset")));637 job.setParameterValue("spotsize", "Spot size", "The size of each spot in pixels",638 integerParameter, Values.getInt(request.getParameter("spotsize")));639 job.setParameterValue("gamma", "Gamma", "Gamma correction for display",640 floatParameter, Values.getFloat(request.getParameter("gamma")));641 job.setParameterValue("quality", "Quality",642 "The quality is a number between 0.0 and 1.0, with 1.0 indicating highest quality.",643 floatParameter, Values.getFloat(request.getParameter("quality")));644 job.setParameterValue("redFile", "Red image",645 "The file containing the image to use for the red part", fileParameter, red);646 job.setParameterValue("greenFile", "Green image",647 "The file containing the image to use for the green part", fileParameter, green);648 job.setParameterValue("blueFile", "Blue image",649 "The file containing the image to use for the red part", fileParameter, blue);650 job.setParameterValue("path", "Save as",651 "The file name where the spot images should be saved", stringParameter, path);652 job.setParameterValue("overwrite", "Overwrite",653 "If an existing file should be overwritten or not", booleanParameter, Values.getBoolean(request.getParameter("overwrite")));654 655 dc.saveItem(job);656 dc.commit();657 658 redirect = "../jobs/index.jsp?ID="+ID+"&cmd=ViewItem&item_id="+job.getId();659 }660 581 else 661 582 { -
trunk/www/views/rawbioassays/rawdata/list_rawdata.jsp
r7604 r7635 288 288 filterable="true" 289 289 exportable="true" 290 />291 <tbl:columndef292 id="spotImage"293 title="Spot image"294 290 /> 295 291 <% … … 709 705 int index = cc.getPage()*cc.getRowsPerPage(); 710 706 int selectedItemId = cc.getId(); 711 boolean hasSpotImages = rawBioAssay.hasSpotImages();712 707 if (rawData != null) 713 708 { … … 763 758 <tbl:cell column="x"><%=item.getX()%></tbl:cell> 764 759 <tbl:cell column="y"><%=item.getY()%></tbl:cell> 765 <tbl:cell column="spotImage">766 <%767 if (hasSpotImages)768 {769 %>770 <img class="spotimage" src="spotimage/<%=ID%>/<%=rawBioAssay.getId()%>/<%=itemId%>/spot<%=item.getPosition()%>.png">771 <%772 }773 %>774 </tbl:cell>775 760 <% 776 761 for (RawDataProperty rdp : rawBioAssay.getRawDataType().getProperties()) -
trunk/www/views/rawbioassays/rawdata/view_rawdata.jsp
r7605 r7635 79 79 final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, rawDataType.getId(), null, null); 80 80 final int itemId = cc.getId(); 81 final boolean hasSpotImages = rawBioAssay.hasSpotImages();82 81 83 82 Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); … … 138 137 <th class="leftborder">Feature</th> 139 138 <td><%=feature == null ? "<i>- none -</i>" : feature.getId()%></td> 140 </tr>141 <tr>142 <th>Spot image</th>143 <td>144 <%145 if (hasSpotImages)146 {147 %>148 <img class="spotimage" src="spotimage/<%=ID%>/<%=rawBioAssay.getId()%>/<%=itemId%>/spot<%=rawData.getPosition()%>.png">149 <%150 }151 else152 {153 %>154 <i>- none -</i>155 <%156 }157 %>158 </td>159 <th class="leftborder"></th>160 <td></td>161 139 </tr> 162 140 </tbody> -
trunk/www/views/rawbioassays/view_rawbioassay.jsp
r7604 r7635 39 39 import="net.sf.basedb.core.Experiment" 40 40 import="net.sf.basedb.core.RawDataType" 41 import="net.sf.basedb.core.SpotImages"42 41 import="net.sf.basedb.core.Protocol" 43 42 import="net.sf.basedb.core.Software" … … 268 267 tooltip="Run a plugin" 269 268 visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" 270 />271 <tbl:button272 id="btnEditSpotImages"273 image="runplugin.png"274 title="Create spot images…"275 visible="<%=writePermission && rawBioAssay.getNumDbSpots() > 0%>"276 269 /> 277 270 <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" … … 465 458 } 466 459 } 467 if (rawBioAssay.hasSpotImages())468 {469 SpotImages spi = rawBioAssay.getSpotImages();470 %>471 <tbody class="sectionheader">472 <tr>473 <th colspan="4">Spot images</th>474 </tr>475 </tbody>476 <tr>477 <th>X scale</th>478 <td><%=spi.getXScale()%></td>479 <th class="leftborder">Spot size</th>480 <td><%=spi.getSpotsize()%></td>481 </tr>482 <tr>483 <th>Y scale</th>484 <td><%=spi.getYScale()%></td>485 <th class="leftborder">Gamma correction</th>486 <td><%=spi.getGamma()%></td>487 </tr>488 <tr>489 <th>X offset</th>490 <td><%=spi.getXOffset()%></td>491 <th class="leftborder">Quality</th>492 <td><%=spi.getQuality()%></td>493 </tr>494 <tr>495 <th>Y offset</th>496 <td><%=spi.getYOffset()%></td>497 <th class="leftborder"></th>498 <td></td>499 </tr>500 <tr>501 <th class="topborder">Red image file</th>502 <td colspan="3" class="topborder"><base:propertyvalue item="<%=spi%>" property="redImageFile" /></td>503 </tr>504 <tr>505 <th>Green image file</th>506 <td colspan="3"><base:propertyvalue item="<%=spi%>" property="greenImageFile" /></td>507 </tr>508 <tr>509 <th>Blue image file</th>510 <td colspan="3"><base:propertyvalue item="<%=spi%>" property="blueImageFile" /></td>511 </tr>512 <tr>513 <th>Spot images file</th>514 <td colspan="3"><base:propertyvalue item="<%=spi%>" property="spotImagesFile" /></td>515 </tr>516 <%517 }518 460 %> 519 461 <tr class="dynamic">
Note: See TracChangeset
for help on using the changeset viewer.