Changeset 7635


Ignore:
Timestamp:
Mar 11, 2019, 11:01:10 AM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #2136: Remove support for spot images

Removed spot-image related functionality from the web client.

Location:
trunk
Files:
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/config/dist/web.xml

    r7608 r7635  
    138138    <servlet-name>upload</servlet-name>
    139139    <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.ViewSpotImage
    149     </servlet-class>
    150   </servlet>
    151   <servlet-mapping>
    152     <servlet-name>spotimage</servlet-name>
    153     <url-pattern>/views/rawbioassays/rawdata/spotimage/*</url-pattern>
    154140  </servlet-mapping>
    155141
  • trunk/www/views/experiments/explorer/view/view.jsp

    r6833 r7635  
    7070  import="net.sf.basedb.util.formatter.Formatter"
    7171  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
    72   import="net.sf.basedb.clients.web.formatter.SpotImageFormatter"
    7372  import="net.sf.basedb.clients.web.taglib.table.TableColumn"
    7473  import="java.util.Date"
     
    130129  {
    131130    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)));
    135131  }
    136132
  • trunk/www/views/rawbioassays/bioassays.js

    r7604 r7635  
    8383      Buttons.addClickHandler('btnShare', Buttons.shareItem, attributes);
    8484      Buttons.addClickHandler('btnSetOwner', Buttons.setOwner, attributes);
    85       Buttons.addClickHandler('btnEditSpotImages', bioassays.editSpotImages, attributes);
    8685      Buttons.addClickHandler('btnExport', Buttons.runPlugin, attributes);
    8786      Buttons.addClickHandler('btnImport', Buttons.runPlugin, attributes);
     
    131130  }
    132131
    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 
    141132  bioassays.viewRawData = function()
    142133  {
  • trunk/www/views/rawbioassays/index.jsp

    r7605 r7635  
    231231    forward = editPage;
    232232  }
    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   }
    239233  else if ("NewItem".equals(cmd))
    240234  {
     
    585579    redirect = "../../views/itemlists/index.jsp?ID="+ID+"&cmd=NewItem&addItems=1&memberType=RAWBIOASSAY&formId=rawbioassays";
    586580  }
    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   }
    660581  else
    661582  {
  • trunk/www/views/rawbioassays/rawdata/list_rawdata.jsp

    r7604 r7635  
    288288        filterable="true"
    289289        exportable="true"
    290       />
    291       <tbl:columndef
    292         id="spotImage"
    293         title="Spot image"
    294290      />
    295291      <%
     
    709705          int index = cc.getPage()*cc.getRowsPerPage();
    710706          int selectedItemId = cc.getId();
    711           boolean hasSpotImages = rawBioAssay.hasSpotImages();
    712707          if (rawData != null)
    713708          {
     
    763758                <tbl:cell column="x"><%=item.getX()%></tbl:cell>
    764759                <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>
    775760                <%
    776761                for (RawDataProperty rdp : rawBioAssay.getRawDataType().getProperties())
  • trunk/www/views/rawbioassays/rawdata/view_rawdata.jsp

    r7605 r7635  
    7979  final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, rawDataType.getId(), null, null);
    8080  final int itemId = cc.getId();
    81   final boolean hasSpotImages = rawBioAssay.hasSpotImages(); 
    8281 
    8382  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
     
    138137        <th class="leftborder">Feature</th>
    139138        <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           else
    152           {
    153             %>
    154             <i>- none -</i>
    155             <%
    156           }
    157           %>
    158         </td>
    159         <th class="leftborder"></th>
    160         <td></td>
    161139      </tr>
    162140      </tbody>
  • trunk/www/views/rawbioassays/view_rawbioassay.jsp

    r7604 r7635  
    3939  import="net.sf.basedb.core.Experiment"
    4040  import="net.sf.basedb.core.RawDataType"
    41   import="net.sf.basedb.core.SpotImages"
    4241  import="net.sf.basedb.core.Protocol"
    4342  import="net.sf.basedb.core.Software"
     
    268267              tooltip="Run a plugin"
    269268              visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
    270             />
    271             <tbl:button
    272               id="btnEditSpotImages"
    273               image="runplugin.png"
    274               title="Create spot images&hellip;"
    275               visible="<%=writePermission && rawBioAssay.getNumDbSpots() > 0%>"
    276269            />
    277270            <ext:render extensions="<%=invoker%>" context="<%=jspContext%>"
     
    465458          }
    466459        }
    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         }
    518460        %>
    519461        <tr class="dynamic">
Note: See TracChangeset for help on using the changeset viewer.