Changes between Version 2 and Version 3 of Ticket #792, comment 12


Ignore:
Timestamp:
Jun 22, 2015, 2:47:54 PM (9 years ago)
Author:
olle

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #792, comment 12

    v2 v3  
    2121 2. New JSP file `extramaterial.jsp` in `resources/sampleproc/` added. It contains two steps and is coupled to new javascript file `extramaterial.js` in `resources/sampleproc/`.
    2222 3. New javascript file `extramaterial.js` in `resources/sampleproc/` added. It contains the following functions (among other):[[BR]]a. Function `initPage()` adds event and button click handlers, enters today's date as default arrival date, and displays step one of the wizard.[[BR]]b. Function `validateStep1(event)` calls function `nofExtraMaterialOnChange()` to check that the number of extra materials is OK.[[BR]]c. Function `initializeStep2()` creates a table with one input row for each new extra material to be added, and adds event handlers for type radio buttons and arrival date fields.[[BR]]d. Function `nameOnChange()` performs consistency checks on the input name, and calls servlet `SpecimenTubeServlet` with command "`GetExtraMaterialInfo`" and callback function `extraMaterialInfoLoaded(response)` to perform checks requiring the database and create an item name.[[BR]]e. Function `extraMaterialInfoLoaded(response)` performs checks requiring the database and creates an item name, if no errors are found. For DNA and RNA items are checked that no previous item with same name and type exists. Suffix numbers for new specimen items are obtained by adding one to the highest suffix number of existing specimen items with the given name. For a new specimen, function `updateSpecimenItemNames(currentName, highestSpecimenNumber)` is called to update item names.[[BR]]f. Function `updateSpecimenItemNames(currentName, highestSpecimenNumber)` updates all item names for specimens with given name by adding numbers above those already used for specimens in the database.[[BR]]g. Function `typeOnChange(event)` calls function `nameOnChange(event)`, since a change of type implies a change in suffix for item name.[[BR]]h. Function `arrivalDateOnChange(event)` performs date consistency checks for arrival date entries.[[BR]]i. Function `validateStep2(event)` performs basic validation checks (currently only that the number of extra material is valid).[[BR]]j. Function `submit()` stores the input data in a JSON array and submits it to servlet `SpecimenTubeServlet` with command "`CreateExtraMaterial`" and callback function `submissionResults(response)` using a "`POST`" request.[[BR]]k. Function `submissionResults(response)` displays the response message after registration.
     23 4. Java servlet class/file `SpecimenTubeServlet.java` in `src/net/sf/basedb/meludi/servlet/` updated:[[BR]]a. Protected method `void doGet(HttpServletRequest req, HttpServletResponse resp)` updated with new command "`GetExtraMaterialInfo`". It obtains information of the number of specimen, DNA, and RNA items with a given input name, as well as the highest suffix number for specimens with that input name.[[BR]]b. Protected method `void doPost(HttpServletRequest req, HttpServletResponse resp)` updated with new command "`CreateExtraMaterial`". It creates new extra material items, and for specimen items in the database, related DNA and RNA items.