Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
web-ui
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WEBGDE-Components
web-ui
Commits
c36164ce
Commit
c36164ce
authored
Jul 07, 2023
by
rndeguzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add reloading page function
parent
7693bf30
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
108 deletions
+53
-108
getElement.js
WebGde/WebContent/WebGde-Widgets/BPO/getElement.js
+26
-50
generateFields.js
...bContent/WebGde-Widgets/DataInputWidget/generateFields.js
+5
-4
submit.js
WebGde/WebContent/WebGde-Widgets/Submit/submit.js
+10
-54
documentControlWidget.js
...de-Widgets/documentControlWidget/documentControlWidget.js
+0
-0
globalVariable.js
WebGde/WebContent/WebGde-Widgets/globalVariable.js
+12
-0
script.js
WebGde/WebContent/script.js
+0
-0
No files found.
WebGde/WebContent/WebGde-Widgets/BPO/getElement.js
View file @
c36164ce
import
{
ENCODING_PASS
}
from
"../config.js"
;
import
{
createModal
}
from
"../genericPopup/genericPopup.js"
;
import
{
getUrlGetReturnedElement
,
getUrlGetWaitingElement
,
getUrlGetWorkload
,
getUrlReturnElement
}
from
"./bpoService.js"
;
import
{
urlGetIfExisting
}
from
"./gfsService.js"
;
import
{
urlGet
Fields
,
urlGet
IfExisting
}
from
"./gfsService.js"
;
export
class
BPO
{
...
...
@@ -142,17 +142,31 @@ export class BPO {
}
}
}
// async function initGetElement() {
// }
//var folderLoc = `${element.fileLocation}` + "worker1" + "/" + "element1";
//getFolderLst(folderLoc);
// const response = await fetch()
async
getFieldData
(
filePath
)
{
let
elementId
=
sessionStorage
.
getItem
(
"element_id"
);
let
xmlData
=
{
"imageName"
:
filePath
,
"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
)
});
if
(
response
.
status
==
200
)
{
let
json
=
await
response
.
json
();
return
json
;
}
else
{
return
null
;
}
}
}
async
function
getFieldXml
(
element
)
{
...
...
@@ -173,11 +187,6 @@ function formatDirectory(dir) {
}
// async function
function getXmlLastImage(xmlString) {
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(xmlString, "
text
/
xml
");
...
...
@@ -201,45 +210,12 @@ function getXmlDocType(xmlString) {
const xmlDoc = parser.parseFromString(xmlString, "
text
/
xml
");
let lastRecordIndex = xmlDoc.getElementsByTagName("
record
").length - 1;
let lastRecord = xmlDoc.getElementsByTagName("
record
")[lastRecordIndex];
// let subRecord = lastRecord.getElementsByTagName("
sub
-
record
")[0].children;
// let doctype;
// for(let field of subRecord) {
// if(field.getAttribute("
no
") == 1) {
// doctype = field.childNodes[1].childNodes[0].nodeValue;
// }
// }
return lastRecord.getElementsByTagName("
doctype
")[0].childNodes[0].nodeValue;
// return doctype;
}
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)
});
if (response.status == 200) {
let json = await response.json();
return json;
} else {
return null;
}
}
async function createOutputXml(fields, metrics, doctype, section) {
let elementId = sessionStorage.getItem("
element_id
");
...
...
WebGde/WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
View file @
c36164ce
...
...
@@ -4,6 +4,7 @@ import { validateSchema } from "./validateSchema.js";
import
{
validateInput
,
getValidation
}
from
"./validateInput.js"
;
import
{
showError
}
from
"./showError.js"
;
import
{
submitForm
}
from
"../Submit/submit.js"
;
import
{
BPO_OBJECT
}
from
"../globalVariable.js"
;
let
newOption
;
export
let
schema
;
...
...
@@ -718,12 +719,12 @@ export function saveForm(index) {
// }
// }
async
function
populateFields
()
{
export
async
function
populateFields
()
{
await
fetchSchema
();
var
fields
=
{};
var
resp
=
[];
resp
.
push
(
await
getFieldData
());
resp
.
push
(
await
BPO_OBJECT
.
getFieldData
());
if
(
resp
.
length
==
0
||
resp
==
null
)
{
sessionStorage
.
setItem
(
'fields'
,
fields
);
displayFields
(
"fields"
);
...
...
@@ -744,7 +745,7 @@ async function populateFields() {
var
currForm
=
resp
[
0
];
/*
document.querySelector('#DocType').value = doctype;
document
.
querySelector
(
'#DocType'
).
value
=
doctype
;
sessionStorage
.
setItem
(
"doctype"
,
doctype
);
for
(
let
i
=
0
;
i
<
document
.
getElementById
(
"DocType"
).
options
.
length
;
i
++
)
{
if
(
document
.
getElementById
(
"DocType"
).
options
[
i
].
value
==
doctype
)
{
...
...
@@ -758,7 +759,7 @@ async function populateFields() {
if
(
document
.
getElementById
(
"Section"
).
options
[
i
].
value
==
section
)
{
document
.
getElementById
(
"Section"
).
options
[
i
].
selected
=
"selected"
}
}
*/
}
for
(
let
field
in
currForm
)
{
//document.getElementById(field).value = currForm[field];
...
...
WebGde/WebContent/WebGde-Widgets/Submit/submit.js
View file @
c36164ce
...
...
@@ -7,8 +7,6 @@ import { WriteForm } from "./XMLWriter/XML_Saver.js";
export
const
submitForm
=
async
(
e
)
=>
{
try
{
console
.
log
(
"submit"
);
setGlobalEndTime
(
new
Date
().
toLocaleString
());
let
eoe_ts
=
new
Date
().
toLocaleString
();
const
Form
=
document
.
getElementById
(
"fields"
);
...
...
@@ -69,66 +67,24 @@ export const submitForm = async (e) => {
dropdown
.
dispatchEvent
(
newEvent
)
}
if
(
error
)
{
if
(
errorMsg
!==
null
)
{
alert
(
errorMsg
);
}
else
{
alert
(
'Invalid or Missing data on highlighted fields!'
)
}
if
(
error
)
{
if
(
errorMsg
!==
null
)
{
alert
(
errorMsg
);
}
else
{
alert
(
'Invalid or Missing data on highlighted fields!'
)
}
return
false
}
}
else
{
// if(IS_RETRIEVE_FROM_GFS == "Y"){
// const container = document.querySelector('#containerModal' + sessionStorage.getItem('gfsCounter'));
// const label = container.querySelector("div.tiffViewerHeader .tiffViewerPageInfo label");
// File_Name = label.innerText;
// File_Path = label.innerText;
// }
const
metrics
=
stopMetricCapture
();
await
WriteForm
(
e
,
metrics
,
doctype
,
section
);
await
saveMetrics
(
metrics
,
eoe_ts
);
saveForm
(
sessionStorage
.
getItem
(
"display_counter"
));
// [...document.getElementsByClassName("TiffModalContent")].forEach(el => {
// while (el.children[1].hasChildNodes()) {
// el.children[1].removeChild(el.children[1].firstChild);
// }
// while (el.children[2].hasChildNodes()) {
// el.children[2].removeChild(el.children[2].firstChild);
// }
saveForm
(
sessionStorage
.
getItem
(
"display_counter"
));
// while (el.children[3].hasChildNodes()) {
// el.children[3].removeChild(el.children[3].firstChild);
// }
// });
// [...document.getElementsByClassName("bar")].forEach(el => {
// el.style.removeProperty('display');
// });
document
.
getElementById
(
"counter"
).
innerHTML
=
""
;
clearTimeout
(
interval
);
//isCanvasNotCreated = true;
// if(IS_RETRIEVE_FROM_GFS != "Y"){
// init();
// }else{
// var current = document.getElementById('containerModal' + sessionStorage.getItem('gfsCounter'));
// current.style.display = 'none';
// var next = document.getElementById('containerModal' + (parseInt(sessionStorage.getItem('gfsCounter')) + 1));
// if(next){
// next.style.display = 'block';
// }else{
// promptNoFilesLeft();
// //disableForm();
// }
// var counter = parseInt(sessionStorage.getItem('gfsCounter'));
// sessionStorage.setItem('gfsCounter', counter + 1);
// refresh();
// if(currentWindow){currentWindow.close();}
}
return
true
}
return
true
}
catch
(
err
)
{
console
.
log
(
err
)
return
false
...
...
WebGde/WebContent/WebGde-Widgets/documentControlWidget/documentControlWidget.js
View file @
c36164ce
This diff is collapsed.
Click to expand it.
WebGde/WebContent/WebGde-Widgets/globalVariable.js
View file @
c36164ce
...
...
@@ -3,9 +3,12 @@ export let IMAGE_VIEWER_OBJECT = null;
export
let
INDEXED_DB_STORAGE
=
null
;
export
let
BPO_OBJECT
=
null
;
export
let
IS_GDE_ACTIVATED
=
false
;
export
let
INDEXED_DB_NAME
=
"ImageDB"
;
export
let
INDEXED_DB_TBL_NAME
=
"images"
;
export
let
DISPLAY_FIELD_OBJECT
=
null
;
export
let
DOCUMENT_CONTROL_OBJECT
=
null
;
export
function
setIndexedDBStorage
(
DBOject
){
...
...
@@ -26,4 +29,12 @@ export function setBPOObject(BPO){
export
function
setDisplayFieldObject
(
displayField
){
DISPLAY_FIELD_OBJECT
=
displayField
;
}
export
function
setDocumentControlObject
(
object
){
DOCUMENT_CONTROL_OBJECT
=
object
;
}
export
function
activateGDE
(){
IS_GDE_ACTIVATED
=
true
;
}
\ No newline at end of file
WebGde/WebContent/script.js
View file @
c36164ce
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment