Changeset 4241


Ignore:
Timestamp:
Nov 16, 2016, 3:00:25 PM (6 years ago)
Author:
olle
Message:

Refs #911. MeLuDI updated in case summary with a new project section, containing basic information on the active project. It initially contains two values, the name of the project, with a link to the BASE project item, and the project description:

  1. JSP file case_summary.jsp in resources/reports/ updated with new <div> tag block with class "info-section" and ID "project-info" before the case information section.
  2. Javascript file case_summary.js in resources/reports/ updated in function caseInfoLoaded(response) to obtain JSONObject with project information from response and JSON key "projInfo". If project information is supplied, the name is added with link to BASE project item in HTML element with ID "project.name", and the description in HTML element with ID "project.description", else a message is displayed. (Normally project information will be available.)
  3. Java servlet class/file CaseSummaryServlet.java in src/net/sf/based/meludi/servlet/ updated in protected method void doGet(HttpServletRequest req, HttpServletResponse resp) for command "GetCaseInfo" to obtain information on the active project, and to return database ID, project name, and description in a JSONObject with JSON key "projInfo" in the JSON response.
Location:
extensions/net.sf.basedb.meludi/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.meludi/trunk/resources/reports/case_summary.js

    r4221 r4241  
    3838    sampleItemNumDigits = response.sampleItemNumDigits;
    3939    Doc.element('caseName').setAttribute('title', 'Please enter a case id ("' + sampleItemPrefix + '" + ' + sampleItemNumDigits + ' digits)');
     40    var projInfo = response.projInfo;
     41
     42    if (projInfo)
     43    {
     44      cs.addColumn('project.name', cs.asLink('PROJECT', projInfo));
     45      cs.addColumn('project.description', Strings.encodeTags(projInfo.description));
     46    }
     47    else
     48    {
     49      cs.addColumn('project.name', cs.asNoInfo('No project information has been registered'));
     50      Doc.hide('project-details');
     51    }
    4052
    4153    if (caseInfo)
  • extensions/net.sf.basedb.meludi/trunk/resources/reports/case_summary.jsp

    r4195 r4241  
    143143        }
    144144        %>
     145        <div class="info-section" id="project-info">
     146          <div>
     147          <table class="info-table">
     148          <thead>
     149            <tr id="project.name">
     150              <th id="project-header">Project</th>
     151            </tr>
     152          </thead>
     153          <tbody id="project-details" class="info-details">
     154            <tr id="project.description" class="comment dynamic-column">
     155              <th>Description</th>
     156            </tr>
     157          </tbody>
     158          </table>
     159          </div>
     160        </div>
     161
    145162        <div class="info-section" id="case-info">
    146163          <div>
  • extensions/net.sf.basedb.meludi/trunk/src/net/sf/basedb/meludi/servlet/CaseSummaryServlet.java

    r4221 r4241  
    2929import net.sf.basedb.core.Permission;
    3030import net.sf.basedb.core.PermissionDeniedException;
     31import net.sf.basedb.core.Project;
    3132import net.sf.basedb.core.Protocol;
    3233import net.sf.basedb.core.Sample;
     
    8687        */
    8788        dc = sc.newDbControl();
    88        
     89
    8990        String caseName = req.getParameter("caseName");
    9091        // Check if input 'caseName' is valid, or is personal number
     
    123124        json.put("sections", jsonSections);
    124125       
     126        // Load project information
     127        Project project = Project.getById(dc, sc.getActiveProjectId());
     128        if (project != null)
     129        {
     130          JSONObject jsonProj = new JSONObject();
     131          jsonProj.put("id", project.getId());
     132          jsonProj.put("name", project.getName());
     133          jsonProj.put("description", project.getDescription());
     134          jsonSections.add(loadSectionInfo(sc, "project"));
     135          json.put("projInfo", jsonProj);
     136        }
     137
    125138        // Load case (null if not found) and patient
    126139        if (theCase == null)
Note: See TracChangeset for help on using the changeset viewer.