Changeset 3825


Ignore:
Timestamp:
Apr 5, 2016, 8:12:42 AM (6 years ago)
Author:
Nicklas Nordborg
Message:

References #861: YellowLabel? tracking wizard

Added Re-create report PDF functionality to make easier to create new versions of the pilot report in case not all information (eg. RNAQC) was available when the first version was created.

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/yellowlabel/list.js

    r3824 r3825  
    2727    Buttons.addClickHandler('btnMarkAsCompleted', yellow.markAsCompleted);
    2828    Buttons.addClickHandler('btnCreatePilotReportZip', yellow.createPilotReportZip);
     29    Buttons.addClickHandler('btnCreatePilotReportPdf', yellow.createPilotReportPdf);
    2930   
    3031    // Navigation
     
    387388  }
    388389 
    389 
     390  yellow.createPilotReportPdf = function()
     391  {
     392    var frm = document.forms['reggie'];
     393   
     394    // Filter out items that have a pilot report
     395    var filter = new Filter();
     396    filter.addDateCriteria(ItemProperty.RawDate, '<2017');
     397   
     398    var selected = yellow.checkSelected(filter, 'Select at least one specimen that has raw data');
     399    if (selected.length == 0) return;
     400
     401    var raw = [];
     402    for (var i = 0; i < selected.length; i++)
     403    {
     404      raw[i] = { 'id': selected[i].raw.id };
     405    }
     406
     407    var submitInfo = {};
     408    submitInfo.rawBioAssays = raw;
     409    submitInfo.useDefaultSoftware = 1;
     410    //submitInfo.software = parseInt(frm.reportSoftware.value);
     411    submitInfo.report = 'PILOT_REPORT';
     412   
     413    var url = '../Report.servlet?ID='+App.getSessionId();
     414    url += '&cmd=CreateReport';
     415    Wizard.asyncJsonRequest(url, yellow.reportJobSubmitted, 'POST', JSON.stringify(submitInfo));
     416  }
     417
     418  yellow.reportJobSubmitted = function(response)
     419  {
     420    if (response.job)
     421    {
     422      Items.viewItem('JOB', response.job.id);
     423      location.reload(true);
     424    }
     425  }
     426 
    390427  yellow.submit = function(event)
    391428  {
    392429    var submitInfo = event.detail;
    393     //App.debug(event.detail);
    394     //Wizard.asyncJsonRequest(submitUrl, search.submissionResults, 'POST', JSON.stringify(submitInfo));
    395 
    396430    var url = '../YellowLabel.servlet?ID='+App.getSessionId();
    397431    url += '&cmd='+submitInfo.cmd;
  • extensions/net.sf.basedb.reggie/trunk/resources/yellowlabel/list.jsp

    r3822 r3825  
    133133        />
    134134        <tbl:button
     135          id="btnCreatePilotReportPdf"
     136          image="<%=home+"/images/pdffile.png"%>"
     137          title="Re-create report PDFs&hellip;"
     138        />
     139        <tbl:button
    135140          id="btnCreatePilotReportZip"
    136141          image="file_compressed.png"
    137           title="Create Pilot report ZIP file&hellip;"
     142          title="Create report ZIP archive&hellip;"
    138143        />
    139144      </tbl:toolbar>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/ReportServlet.java

    r3768 r3825  
    1919import net.sf.basedb.core.DbControl;
    2020import net.sf.basedb.core.ItemQuery;
     21import net.sf.basedb.core.Job;
    2122import net.sf.basedb.core.PlatformVariant;
    2223import net.sf.basedb.core.RawBioAssay;
     
    3738import net.sf.basedb.reggie.dao.ReggieRole;
    3839import net.sf.basedb.reggie.dao.Rna;
     40import net.sf.basedb.reggie.dao.Subtype;
    3941import net.sf.basedb.reggie.pdf.PdfReportTemplate;
    4042import net.sf.basedb.reggie.plugins.GeneReportPlugin;
     
    162164        String report = (String)jsonReq.get("report");
    163165       
     166        if (softwareId == null && jsonReq.get("useDefaultSoftware") != null)
     167        {
     168          Software defaultSoftware = Subtype.REPORT_SOFTWARE.getLatestProjectDefault(dc, Annotationtype.REPORT_TEMPLATE.createFilter(report));
     169          if (defaultSoftware != null) softwareId = defaultSoftware.getId();
     170        }
     171       
    164172        // Load common items
    165173        Software software = softwareId != null ? Software.getById(dc, softwareId.intValue()) : null;
     
    176184        }
    177185       
    178         GeneReportPlugin.createReportJob(dc, toReport, reports);
     186        Job j = GeneReportPlugin.createReportJob(dc, toReport, reports);
    179187        dc.commit();
    180188       
     189        json.put("job", JsonUtil.getJobAsJSON(j));
    181190        jsonMessages.add("Successfully scheduled job for creating " + toReport.size() + " reports" );
    182191      }
Note: See TracChangeset for help on using the changeset viewer.