Commit 275b82d2 by Jorem Magcawas

change code of getting the encoded fields from the xml to form fields

parent 57713be7
......@@ -26,23 +26,7 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
......
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="WebGde-0.0.1-SNAPSHOT">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/annotations"/>
<property name="java-output-path" value="/WebGde/build/classes"/>
<property name="context-root" value="WebGde"/>
</wb-module>
</project-modules>
......@@ -22,9 +22,9 @@
// schema with 5 fields and all possible collections
//const SCHEMA_FILE = "./src/sample_schema/5_field_schema.json"
var SCHEMA_FILE = "./src/sample_schema/HR Speed Test schema.json"
/*var SCHEMA_FILE = "./src/sample_schema/SC Schema.json"*/
// const SCHEMA_FILE = "./src/sample_schema/Sample_Schema.json"
var SCHEMA_FILE = "./src/sample_schema/HR Speed Test schema.json"
//const INPUT_FILES = ["./input/Ong, Mae Janica - Application Form.TIFF","./input/Magalona, Rowell James - Application Form.TIFF","./input/Felizardo, Brylle Theodure - Application Form.TIFF","./input/Laxamana, Conrad John - Application Form.TIFF"] // list of URLs
......
......@@ -18,7 +18,7 @@ async function initGetElement() {
let dir = await lst.data;
dir = [...dir];
Dirfiles = dir.slice(dir.indexOf(lastImage) + 1);
Dirfiles = dir;
sessionStorage.setItem("dir_files", JSON.stringify(Dirfiles));
sessionStorage.setItem("element_id", retElement.element.elementId);
......@@ -183,8 +183,29 @@ async function getWaitingElement() {
return json;
}
async function getFieldData(){
let elementId = sessionStorage.getItem("element_id");
let xmlData = {
"imageName": File_Path,
"outputDir": sessionStorage.getItem("element_file_loc") + "/" + (ENCODING_PASS == "PASS1" ? elementId + ".DTA" : elementId + ".DTB")
}
let response = await fetch(urlGetFields, {
method: "POST",
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(xmlData)
});
let json = await response.json();
return json;
}
async function createOutputXml(fields, metrics, doctype, section) {
let elementId = sessionStorage.getItem("element_id");
let xmlData = {
"projCode": PROJECT_CODE,
"userId": sessionStorage.getItem("user_id"),
......
......@@ -4,3 +4,4 @@ let urlWriteXml = GFS_URL + "/" + "write-xml";
let urlUpdateEob = GFS_URL + "/" + "update-eob";
let urlUpdateException = GFS_URL + "/" + "update-exception";
let urlWriteMetrics = GFS_URL + "/" + "write-metrics";
let urlGetFields = GFS_URL + "/" + "get-fields";
\ No newline at end of file
......@@ -86,7 +86,6 @@ async function accessFile() {
// localStorage.setItem("submit", "0");
// localStorage.setItem("display_counter", parseInt(localStorage.getItem("display_counter")) + 1); //update how many have been fetched
// var file = new File([blob], filename + ".TIFF", {type: "img"}); //uplaod to uploadimgfolder //scanned images
// uploadFile(file);
};
}
......@@ -162,8 +161,7 @@ async function accessFile() {
let totalImages = JSON.parse(sessionStorage.getItem("dir_files")).length;
count.onsuccess = async function() {
if (count.result == 0 && (localStorage.length) == 0) {
var formArray = [];
sessionStorage.setItem('formArray', JSON.stringify(formArray));
store.put({ id: count.result + 1, address: blob , name:filename, path:img});
url = URL.createObjectURL(blob);
window.addEventListener("load", loadDoc(url, TIFFViewer,filename), false);
......@@ -171,8 +169,8 @@ async function accessFile() {
size = size + total;
File_Name = filename;
File_Path = img;
populateFields();
var file = new File([blob], filename + ".TIFF", {type: "img"}); //uplaod to uploadimgfolder //scanned images
uploadFile(file);
} else if (count.result == 1 && (localStorage.length) == 1) {
document.getElementById('prev').setAttribute('disabled','true');
......@@ -183,36 +181,38 @@ async function accessFile() {
localStorage.setItem("sfIndex", 1);
size = size + total;
var file = new File([blob], filename + ".TIFF", {type: "img"}); //uplaod to uploadimgfolder //scanned images
uploadFile(file);
} else if(totalImages != (parseInt(localStorage.getItem("sfIndex"))) && img == null && count.result >= 2 && (localStorage.length) >= 2 && localStorage.getItem("submit") == 1){ //if only one file left
const idQuery = store.get(parseInt(localStorage.getItem("display_counter")));
document.getElementById('prev').removeAttribute('disabled');
idQuery.onsuccess = function () {
idQuery.onsuccess = async function () {
//url = URL.createObjectURL(idQuery.result.address);
//window.addEventListener("load", loadDoc(url, TIFFViewer,idQuery.result.name), false);
File_Name = idQuery.result.name;
File_Path = idQuery.result.path;
populateFields();
localStorage.setItem("submit", "0");
if (localStorage.getItem("prev") == 1) {
localStorage.setItem("prev", "0");
document.getElementById('next').removeAttribute('disabled');
populateForm(parseInt(localStorage.getItem("sfIndex")));
populateFields();
//populateForm(parseInt(localStorage.getItem("sfIndex")));
localStorage.setItem("display_counter", parseInt(localStorage.getItem("display_counter")) + 1);
} else {
document.getElementById('next').setAttribute('disabled', 'true');
localStorage.setItem("sfIndex", parseInt(localStorage.getItem("sfIndex")) + 1);
localStorage.setItem("display_counter", parseInt(localStorage.getItem("display_counter")) + 1);
var formArray = JSON.parse(sessionStorage.getItem('formArray'));
populateFields();
/*var formArray = JSON.parse(sessionStorage.getItem('formArray'));
if (typeof formArray[parseInt(localStorage.getItem("sfIndex")) - 1] !== 'undefined') {
populateForm(parseInt(localStorage.getItem("sfIndex")));
}
}*/
//store.clear();
//localStorage.setItem("nofilesleft", "1");
//promptNoFilesLeft();
}
};
} else if(img == null && count.result >= 2 && (localStorage.length) >= 2 && localStorage.getItem("submit") == 1){//no files left
// alert("No Files Left");
......@@ -232,7 +232,7 @@ async function accessFile() {
} else if (count.result >= 2 && (localStorage.length) >= 2 && localStorage.getItem("submit") == 1) {
const idQuery = store.get(parseInt(localStorage.getItem("display_counter")));
idQuery.onsuccess = function () {
idQuery.onsuccess = async function () {
document.getElementById('prev').removeAttribute('disabled');
document.getElementById('next').removeAttribute('disabled');
// url = URL.createObjectURL(idQuery.result.address);
......@@ -240,28 +240,31 @@ async function accessFile() {
document.getElementById('prev').removeAttribute('disabled');
File_Name = idQuery.result.name;
File_Path = idQuery.result.path;
populateFields();
localStorage.setItem("submit", "0");
if(localStorage.getItem("prev") == 1){
localStorage.setItem("prev", "0");
populateForm(parseInt(localStorage.getItem("sfIndex")));
populateFields();
//populateForm(parseInt(localStorage.getItem("sfIndex")));
localStorage.setItem("display_counter", parseInt(localStorage.getItem("display_counter")) + 1); //update how many have been fetched
} else {
//store.delete(parseInt(localStorage.getItem("display_counter")) - 1);
store.put({ id: parseInt(localStorage.getItem("display_counter")) + 1, address: blob , name:filename, path:img});
localStorage.setItem("display_counter", parseInt(localStorage.getItem("display_counter")) + 1); //update how many have been fetched
localStorage.setItem("sfIndex", parseInt(localStorage.getItem("sfIndex")) + 1);
var file = new File([blob], filename + ".TIFF", {type: "img"}); //uplaod to uploadimgfolder //scanned images
uploadFile(file);
var formArray = JSON.parse(sessionStorage.getItem('formArray'));
//var file = new File([blob], filename + ".TIFF", {type: "img"}); //uplaod to uploadimgfolder //scanned images
/*var formArray = JSON.parse(sessionStorage.getItem('formArray'));
if(typeof formArray[parseInt(localStorage.getItem("sfIndex")) - 1] !== 'undefined') {
populateForm(parseInt(localStorage.getItem("sfIndex")));
}
}*/
populateFields();
}
if(parseInt(localStorage.getItem("sfIndex"))<=1){
document.getElementById('prev').setAttribute('disabled','true');
}
//var file = new File([blob], filename + ".TIFF", {type: "img"}); //uplaod to uploadimgfolder //scanned images
//uploadFile(file);
};
size = size + total;
......@@ -343,15 +346,6 @@ async function accessFile() {
return urls;
}
function uploadFile(file) {
let formData = new FormData();
formData.append("file", file);
fetch('./src/accessFile/uploadimg.php',{
method: "POST",
body: formData
});
}
function getFolder(url){
const promise = fetch(url, {
method: 'GET',
......@@ -533,6 +527,7 @@ function refreshImage() {
File_Name = idQuery.result.name;
File_Path = idQuery.result.path;
};
}
}
......@@ -559,7 +554,20 @@ function promptNoFilesLeft(){
    var okButton = document.createElement('button');
    okButton.innerHTML = 'ok';
    okButton.onclick = function() {
    genericDiv.remove();
    genericDiv.remove();
var DBdeleteRequest = window.indexedDB.deleteDatabase("ImageDatabase");
DBdeleteRequest.addEventListener('blocked', function(e) {
console.log("Database cleared.");
});
DBdeleteRequest.addEventListener('upgradeneeded', function(e) {
console.log("Upgrade needed in deleting database");
});
DBdeleteRequest.addEventListener('error', function(e) {
console.log("Error in deleting database");
});
DBdeleteRequest.addEventListener('success', function(e) {
console.log("Database cleared.");
});
sessionStorage.clear();
localStorage.clear();
logoutKeycloak();
......
......@@ -3,20 +3,20 @@ let closerWindow;
let endButton = document.getElementById("endBtn");
function checkForm(form){
function checkForm(form) {
var inputs = form.getElementsByTagName("input");
var selects = form.getElementsByTagName("select");
inputsBlankCount = inputs.length;
selectsBlankCount = selects.length - 2;
for(var i=0; i<inputs.length; i++){
if(inputs[i].value == "") inputsBlankCount--;
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].value == "") inputsBlankCount--;
}
for(var i=0; i<selects.length; i++){
if(selects[i].options[selects[i].selectedIndex].value === "null") selectsBlankCount--;
for (var i = 0; i < selects.length; i++) {
if (selects[i].options[selects[i].selectedIndex].value === "null") selectsBlankCount--;
}
if(inputsBlankCount==0 && selectsBlankCount==0) return true;
if (inputsBlankCount == 0 && selectsBlankCount == 0) return true;
}
/*endButton.addEventListener("click", function(){
......@@ -26,7 +26,7 @@ function checkForm(form){
*/
function createEndSessionWindow(){
function createEndSessionWindow() {
let overlay = document.createElement("div");
overlay.classList.add("genericPopup");
......@@ -49,24 +49,24 @@ function createEndSessionWindow(){
okEnd.classList.add("emphasizeButton");
okEnd.innerHTML = 'ok';
okEnd.id = 'okEndButtn';
okEnd.onclick = async function () {
if(checkForm(form)){
okEnd.onclick = async function() {
if (checkForm(form)) {
var DBdeleteRequest = window.indexedDB.deleteDatabase("ImageDatabase");
DBdeleteRequest.addEventListener('blocked', function(e){
DBdeleteRequest.addEventListener('blocked', function(e) {
console.log("Database cleared.");
});
DBdeleteRequest.addEventListener('upgradeneeded', function(e){
DBdeleteRequest.addEventListener('upgradeneeded', function(e) {
console.log("Upgrade needed in deleting database");
});
DBdeleteRequest.addEventListener('error', function(e){
DBdeleteRequest.addEventListener('error', function(e) {
console.log("Error in deleting database");
});
DBdeleteRequest.addEventListener('success', function(e){
DBdeleteRequest.addEventListener('success', function(e) {
console.log("Database cleared.");
});
let returnElem = await returnElementLogout(sessionStorage.getItem("element_id"));
if( returnElem == 200){
if (returnElem == 200) {
returnSaveXML();
endWindow.style.display = 'none';
localStorage.clear();
......@@ -75,8 +75,7 @@ function createEndSessionWindow(){
submitted = false;
}
}
else{
} else {
alert("Fields are not empty. Submit or clear fields first.");
overlay.remove();
}
......@@ -100,7 +99,7 @@ function createEndSessionWindow(){
cancelEnd.addEventListener("click", function () {
cancelEnd.addEventListener("click", function() {
overlay.remove();
});
......
......@@ -53,7 +53,8 @@ const displayFields = async (parentID) => {
if (doctype == null && section == null) {
Object.keys(schema).every(function(key) {
let doctypes = schema[key];
sessionStorage.setItem("currentDoctype", key);
let underscoredKey = key.replaceAll(" ", "_");
sessionStorage.setItem("currentDoctype", underscoredKey);
const {
valid,
error
......@@ -62,17 +63,24 @@ const displayFields = async (parentID) => {
div.textContent = error
div.style.color = '#ff3333'
}
for (let key in doctypes) {
sessionStorage.setItem("currentSection", key);
for (let sec in doctypes) {
let underscoredSec = sec.replaceAll(" ", "_");
sessionStorage.setItem("currentSection", underscoredSec);
createDocTypeDropdown('DocType', div, schema);
createSection('Section', div, doctypes, key);
div = deconstruct(doctypes[key], div, key)
createSection('Section', div, doctypes, underscoredKey);
div = deconstruct(doctypes[sec], div, underscoredSec)
const submit = document.createElement('input')
submit.classList.add("submitButtons");
submit.classList.add(underscoredSec);
submit.type = 'submit'
div.appendChild(submit)
return false;
}
});
} else {
let doctypes = schema[doctype];
sessionStorage.setItem("currentDoctype", doctype);
let underscoredDoctype = doctype.replaceAll(" ", "_");
sessionStorage.setItem("currentDoctype", underscoredDoctype);
const {
valid,
error
......@@ -81,12 +89,72 @@ const displayFields = async (parentID) => {
div.textContent = error
div.style.color = '#ff3333'
}
sessionStorage.setItem("currentSection", section);
let underscoredSection = section.replaceAll(" ", "_");
sessionStorage.setItem("currentSection", underscoredSection);
createDocTypeDropdown('DocType', div, schema);
createSection('Section', div, doctypes, section);
div = deconstruct(doctypes[section], div, section)
createSection('Section', div, doctypes, underscoredDoctype);
div = deconstruct(doctypes[section], div, underscoredSection)
const submit = document.createElement('input')
submit.classList.add("submitButtons");
submit.classList.add(underscoredSection);
submit.type = 'submit'
div.appendChild(submit)
}
$(document.body).on("change","#DocType",function(){
const elements = document.getElementsByClassName(sessionStorage.getItem("currentSection"));
while(elements.length > 0){
elements[0].parentNode.removeChild(elements[0]);
}
const secElements = document.getElementsByClassName(sessionStorage.getItem("currentDoctype"));
while(secElements.length > 0){
secElements[0].parentNode.removeChild(secElements[0]);
}
let doctypes = schema[this.value];
let underscoredValue = this.value.replaceAll(" ","_");
sessionStorage.setItem("currentDoctype", underscoredValue);
const { valid, error } = validateSchema()
if(!valid){
div.textContent = error
div.style.color = '#ff3333'
}
for (let key in doctypes) {
let underscoredKey = key.replaceAll(" ", "_");
sessionStorage.setItem("currentSection", underscoredKey);
createSection('Section', div, doctypes, underscoredValue);
div = deconstruct(doctypes[key], div, underscoredKey)
const submit = document.createElement('input')
submit.classList.add("submitButtons");
submit.classList.add(underscoredKey);
submit.type = 'submit'
div.appendChild(submit)
break;
}
});
$(document.body).on("change","#Section",function(){
const elements = document.getElementsByClassName(sessionStorage.getItem("currentSection"));
while(elements.length > 0){
elements[0].parentNode.removeChild(elements[0]);
}
let underscoredKey = this.value.replaceAll(" ", "_");
sessionStorage.setItem("currentSection", underscoredKey);
div = deconstruct(schema[sessionStorage.getItem("currentDoctype").replaceAll("_", " ")][this.value], div, underscoredKey)
const submit = document.createElement('input')
submit.classList.add("submitButtons");
submit.classList.add(underscoredKey);
submit.type = 'submit'
div.appendChild(submit)
});
/* const { ACCOUNTING_DOCUMENTS } = schema
//getDocType = DOC_TYPE1 ;
......@@ -104,13 +172,13 @@ const displayFields = async (parentID) => {
const { HR_FILES } = schema
const { SECTION3 } = HR_FILES
div = deconstruct(SECTION3, div, 'SECTION3')*/
div = deconstruct(SECTION3, div, 'SECTION3')
const submit = document.createElement('input')
submit.classList.add("submitButtons");
submit.type = 'submit'
div.appendChild(submit)
div.appendChild(submit)*/
// add handler event handler for dropdown
// separate handler is used to fit with the library used 'select2'
......@@ -679,7 +747,7 @@ function saveForm(index){
});
index--;
var formArray = JSON.parse(sessionStorage.getItem('formArray'));
/* var formArray = JSON.parse(sessionStorage.getItem('formArray'));
//formArray.push(formValues);
if(typeof formArray[index] !== 'undefined') {
formArray.splice(index, 1, values)
......@@ -687,7 +755,7 @@ function saveForm(index){
formArray.splice(index, 0, values)
}
sessionStorage.setItem('formArray', JSON.stringify(formArray));
sessionStorage.setItem('formArray', JSON.stringify(formArray));*/
}
function populateForm(index){
......@@ -705,7 +773,45 @@ function populateForm(index){
document.getElementById(field).value = currForm[field];
}
}
}
async function populateFields(){
var data = [];
data.push(await getFieldData());
sessionStorage.setItem('formArray', JSON.stringify(data));
var formArray = JSON.parse(sessionStorage.getItem('formArray'));
var doctype = formArray[0].DocType;
var section = formArray[0].Section;
if (formArray[0] != null) {
var currForm = formArray[0];
for (let field in currForm) {
//document.getElementById(field).value = currForm[field];
if(field == "DocType"){
const mySelect = document.getElementById(field);
const selectedOption = mySelect.options[mySelect.selectedIndex];
selectedOption.value = doctype;
}
if(field == "Section"){
const mySelect = document.getElementById(field);
const selectedOption = mySelect.options[mySelect.selectedIndex];
selectedOption.value = section;
}
if(field == "fields"){
let fieldsobj = currForm[field];
for (let [k,v] of Object.entries(fieldsobj)) {
for(let key of Object.keys(schema[doctype][section])) {
if(schema[doctype][section][key].aka == "field"+k) {
var fieldId = schema[doctype][section][key].fieldLabel;
var currId = fieldId.replace(" ", "_")
document.getElementById(currId).value = v;
}
}
}
}
}
}
}
}
\ No newline at end of file
......@@ -3,7 +3,6 @@ const init = () => {
displayFields("fields");
accessFile();
window.onkeydown = (key) => {
if (!started_flag) {
if (searchStringInArray(`${key.key}`, keyArray) == true || key.ctrlKey && key.key) {
......
{
"ACCOUNTING_DOCUMENTS":
"ACCOUNTING DOCUMENTS":
{
"SECTION1":
{
......@@ -52,7 +52,7 @@
}
},
"BANK_APPLICATION_FORMS":
"BANK APPLICATION FORMS":
{
"SECTION2":
{
......@@ -94,7 +94,7 @@
}
},
"HR_FILES":
"HR FILES":
{
"SECTION3":
{
......
{
"ENVELOPE":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
},
"Sex":
{
"fieldLabel": "Sex",
"aka": "field5",
"validation":
{
"fieldLength": 6,
"collection": "alphabet",
"mandatory": true
}
},
"Birthdate":
{
"fieldLabel": "Birthdate",
"aka": "field6",
"validation":
{
"fieldLength": 10,
"collection": "datepicker",
"mandatory": true
}
},
"Civil_Status":
{
"fieldLabel": "Civil Status",
"aka": "field7",
"validation":
{
"fieldLength": 50,
"collection": "alphabet",
"mandatory": true
}
},
"Address":
{
"fieldLabel": "Address",
"aka": "field8",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@$%^*_+={}[]|\\:;\"<>?",
"mandatory": true
}
}
},
"EDUCATION":
{
"Name_of_Secondary_School":
{
"fieldLabel": "Name of Secondary School",
"aka": "field9",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@$%^*_+={}[]|\\:;\"<>?",
"mandatory": true
}
},
"Second_Year_Graduated":
{
"fieldLabel": "Second Year Graduated",
"aka": "field10",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@$%^*_+={}[]|\\:;\"<>?",
"mandatory": true
}
},
"Name_of_Pre-law_School":
{
"fieldLabel": "Name of Pre-law School",
"aka": "field11",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@$%^*_+={}[]|\\:;\"<>?",
"mandatory": true
}
},
"Pre-law_Year_Graduated":
{
"fieldLabel": "Pre-law Year Graduated",
"aka": "field12",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@$%^*_+={}[]|\\:;\"<>?",
"mandatory": true
}
},
"Name_of_Law_School":
{
"fieldLabel": "Name of Law School",
"aka": "field13",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@$%^*_+={}[]|\\:;\"<>?",
"mandatory": true
}
},
"Law_Proper_Year_Graduated":
{
"fieldLabel": "Law Proper Year Graduated",
"aka": "field14",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@$%^*_+={}[]|\\:;\"<>?",
"mandatory": true
}
}
},
"BAR EXAMINATION":
{
"Year_Passed_the_Bar":
{
"fieldLabel": "Year Passed the Bar",
"aka": "field15",
"validation":
{
"fieldLength": 4,
"collection": "numeric",
"mandatory": true
}
},
"Number_of_Bar_Exams_taken_(1-5)":
{
"fieldLabel": "Number of Bar Exams taken (1-5)",
"aka": "field16",
"validation":
{
"fieldLength": 1,
"collection": "numeric",
"mandatory": true
}
},
"Previous_Bar_Exam_Year_1":
{
"fieldLabel": "Previous Bar Exam Year 1",
"aka": "field17",
"validation":
{
"fieldLength": 4,
"collection": "numeric",
"mandatory": true
}
},
"Previous_Bar_Exam_Year_2":
{
"fieldLabel": "Previous Bar Exam Year 2",
"aka": "field18",
"validation":
{
"fieldLength": 4,
"collection": "numeric",
"mandatory": true
}
},
"Previous_Bar_Exam_Year_3":
{
"fieldLabel": "Previous Bar Exam Year 3",
"aka": "field19",
"validation":
{
"fieldLength": 4,
"collection": "numeric",
"mandatory": true
}
},
"Previous_Bar_Exam_Year_4":
{
"fieldLabel": "Previous Bar Exam Year 4",
"aka": "field20",
"validation":
{
"fieldLength": 4,
"collection": "numeric",
"mandatory": true
}
},
"Previous_Bar_Exam_Year_5":
{
"fieldLabel": "Previous Bar Exam Year 5",
"aka": "field21",
"validation":
{
"fieldLength": 4,
"collection": "numeric",
"mandatory": true
}
}
},
"ATTORNEY BASIC INFORMATION":
{
"Roll_No":
{
"fieldLabel": "Roll No",
"aka": "field22",
"validation":
{
"fieldLength": 50,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"'<>,.?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
"mandatory": true
}
},
"Date_Admitted":
{
"fieldLabel": "Date Admitted",
"aka": "field23",
"validation":
{
"fieldLength": 10,
"collection": "datepicker",
"mandatory": false
}
},
"Disbarred":
{
"fieldLabel": "Disbarred",
"aka": "field24",
"validation":
{
"fieldLength": 100,
"collection": "alphabet",
"mandatory": false
}
},
"Date_Disbarred":
{
"fieldLabel": "Date Disbarred",
"aka": "field25",
"validation":
{
"fieldLength": 10,
"collection": "datepicker",
"mandatory": false
}
},
"Expired":
{
"fieldLabel": "Expired",
"aka": "field26",
"validation":
{
"fieldLength": 100,
"collection": "alphabet",
"mandatory": false
}
},
"Date_Died":
{
"fieldLabel": "Date Died",
"aka": "field27",
"validation":
{
"fieldLength": 10,
"collection": "datepicker",
"mandatory": false
}
}
}
},
"OBC FORM":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
},
"CASES INVOLVING THE ATTORNEY AS PARTY LITIGANT OR AS COUNSEL":
{
"Cases_–_None_Pending":
{
"fieldLabel": "Cases – None Pending",
"aka": "field39",
"validation":
{
"fieldLength": 100,
"collection": "alphabet",
"mandatory": false
}
},
"Cases_–_Has_Pending":
{
"fieldLabel": "Cases – Has Pending",
"aka": "field40",
"validation":
{
"fieldLength": 100,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"COVER PAGE (PERSONAL RECORD)":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
},
"BAR EXAMINATION":
{
"Bar_Exam_Year":
{
"fieldLabel": "Bar Exam Year",
"aka": "field28",
"validation":
{
"fieldLength": 4,
"collection": "numeric",
"mandatory": true
}
}
}
},
"VERIFICATION SLIP (CHECKLIST)":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"VERIFIED PETITION":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
},
"BAR EXAMINATION":
{
"Bar_Exam_Year":
{
"fieldLabel": "Bar Exam Year",
"aka": "field28",
"validation":
{
"fieldLength": 4,
"collection": "numeric",
"mandatory": true
}
}
}
},
"PSA BIRTH CERTIFICATE":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"PSA MARRIAGE CERTIFICATE":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"TESTIMONIAL OF GOOD MORAL CHARACTER":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"TRANSCRIPT OF RECORD: PRE-LAW DEGREE":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"TRANSCRIPT OF RECORD: LAW DEGREE":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"LEB CERTIFICATION":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"C2 (CHED)":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"CERTIFICATION OF NO DEROGATORY RECORDS":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"LATEST PHOTOS WITH PRINTED NAME":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"CERTIFICATION: REFRESHER COURSE":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"CERTIFICATION: PRE-BAR REVIEW COURSE":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"CERTIFICATION THAT PROFESSORS ARE BONA-FIDE":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"CERTIFIED TRUE COPY OF COMPLAINT/INFORMATION":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"CERTIFICATE OF PENDENCY OF THE CASE":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"CERTIFICATE OF STATUS":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"CERTIFIED TRUE COPY OF DECISION/RESOLUTION":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"CERTIFICATE OF FINALITY OF DECISION":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"CLEARANCE FROM THE COURT/PROSECUTOR’S OFFICE/OMBUDSMAN":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"RECORD OF RATING":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
},
"BAR EXAMINATION":
{
"Bar_Exam_Year":
{
"fieldLabel": "Bar Exam Year",
"aka": "field28",
"validation":
{
"fieldLength": 4,
"collection": "numeric",
"mandatory": true
}
},
"B.E._No._(Bar Examination Number)":
{
"fieldLabel": "B.E. No. (Bar Examination Number)",
"aka": "field29",
"validation":
{
"fieldLength": 50,
"collection": "numeric",
"mandatory": true
}
},
"Average_Grade":
{
"fieldLabel": "Average Grade",
"aka": "field30",
"validation":
{
"fieldLength": 7,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()-_+={}[]|\\/:;\"'<>,?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
"mandatory": true
}
},
"Grade_–_Political_and_International_Law":
{
"fieldLabel": "Grade – Political and International Law",
"aka": "field31",
"validation":
{
"fieldLength": 7,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()-_+={}[]|\\/:;\"'<>,?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
"mandatory": true
}
},
"Grade_–_Labor_Law_and_Social_Legislation":
{
"fieldLabel": "Grade – Labor Law and Social Legislation",
"aka": "field32",
"validation":
{
"fieldLength": 7,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()-_+={}[]|\\/:;\"'<>,?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
"mandatory": true
}
},
"Grade_–_Civil_Law":
{
"fieldLabel": "Grade – Civil Law",
"aka": "field33",
"validation":
{
"fieldLength": 7,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()-_+={}[]|\\/:;\"'<>,?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
"mandatory": true
}
},
"Grade_–_Taxation":
{
"fieldLabel": "Grade – Taxation",
"aka": "field34",
"validation":
{
"fieldLength": 7,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()-_+={}[]|\\/:;\"'<>,?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
"mandatory": true
}
},
"Grade_–_Mercantile_Law":
{
"fieldLabel": "Grade – Mercantile Law",
"aka": "field35",
"validation":
{
"fieldLength": 7,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()-_+={}[]|\\/:;\"'<>,?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
"mandatory": true
}
},
"Grade_–_Criminal_Law":
{
"fieldLabel": "Grade – Criminal Law",
"aka": "field36",
"validation":
{
"fieldLength": 7,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()-_+={}[]|\\/:;\"'<>,?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
"mandatory": true
}
},
"Grade_–_Remedial_Law":
{
"fieldLabel": "Grade – Remedial Law",
"aka": "field37",
"validation":
{
"fieldLength": 7,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()-_+={}[]|\\/:;\"'<>,?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
"mandatory": true
}
},
"Grade_–_Legal_Ethics_and_Practical_Exercises":
{
"fieldLabel": "Grade – Legal Ethics and Practical Exercises",
"aka": "field38",
"validation":
{
"fieldLength": 7,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()-_+={}[]|\\/:;\"'<>,?ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
"mandatory": true
}
}
}
},
"NOTICE OF ADMISSION":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"UNDERTAKING":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"ACKNOWLEDGEMENT RECEIPT":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
},
"OTHERS":
{
"PERSONAL DATA":
{
"Last_Name":
{
"fieldLabel": "Last Name",
"aka": "field1",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"First_Name":
{
"fieldLabel": "First Name",
"aka": "field2",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": true
}
},
"Middle_Name":
{
"fieldLabel": "Middle Name",
"aka": "field3",
"validation":
{
"fieldLength": 100,
"collection": "alphanumeric",
"invalidchar": "~`!@#$%^&*()_+={}[]|\\/:;\"<>,.?0123456789",
"mandatory": false
}
},
"Suffix":
{
"fieldLabel": "Suffix",
"aka": "field4",
"validation":
{
"fieldLength": 3,
"collection": "alphabet",
"mandatory": false
}
}
}
}
}
\ No newline at end of file
......@@ -78,8 +78,8 @@ const submitForm = (e) => {
});
document.getElementById("counter").innerHTML = "";
clearTimeout(interval);
sessionStorage.removeItem("section");
sessionStorage.removeItem("doctype");
/* sessionStorage.removeItem("section");
sessionStorage.removeItem("doctype");*/
isCanvasNotCreated = true;
if(IS_RETRIEVE_FROM_GFS != "Y"){
......
......@@ -54,11 +54,13 @@ var span = document.getElementsByClassName("TiffModalClose")[0];
let Current_page = 0;
//XHR to Load Test TIFF Image
function loadDoc(url, cFunction,filename) {
Tiff.initialize({ TOTAL_MEMORY: 16777216 * 10 });
function loadDoc(url, cFunction, filename) {
Tiff.initialize({
TOTAL_MEMORY: 16777216 * 10
});
var xhr = new XMLHttpRequest();
xhr.responseType = 'arraybuffer';
xhr.onreadystatechange = function () {
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var startIndex = (xhr.responseURL.indexOf('\\') >= 0 ? xhr.responseURL.lastIndexOf('\\') : xhr.responseURL.lastIndexOf('/'));
var TiffViewerImageName = xhr.responseURL.substring(startIndex);
......@@ -85,21 +87,32 @@ function TIFFViewer(xhr, TiffViewerImageName) {
var buffer = xhr;
var TiffViewerImageName = TiffViewerImageName;
var flippedX = new Array(), flippedY = new Array(), rot = new Array(), checker = new Array();
var width = 0, height = 0; //changing variable for width and height
var origwidth = 0, origheight = 0, changedwidth = 0; changedheight = 0;
var setwidth = 0, setheight = 0; //constant variable for width and height
var editedwidth = 0, editedheight = 0; //checker of width and height change
var hpercent = 0, wpercent = 0; //set of percent increase or decrease per zoom
var hzoom = new Array(), wzoom = new Array(); //zoom data per page
var flippedX = new Array(),
flippedY = new Array(),
rot = new Array(),
checker = new Array();
var width = 0,
height = 0; //changing variable for width and height
var origwidth = 0,
origheight = 0,
changedwidth = 0;
changedheight = 0;
var setwidth = 0,
setheight = 0; //constant variable for width and height
var editedwidth = 0,
editedheight = 0; //checker of width and height change
var hpercent = 0,
wpercent = 0; //set of percent increase or decrease per zoom
var hzoom = new Array(),
wzoom = new Array(); //zoom data per page
let changed = false;
let TiffViewer_pages = 0; //page count
let TiffViewer_current = 1; // TiffViewer_current page number
sessionStorage.setItem("TiffViewer_current", "IMG" + TiffViewer_current);
if(localStorage.getItem("prev") == 1){
if (localStorage.getItem("prev") == 1) {
Current_page = Current_page - 1;
} else {
Current_page = Current_page + 1;
......@@ -279,14 +292,17 @@ function TIFFViewer(xhr, TiffViewerImageName) {
TiffViewer_btncont.append(TiffViewer_Fscrn, TiffViewer_Fit, TiffViewer_hflip, TiffViewer_vflip, TiffViewer_Rrotate, TiffViewer_Lrotate, TiffViewer_zoomIn, TiffViewer_zoomOut);
//get Content placeholders
const wrapper = document.querySelector("#TiffViewer_Screen"), header = wrapper.querySelector("#TiffViewer_ImageContainer");
const wrapper = document.querySelector("#TiffViewer_Screen"),
header = wrapper.querySelector("#TiffViewer_ImageContainer");
var TiffViewer_scrn = document.getElementById('TiffViewer_Screen');
var TiffViewer_file = document.getElementById("TiffViewerImageName");
TiffViewer_file.append(TiffViewerImageName); //Append Filename to div placeholder
TiffViewer_file.style.display = "block"; //Show Filename
var tiff = new Tiff({ buffer: buffer }); //get TIFF data via buffer
var tiff = new Tiff({
buffer: buffer
}); //get TIFF data via buffer
TiffViewer_pages = tiff.countDirectory(); //count TIFF image TiffViewer_pages
//if TIFF page is greater than one, display Previous and TiffViewer_NextButton buttons
......@@ -320,7 +336,7 @@ function TIFFViewer(xhr, TiffViewerImageName) {
//setting the style per page
for (var j = 1; j <= TiffViewer_pages; j++) {
var img = document.getElementById("IMG" + j);
getMeta(canvas, function (width, height) {
getMeta(canvas, function(width, height) {
wzoom[TiffViewer_current - 1] = changedwidth; /*ADDED: to fit large TIFF files*/
hzoom[TiffViewer_current - 1] = changedheight;
Edited();
......@@ -346,13 +362,13 @@ function TIFFViewer(xhr, TiffViewerImageName) {
} else if (setheight > 800 && setwidth <= 1000) {
img.style = "width: 800;";
changed = true;
} else{
} else {
img.style = `width: {setwidth}; height: {setheight}`;
changed = true;
}
if (changed) {
if(TiffViewer_pages > 1){
if (TiffViewer_pages > 1) {
hpercent = (parseInt(setheight, 10) * (10 / 100));
wpercent = (parseInt(setwidth, 10) * (10 / 100));
}
......@@ -384,7 +400,7 @@ function TIFFViewer(xhr, TiffViewerImageName) {
}
if(TiffViewer_pages > 1){
if (TiffViewer_pages > 1) {
for (var j = 1; j <= TiffViewer_pages; j++) {
var img = document.getElementById("IMG" + j).style.display = "none";
}
......@@ -395,22 +411,21 @@ function TIFFViewer(xhr, TiffViewerImageName) {
function getMeta(url, callback) {
var img = new Image();
img.src = url;
img.onload = function () { callback(this.width, this.height); }
img.onload = function() {
callback(this.width, this.height);
}
}
//display image in fullscreen
document.getElementById("TiffViewer_FullscreenButton").onclick = function () {
document.getElementById("TiffViewer_FullscreenButton").onclick = function() {
var image = document.getElementById(`IMG${TiffViewer_current}`);
if (image.requestFullscreen) {
image.requestFullscreen();
}
else if (image.msRequestFullscreen) {
} else if (image.msRequestFullscreen) {
imagej.msRequestFullscreen();
}
else if (divObj.mozRequestFullScreen) {
} else if (divObj.mozRequestFullScreen) {
image.mozRequestFullScreen();
}
else if (image.webkitRequestFullscreen) {
} else if (image.webkitRequestFullscreen) {
image.webkitRequestFullscreen();
} else {
console.log("Fullscreen API is not supported");
......@@ -431,8 +446,7 @@ function TIFFViewer(xhr, TiffViewerImageName) {
if (flippedX[TiffViewer_current - 1] == 1) {
flippedX[TiffViewer_current - 1] = -1;
Edited();
}
else {
} else {
flippedX[TiffViewer_current - 1] = 1;
Edited();
}
......@@ -452,8 +466,7 @@ function TIFFViewer(xhr, TiffViewerImageName) {
if (flippedY[TiffViewer_current - 1] == '1') {
flippedY[TiffViewer_current - 1] = -1;
Edited();
}
else {
} else {
flippedY[TiffViewer_current - 1] = 1;
Edited();
}
......@@ -468,6 +481,7 @@ function TIFFViewer(xhr, TiffViewerImageName) {
rotateClockwise();
}
})
function rotateClockwise() {
rot[TiffViewer_current - 1] += 90;
if ((rot[TiffViewer_current - 1] % 360) == 0) {
......@@ -506,6 +520,7 @@ function TIFFViewer(xhr, TiffViewerImageName) {
zoomIn();
}
})
function zoomIn() {
hzoom[TiffViewer_current - 1] += hpercent;
wzoom[TiffViewer_current - 1] += wpercent;
......@@ -543,6 +558,7 @@ function TIFFViewer(xhr, TiffViewerImageName) {
}
})
function previousPage() {
if (TiffViewer_pages > 1) {
if (TiffViewer_current != 1) {
......@@ -564,8 +580,10 @@ function TIFFViewer(xhr, TiffViewerImageName) {
if (e.key === "F12") {
e.preventDefault();
nextPage();
getImageField();
}
})
function nextPage() {
if (TiffViewer_pages > 1) {
if (TiffViewer_current != TiffViewer_pages) {
......@@ -576,7 +594,7 @@ function TIFFViewer(xhr, TiffViewerImageName) {
document.getElementById("TiffViewer_PageCount").innerHTML = "Page: " + TiffViewer_current + " / " + TiffViewer_pages;
Edited();
initHighlight();
}else{
} else {
alert("No more image to be fetched");
}
}
......@@ -663,12 +681,12 @@ function TIFFViewer(xhr, TiffViewerImageName) {
width: ${setwidth + wzoom[TiffViewer_current - 1]};
height: ${setheight + hzoom[TiffViewer_current - 1]};
border: 0px groove white;
-ms-transform: rotate(${rot[TiffViewer_current - 1]}deg) scaleX(${flippedX[TiffViewer_current - 1]}) scaleY(${flippedY[TiffViewer_current - 1]});`;// IE
-ms-transform: rotate(${rot[TiffViewer_current - 1]}deg) scaleX(${flippedX[TiffViewer_current - 1]}) scaleY(${flippedY[TiffViewer_current - 1]});`; // IE
image.style = `display: flex;
width: ${setwidth + wzoom[TiffViewer_current - 1]};
height: ${setheight + hzoom[TiffViewer_current - 1]};
border: 0px groove white;
-webkit-transform: rotate(${rot[TiffViewer_current - 1]}deg) scaleX(${flippedX[TiffViewer_current - 1]}) scaleY(${flippedY[TiffViewer_current - 1]});`;//Safari
-webkit-transform: rotate(${rot[TiffViewer_current - 1]}deg) scaleX(${flippedX[TiffViewer_current - 1]}) scaleY(${flippedY[TiffViewer_current - 1]});`; //Safari
TiffViewer_ImageContainer.style = `display: flex;
width: ${setwidth};
height: ${setheight};
......@@ -707,7 +725,7 @@ function TIFFViewer(xhr, TiffViewerImageName) {
}
);
function refreshDiv(){
function refreshDiv() {
document.getElementById("TiffViewer_ImageContainer").classList.remove("active");
......@@ -735,7 +753,7 @@ function TIFFViewer(xhr, TiffViewerImageName) {
wzoom[TiffViewer_current - 1] = changedwidth;
Edited();
if (File_Path.endsWith("pdf")){
if (File_Path.endsWith("pdf")) {
myState.zoom = 1.5;
queueRenderPage(TiffViewer_current);
}
......@@ -747,9 +765,9 @@ function TIFFViewer(xhr, TiffViewerImageName) {
if so, keyboard shortcut will not bind
otherwise, the function will work
*/
document.addEventListener("keydown", function (e) {
document.addEventListener("keydown", function(e) {
if (e.shiftKey && e.key == 'F') {
if(e.target.tagName == "INPUT"){
if (e.target.tagName == "INPUT") {
// REMOVE COMMENT ONLY WHEN SPECIFIC FIELDS ARE NEEDED
// for (const key in getSection) {
// const validation = getValidation(key);
......@@ -764,13 +782,14 @@ function TIFFViewer(xhr, TiffViewerImageName) {
// }
// }
return;
}else{
} else {
fitResize();
}
}});
}
});
//scrolling shortcuts
document.addEventListener('keydown', function (e) {
document.addEventListener('keydown', function(e) {
let div = document.getElementById('TiffModalBody');
if (e.ctrlKey && e.keyCode === 37) {
e.preventDefault();
......@@ -786,6 +805,5 @@ function TIFFViewer(xhr, TiffViewerImageName) {
div.scrollTop += 20;
}
});
initHighlight();
}
//initHighlight();
}
\ No newline at end of file
......@@ -66,7 +66,7 @@ const validateInput = (fieldID, value) => {
const getValidation = (fieldID) => {
// const { SECTION } = schema
let section = schema[sessionStorage.getItem("currentDoctype")][sessionStorage.getItem("currentSection")];
let section = schema[sessionStorage.getItem("currentDoctype").replaceAll("_"," ")][sessionStorage.getItem("currentSection").replaceAll("_"," ")];
try{
if (Object.keys(section).includes(fieldID)) return section[fieldID].validation;
......
const validateSchema = () => {
const validate = schema[sessionStorage.getItem("currentDoctype")]
const validate = schema[sessionStorage.getItem("currentDoctype").replaceAll("_"," ")]
if(!validate) return { valid: false, error: 'SECTION is missing!' }
return { valid: true }
......
......@@ -14,7 +14,7 @@ html {
}
#prompt{
background-color:white;
background-color: white;
height: 10%;
position: absolute;
display: block;
......@@ -23,6 +23,7 @@ html {
top: 47%;
left: 31%;
text-align: center;
padding: 30px;
}
/* The actual popup */
......@@ -919,6 +920,8 @@ input[type=text] {
select {
width: 100%;
height: 28px;
color: #444;
}
#fields *:not([type=submit]):focus {
......
......@@ -228,6 +228,19 @@ public class GDEWebServices {
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/get-fields")
public Response getFields(XMLContents xml) {
try {
return Response.ok(XMLUtil.getFields(xml)).build();
} catch (Exception e) {
return Response.status(500).entity("Fail").build();
}
}
@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/update-exception")
public Response updateException(XMLContents xml) {
......
......@@ -33,6 +33,7 @@ import com.svi.webgde.restservice.object.Field;
import com.svi.webgde.restservice.object.Header;
import com.svi.webgde.restservice.object.OutputXML;
import com.svi.webgde.restservice.object.Record;
import com.svi.webgde.restservice.object.SubRecord;
import com.svi.webgde.restservice.object.XMLContents;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
......@@ -282,4 +283,47 @@ public class XMLUtil {
}
public static Map<String, Object> getFields(XMLContents xml)
throws ParserConfigurationException, SAXException, IOException {
Map<String, Object> records = new HashMap<>();
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(xml.getOutputDir());
Map<String, Integer> imagenames = new HashMap<>();
for (int i = 0; i < document.getElementsByTagName("imagename").getLength(); i++) {
imagenames.put(document.getElementsByTagName("imagename").item(i).getTextContent(), i);
}
if (imagenames.containsKey(xml.getImageName())) {
Node imagename = document.getElementsByTagName("imagename").item(imagenames.get(xml.getImageName()));
Node xmlSubRecord = imagename.getParentNode().getLastChild().getPreviousSibling();
Map<String, String> fields = new HashMap<>();
records.put("DocType", imagename.getParentNode().getFirstChild().getNextSibling().getNextSibling()
.getNextSibling().getTextContent());
records.put("Section", imagename.getParentNode().getFirstChild().getNextSibling().getNextSibling()
.getNextSibling().getNextSibling().getNextSibling().getTextContent());
records.put("fields", fields);
for (int i = 0; i < xmlSubRecord.getChildNodes().getLength(); i++) {
if (xmlSubRecord.getChildNodes().item(i).getNodeType() == Node.ELEMENT_NODE) {
for (int j = 0; j < xmlSubRecord.getChildNodes().item(i).getChildNodes().getLength(); j++) {
if (xmlSubRecord.getChildNodes().item(i).getChildNodes().item(j)
.getNodeType() == Node.ELEMENT_NODE) {
fields.put(
xmlSubRecord.getChildNodes().item(i).getAttributes().getNamedItem("no")
.getNodeValue(),
xmlSubRecord.getChildNodes().item(i).getChildNodes().item(j).getTextContent());
records.put("fields", fields);
}
}
}
}
}
return records;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment