Changeset 3810


Ignore:
Timestamp:
Mar 23, 2016, 8:05:04 AM (6 years ago)
Author:
Nicklas Nordborg
Message:

References #861: YellowLabel? tracking wizard

The "Pilot report" column now show the last updated date.

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
2 added
5 edited

Legend:

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

    r3800 r3810  
    2121    Events.addEventHandler('libraryDateFilter', 'change', yellow.filterOnChange);
    2222    Events.addEventHandler('rawBioAssayDateFilter', 'change', yellow.filterOnChange);
    23     Events.addEventHandler('pilotReportExistsFilter', 'change', yellow.filterOnChange);
     23    Events.addEventHandler('pilotReportDateFilter', 'change', yellow.filterOnChange);
    2424
    2525    Buttons.addClickHandler('check_uncheck', yellow.selectAll);
     
    111111      html += '<td class="dottedleft">'+(lib ? Reggie.reformatDate(lib.creationDate):'')+'</td>';
    112112      html += '<td class="dottedleft">'+(raw ? Reggie.reformatDate(raw.creationDate):'')+'</td>';
    113       html += '<td class="dottedleft">'+yellow.asFileLink(pilotReport, 'pdffile.png')+'</td>';
     113      html += '<td class="dottedleft">'+(pilotReport ? Reggie.reformatDate(pilotReport.lastUpdatedDate):'') + yellow.asFileLink(pilotReport, 'pdffile.png')+'</td>';
    114114      html += '</tr>';
    115115    }
     
    189189    filter.addDateCriteria(ItemProperty.LibraryDate, frm.libraryDateFilter.value);
    190190    filter.addDateCriteria(ItemProperty.RawDate, frm.rawBioAssayDateFilter.value);
    191     filter.addNumericCriteria(ItemProperty.PilotReportExists, frm.pilotReportExistsFilter.value);
     191    filter.addDateCriteria(ItemProperty.PilotReportDate, frm.pilotReportDateFilter.value);
    192192
    193193    var numActive = 0;
     
    398398    var firstChar = f2.charAt(0);
    399399    if (firstChar == '<' || firstChar == '>') f2 = f2.substring(1);
    400     f2 = f2.replace(/\-/, '');
     400    f2 = f2.replace(/\-/g, '');
    401401    var cmp = Comparator.get(firstChar, Comparator.startsWith);
    402402    this.criterias[this.criterias.length] = function(item) { return cmp(itemProp(item), f2) };
     
    458458  }
    459459 
    460   p.PilotReportExists = function(item)
    461   {
    462     return item.pilotReport ? 1 : 0;
     460  p.PilotReportDate = function(item)
     461  {
     462    return item.pilotReport ? item.pilotReport.lastUpdatedDate : null;
    463463  }
    464464
  • extensions/net.sf.basedb.reggie/trunk/resources/yellowlabel/list.jsp

    r3800 r3810  
    165165          <th class="dottedleft"><input type="text" name="libraryDateFilter" id="libraryDateFilter"></th>
    166166          <th class="dottedleft"><input type="text" name="rawBioAssayDateFilter" id="rawBioAssayDateFilter"></th>
    167           <th class="dottedleft">
    168             <select name="pilotReportExistsFilter" id="pilotReportExistsFilter">
    169               <option value="">&nbsp;
    170               <option value="1">yes
    171               <option value="0">no
    172             </select>
    173           </th>
     167          <th class="dottedleft"><input type="text" name="pilotReportDateFilter" id="pilotReportDateFilter"></th>
    174168        </tr>
    175169      </thead>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/JsonUtil.java

    r3787 r3810  
    2626import net.sf.basedb.reggie.converter.ValueConverter;
    2727import net.sf.basedb.reggie.dao.ReggieRole;
     28import net.sf.basedb.reggie.json.LoadMoreJson;
    2829import net.sf.basedb.util.Values;
    2930
     
    215216    @since 2.18, 4.3
    216217  */
    217   @SuppressWarnings("unchecked")
    218   public static JSONObject loadLinkedItem(DbControl dc, BasicItem item, String linkName, Item linkedType)
     218  @SuppressWarnings({ "unchecked", "rawtypes" })
     219  public static JSONObject loadLinkedItem(DbControl dc, BasicItem item, String linkName, Item linkedType, LoadMoreJson moreJson)
    219220  {
    220221    JSONObject json = null;
     
    229230        json.put("name", linkedItem.getName());
    230231        json.put("type", linkedItem.getType().name());
     232        if (moreJson != null) moreJson.addMore(dc, json, linkedItem);
    231233      }
    232234    }
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/CaseSummaryServlet.java

    r3782 r3810  
    947947      raw.loadAnnotations(dc, "result", Annotationtype.ANALYSIS_RESULT, null);
    948948      XmlConfig cfg = Reggie.getConfig();
    949       raw.setAnnotation("geneReport", JsonUtil.loadLinkedItem(dc, rba, cfg.getConfig("rscript/gene-report/pdf-name", null, GeneReportWorker.DEFAULT_PDF_NAME), Item.FILE));
    950       raw.setAnnotation("pilotReport", JsonUtil.loadLinkedItem(dc, rba, cfg.getConfig("rscript/pilot-report/pdf-name", null, PilotReportWorker.DEFAULT_PDF_NAME), Item.FILE));
     949      raw.setAnnotation("geneReport", JsonUtil.loadLinkedItem(dc, rba, cfg.getConfig("rscript/gene-report/pdf-name", null, GeneReportWorker.DEFAULT_PDF_NAME), Item.FILE, null));
     950      raw.setAnnotation("pilotReport", JsonUtil.loadLinkedItem(dc, rba, cfg.getConfig("rscript/pilot-report/pdf-name", null, PilotReportWorker.DEFAULT_PDF_NAME), Item.FILE, null));
    951951    }
    952952    raw.setAnnotation("comment", rba.getDescription());
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/YellowLabelServlet.java

    r3791 r3810  
    1919import net.sf.basedb.core.DbControl;
    2020import net.sf.basedb.core.Extract;
     21import net.sf.basedb.core.File;
    2122import net.sf.basedb.core.Item;
    2223import net.sf.basedb.core.ItemQuery;
     
    4445import net.sf.basedb.reggie.dao.SpecimenTube;
    4546import net.sf.basedb.reggie.dao.Subtype;
     47import net.sf.basedb.reggie.json.LoadMoreJson;
    4648import net.sf.basedb.reggie.pdf.PdfCombiner;
    4749import net.sf.basedb.reggie.pdf.PdfReportTemplate;
     
    131133
    132134                XmlConfig cfg = Reggie.getConfig();
    133                 JSONObject jsonPilot = JsonUtil.loadLinkedItem(dc, rba, cfg.getConfig("rscript/pilot-report/pdf-name", null, PilotReportWorker.DEFAULT_PDF_NAME), Item.FILE);
     135                String pdfName = cfg.getConfig("rscript/pilot-report/pdf-name", null, PilotReportWorker.DEFAULT_PDF_NAME);
     136                JSONObject jsonPilot = JsonUtil.loadLinkedItem(dc, rba, pdfName, Item.FILE,
     137                  new LoadMoreJson<File>()
     138                  {
     139                    @Override
     140                    public void addMore(DbControl dc, JSONObject json, File file)
     141                    {
     142                      json.put("lastUpdatedDate", Reggie.CONVERTER_DATE_TO_STRING.convert(file.getLastUpdate()));
     143                    }
     144                   
     145                  });
    134146                if (jsonPilot != null)
    135147                {
Note: See TracChangeset for help on using the changeset viewer.