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
9096c908
Commit
9096c908
authored
Sep 03, 2024
by
Owen Ryan Ang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added formatting for date/time stamp. added deviceID to output
parent
a035e517
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
234 additions
and
35 deletions
+234
-35
returnElement.js
WebContent/NoBpo/WebGde-Widgets/BPO/returnElement.js
+1
-1
config.js
WebContent/NoBpo/WebGde-Widgets/DataInputWidget/config.js
+1
-1
generateFields.js
...nt/NoBpo/WebGde-Widgets/DataInputWidget/generateFields.js
+1
-1
submit.js
WebContent/NoBpo/WebGde-Widgets/DataInputWidget/submit.js
+2
-2
validateInput.js
...ent/NoBpo/WebGde-Widgets/DataInputWidget/validateInput.js
+0
-0
ElementListWidget.js
...Bpo/WebGde-Widgets/ElementListWidget/ElementListWidget.js
+1
-1
ElementListWidgetOld.js
.../WebGde-Widgets/ElementListWidget/ElementListWidgetOld.js
+1
-1
config.js
WebContent/NoBpo/WebGde-Widgets/Submit/config.js
+2
-1
submit.js
WebContent/NoBpo/WebGde-Widgets/Submit/submit.js
+1
-1
captureMetrics.js
...ent/NoBpo/WebGde-Widgets/captureMetrics/captureMetrics.js
+2
-2
config.js
WebContent/NoBpo/WebGde-Widgets/config.js
+2
-2
script.js
WebContent/NoBpo/script.js
+1
-1
config.ini
WebContent/WEB-INF/config/config.ini
+2
-2
rejectElement.js
WebContent/WebGde-Widgets/BPO/rejectElement.js
+15
-2
returnElement.js
WebContent/WebGde-Widgets/BPO/returnElement.js
+1
-1
config.js
WebContent/WebGde-Widgets/DataInputWidget/config.js
+1
-4
generateFields.js
WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
+7
-1
submit.js
WebContent/WebGde-Widgets/DataInputWidget/submit.js
+2
-2
validateInput.js
WebContent/WebGde-Widgets/DataInputWidget/validateInput.js
+0
-0
ElementListWidget.js
...ent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
+1
-1
ElementListWidgetOld.js
.../WebGde-Widgets/ElementListWidget/ElementListWidgetOld.js
+1
-1
submit.js
WebContent/WebGde-Widgets/Submit/submit.js
+1
-1
captureMetrics.js
WebContent/WebGde-Widgets/captureMetrics/captureMetrics.js
+2
-2
config.js
WebContent/WebGde-Widgets/config.js
+1
-1
REG-INP.json
WebContent/WebGde-Widgets/sample_schema/REG-INP.json
+2
-2
motoxps.json
WebContent/WebGde-Widgets/sample_schema/motoxps.json
+131
-0
script.js
WebContent/script.js
+1
-1
XMLUtil.java
src/main/java/com/svi/webgde/restservice/utils/XMLUtil.java
+51
-0
No files found.
WebContent/NoBpo/WebGde-Widgets/BPO/returnElement.js
View file @
9096c908
...
...
@@ -14,7 +14,7 @@ export async function returnElementBPO(elementId) {
// Get current timestamp
const
currentTimeStamp
=
Date
.
now
();
const
currentDate
=
new
Date
(
currentTimeStamp
);
const
humanReadableTime
=
currentDate
.
toLocaleString
();
const
humanReadableTime
=
currentDate
.
toLocaleString
(
'en-US'
);
// Save to session storage
sessionStorage
.
setItem
(
"timeEnd"
,
humanReadableTime
);
...
...
WebContent/NoBpo/WebGde-Widgets/DataInputWidget/config.js
View file @
9096c908
//Data Input Field Config
export
var
SCHEMA_FILE_PATH
=
"./WebGde-Widgets/sample_schema/
REG-INP
.json"
;
export
var
SCHEMA_FILE_PATH
=
"./WebGde-Widgets/sample_schema/
OTS
.json"
;
// export var SCHEMA_FILE_PATH = "./WebGde-Widgets/sample_schema/dev_schema.json";
export
var
IGNORE_CHAR_LIMIT
=
true
;
//DBLookup Webservice URL
...
...
WebContent/NoBpo/WebGde-Widgets/DataInputWidget/generateFields.js
View file @
9096c908
...
...
@@ -2614,7 +2614,7 @@ export async function clearForm() {
// Get current timestamp
const
currentTimeStamp
=
Date
.
now
();
const
currentDate
=
new
Date
(
currentTimeStamp
);
const
humanReadableTime
=
currentDate
.
toLocaleString
();
const
humanReadableTime
=
currentDate
.
toLocaleString
(
'en-US'
);
// Save to session storage
sessionStorage
.
setItem
(
"timeStart"
,
humanReadableTime
);
...
...
WebContent/NoBpo/WebGde-Widgets/DataInputWidget/submit.js
View file @
9096c908
...
...
@@ -3,8 +3,8 @@ import { createInfoModal } from "../genericPopup/genericPopup";
// export const submitForm = (e) => {
try
{
console
.
log
(
"submit"
);
global_end_time
=
new
Date
().
toLocaleString
();
let
eoe_ts
=
new
Date
().
toLocaleString
();
global_end_time
=
new
Date
().
toLocaleString
(
'en-US'
);
let
eoe_ts
=
new
Date
().
toLocaleString
(
'en-US'
);
const
Form
=
Settings
.
SrcElement
(
e
);
const
{
elements
}
=
Form
let
error
=
false
...
...
WebContent/NoBpo/WebGde-Widgets/DataInputWidget/validateInput.js
View file @
9096c908
WebContent/NoBpo/WebGde-Widgets/ElementListWidget/ElementListWidget.js
View file @
9096c908
...
...
@@ -366,7 +366,7 @@ export class ElementListWidget {
// Get current timestamp
const
currentTimeStamp
=
Date
.
now
();
const
currentDate
=
new
Date
(
currentTimeStamp
);
const
humanReadableTime
=
currentDate
.
toLocaleString
();
const
humanReadableTime
=
currentDate
.
toLocaleString
(
'en-US'
);
// Save to session storage
sessionStorage
.
setItem
(
"timeStart"
,
humanReadableTime
);
...
...
WebContent/NoBpo/WebGde-Widgets/ElementListWidget/ElementListWidgetOld.js
View file @
9096c908
...
...
@@ -458,7 +458,7 @@ export class ElementListWidget {
// Get current timestamp
const
currentTimeStamp
=
Date
.
now
();
const
currentDate
=
new
Date
(
currentTimeStamp
);
const
humanReadableTime
=
currentDate
.
toLocaleString
();
const
humanReadableTime
=
currentDate
.
toLocaleString
(
'en-US'
);
// Save to session storage
sessionStorage
.
setItem
(
"timeStart"
,
humanReadableTime
);
...
...
WebContent/NoBpo/WebGde-Widgets/Submit/config.js
View file @
9096c908
...
...
@@ -2,5 +2,5 @@ export const PROJECT_CODE = "DSQC";
export
const
ENCODING_PASS
=
"PASS1"
;
export
const
GFS_URL
=
"http://107.20.193.188/gfs-explorer-ws/svc/gfs-rest/"
;
export
const
TEMPORARY_FOLDER
=
"
C:/Users/oang/Desktop/Mobile GDE/Elements
"
;
export
const
TEMPORARY_FOLDER
=
"
/home/OTS_ELEMENTS
"
;
export
const
GFS_ROOT_FOLDER
=
"/Users"
;
\ No newline at end of file
WebContent/NoBpo/WebGde-Widgets/Submit/submit.js
View file @
9096c908
...
...
@@ -18,7 +18,7 @@ export const submitForm = async () => {
// Get current timestamp
const
currentTimeStamp
=
Date
.
now
();
const
currentDate
=
new
Date
(
currentTimeStamp
);
const
humanReadableTime
=
currentDate
.
toLocaleString
();
const
humanReadableTime
=
currentDate
.
toLocaleString
(
'en-US'
);
// Save to session storage
sessionStorage
.
setItem
(
"timeEnd"
,
humanReadableTime
);
...
...
WebContent/NoBpo/WebGde-Widgets/captureMetrics/captureMetrics.js
View file @
9096c908
...
...
@@ -34,7 +34,7 @@ export const startMetricCapture = () => {
key_strokes
=
0
time_start
=
Date
.
now
()
if
(
global_start_time
==
0
)
{
global_start_time
=
new
Date
().
toLocaleString
();
global_start_time
=
new
Date
().
toLocaleString
(
'en-US'
);
}
time_pause_spent
=
0
...
...
@@ -328,7 +328,7 @@ const startMetricCapture = () => {
key_strokes
=
0
time_start
=
Date
.
now
()
if
(
global_start_time
==
0
)
{
global_start_time
=
new
Date
().
toLocaleString
();
global_start_time
=
new
Date
().
toLocaleString
(
'en-US'
);
}
time_pause_spent
=
0
...
...
WebContent/NoBpo/WebGde-Widgets/config.js
View file @
9096c908
...
...
@@ -23,14 +23,14 @@ export const INVALID_KEYS = "F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,PrintScreen,
export
const
OUTPUT_FILE_EXTENSION
=
".DTA"
//BPO CONFIG
export
const
IS_RETRIEVE_FROM_BPO
=
"
Y
"
export
const
IS_RETRIEVE_FROM_BPO
=
"
N
"
export
let
BPO_URL
=
DOMAIN
+
"bpo/"
;
export
let
CURRENT_NODE
=
""
export
const
ENCODING_PASS
=
"PASS1"
export
const
PROD_OUTPUT_UNIT
=
"INSPECTION"
export
const
NEXT_NODE
=
"INSPECTED"
export
const
EXCEPTION_NODE
=
"CANCELLED"
export
const
SHOW_ELEMENT_LIST_VIEWER
=
"
Y
"
export
const
SHOW_ELEMENT_LIST_VIEWER
=
"
N
"
export
const
ADD_NEW_OPTION
=
"N"
export
const
DISPLAYED_DETAILS
=
"inspectionType|businessAddress"
//pipe-delimited
export
const
USERID_FIELD
=
"inspectorUsername"
...
...
WebContent/NoBpo/script.js
View file @
9096c908
...
...
@@ -43,7 +43,7 @@ async function initializeWebGDE() {
// Get current timestamp
const
currentTimeStamp
=
Date
.
now
();
const
currentDate
=
new
Date
(
currentTimeStamp
);
const
humanReadableTime
=
currentDate
.
toLocaleString
();
const
humanReadableTime
=
currentDate
.
toLocaleString
(
'en-US'
);
// Save to session storage
sessionStorage
.
setItem
(
"timeStart"
,
humanReadableTime
);
...
...
WebContent/WEB-INF/config/config.ini
View file @
9096c908
...
...
@@ -25,4 +25,4 @@ PASSWORD=p455w0rd
[SSO CONFIG]
PUBKEY
=
C:/Users/oang/git/web-ui-mobile2/WebContent/WEB-INF/config/sso/pubkey.pem
\ No newline at end of file
PUBKEY
=
/home/payara5/Control Folder Live/SSO-QC/key/pub.pem
\ No newline at end of file
WebContent/WebGde-Widgets/BPO/rejectElement.js
View file @
9096c908
import
{
resetGDE
}
from
"../../script.js"
;
import
{
submitElementToSqLite
}
from
"../DataInputWidget/AndroidInterface/androidInterface.js"
;
import
{
getDeviceId
,
submitElementToSqLite
}
from
"../DataInputWidget/AndroidInterface/androidInterface.js"
;
import
{
SCHEMA_FILE_PATH
}
from
"../DataInputWidget/config.js"
;
import
{
validateInput
}
from
"../DataInputWidget/validateInput.js"
;
import
{
goBackToElementListViewer
}
from
"../ElementListWidget/ElementListWidget.js"
;
...
...
@@ -312,6 +312,19 @@ function saveExceptionToXml(){
}
}
var
Frm
=
document
.
getElementById
(
"fields"
);
var
Nodes
=
Frm
.
elements
;
let
fields
=
{};
for
(
var
i
=
0
;
i
<
Nodes
.
length
;
i
++
)
{
var
element
=
Nodes
[
i
];
if
(
element
.
classList
.
contains
(
'deviceid'
)){
let
fid
=
Nodes
[
i
].
id
;
let
key
=
Object
.
keys
(
lookup
[
fid
]).
includes
(
'aka'
)
?
lookup
[
fid
].
aka
.
replace
(
"field"
,
""
)
:
fid
;
fields
[
key
]
=
Nodes
[
i
].
value
;
}
}
let
xmlData
=
{
"projCode"
:
PROJECT_CODE
,
"userId"
:
sessionStorage
.
getItem
(
"user_id"
),
...
...
@@ -330,7 +343,7 @@ function saveExceptionToXml(){
"imageName"
:
""
,
"subRecordNo"
:
"1"
,
"eor"
:
"N"
,
"fields"
:
{}
,
"fields"
:
fields
,
"outputDir"
:
sessionStorage
.
getItem
(
"element_file_loc"
)
+
"/"
+
(
ENCODING_PASS
==
"PASS1"
?
elementId
+
".DTA"
:
elementId
+
".DTB"
),
"doctype"
:
doctype
,
"section"
:
section
...
...
WebContent/WebGde-Widgets/BPO/returnElement.js
View file @
9096c908
...
...
@@ -14,7 +14,7 @@ export async function returnElementBPO(elementId) {
// Get current timestamp
const
currentTimeStamp
=
Date
.
now
();
const
currentDate
=
new
Date
(
currentTimeStamp
);
const
humanReadableTime
=
currentDate
.
toLocaleString
();
const
humanReadableTime
=
currentDate
.
toLocaleString
(
'en-US'
);
// Save to session storage
sessionStorage
.
setItem
(
"timeEnd"
,
humanReadableTime
);
...
...
WebContent/WebGde-Widgets/DataInputWidget/config.js
View file @
9096c908
//Data Input Field Config
export
var
SCHEMA_FILE_PATH
=
"./WebGde-Widgets/sample_schema/REG-INP.json"
;
export
var
FETCH_FROM_DB
=
true
;
// export var SCHEMA_FILE_PATH = "./WebGde-Widgets/sample_schema/dev_schema.json"
;
export
var
IGNORE_CHAR_LIMIT
=
true
;
//DBLookup Webservice URL
export
var
DB_URL
=
"http://localhost:8080/WebGde/svc/gfs-rest/db-lookup"
\ No newline at end of file
WebContent/WebGde-Widgets/DataInputWidget/generateFields.js
View file @
9096c908
...
...
@@ -2466,6 +2466,12 @@ export async function populateFields(inputFieldData) {
console
.
log
(
"key = "
+
key
+
", value ="
+
v
);
//console.log("validation: " + schema[doctype][section][key].validation.collection);
if
(
v
===
"null"
)
{
v
=
""
;
}
else
if
(
v
==
null
&&
schema
[
doctype
][
section
][
key
].
validation
.
collection
===
'numeric'
)
{
v
=
0
;
}
fields
[
"field"
+
k
]
=
v
;
if
(
schema
[
doctype
][
section
][
key
].
hidden
)
{
...
...
@@ -2614,7 +2620,7 @@ export async function clearForm() {
// Get current timestamp
const
currentTimeStamp
=
Date
.
now
();
const
currentDate
=
new
Date
(
currentTimeStamp
);
const
humanReadableTime
=
currentDate
.
toLocaleString
();
const
humanReadableTime
=
currentDate
.
toLocaleString
(
'en-US'
);
// Save to session storage
sessionStorage
.
setItem
(
"timeStart"
,
humanReadableTime
);
...
...
WebContent/WebGde-Widgets/DataInputWidget/submit.js
View file @
9096c908
...
...
@@ -3,8 +3,8 @@ import { createInfoModal } from "../genericPopup/genericPopup";
// export const submitForm = (e) => {
try
{
console
.
log
(
"submit"
);
global_end_time
=
new
Date
().
toLocaleString
();
let
eoe_ts
=
new
Date
().
toLocaleString
();
global_end_time
=
new
Date
().
toLocaleString
(
'en-US'
);
let
eoe_ts
=
new
Date
().
toLocaleString
(
'en-US'
);
const
Form
=
Settings
.
SrcElement
(
e
);
const
{
elements
}
=
Form
let
error
=
false
...
...
WebContent/WebGde-Widgets/DataInputWidget/validateInput.js
View file @
9096c908
WebContent/WebGde-Widgets/ElementListWidget/ElementListWidget.js
View file @
9096c908
...
...
@@ -366,7 +366,7 @@ export class ElementListWidget {
// Get current timestamp
const
currentTimeStamp
=
Date
.
now
();
const
currentDate
=
new
Date
(
currentTimeStamp
);
const
humanReadableTime
=
currentDate
.
toLocaleString
();
const
humanReadableTime
=
currentDate
.
toLocaleString
(
'en-US'
);
// Save to session storage
sessionStorage
.
setItem
(
"timeStart"
,
humanReadableTime
);
...
...
WebContent/WebGde-Widgets/ElementListWidget/ElementListWidgetOld.js
View file @
9096c908
...
...
@@ -458,7 +458,7 @@ export class ElementListWidget {
// Get current timestamp
const
currentTimeStamp
=
Date
.
now
();
const
currentDate
=
new
Date
(
currentTimeStamp
);
const
humanReadableTime
=
currentDate
.
toLocaleString
();
const
humanReadableTime
=
currentDate
.
toLocaleString
(
'en-US'
);
// Save to session storage
sessionStorage
.
setItem
(
"timeStart"
,
humanReadableTime
);
...
...
WebContent/WebGde-Widgets/Submit/submit.js
View file @
9096c908
...
...
@@ -18,7 +18,7 @@ export const submitForm = async () => {
// Get current timestamp
const
currentTimeStamp
=
Date
.
now
();
const
currentDate
=
new
Date
(
currentTimeStamp
);
const
humanReadableTime
=
currentDate
.
toLocaleString
();
const
humanReadableTime
=
currentDate
.
toLocaleString
(
'en-US'
);
// Save to session storage
sessionStorage
.
setItem
(
"timeEnd"
,
humanReadableTime
);
...
...
WebContent/WebGde-Widgets/captureMetrics/captureMetrics.js
View file @
9096c908
...
...
@@ -34,7 +34,7 @@ export const startMetricCapture = () => {
key_strokes
=
0
time_start
=
Date
.
now
()
if
(
global_start_time
==
0
)
{
global_start_time
=
new
Date
().
toLocaleString
();
global_start_time
=
new
Date
().
toLocaleString
(
'en-US'
);
}
time_pause_spent
=
0
...
...
@@ -328,7 +328,7 @@ const startMetricCapture = () => {
key_strokes
=
0
time_start
=
Date
.
now
()
if
(
global_start_time
==
0
)
{
global_start_time
=
new
Date
().
toLocaleString
();
global_start_time
=
new
Date
().
toLocaleString
(
'en-US'
);
}
time_pause_spent
=
0
...
...
WebContent/WebGde-Widgets/config.js
View file @
9096c908
...
...
@@ -27,7 +27,7 @@ export const IS_RETRIEVE_FROM_BPO = "Y"
export
let
BPO_URL
=
DOMAIN
+
"bpo/"
;
export
let
CURRENT_NODE
=
""
export
const
ENCODING_PASS
=
"PASS1"
export
const
PROD_OUTPUT_UNIT
=
"
INSPECTION
"
export
const
PROD_OUTPUT_UNIT
=
"
DOC
"
export
const
NEXT_NODE
=
"INSPECTED"
export
const
EXCEPTION_NODE
=
"CANCELLED"
export
const
SHOW_ELEMENT_LIST_VIEWER
=
"Y"
...
...
WebContent/WebGde-Widgets/sample_schema/REG-INP.json
View file @
9096c908
...
...
@@ -65,8 +65,8 @@
"fieldLabel"
:
"Business Permit No."
,
"aka"
:
"field7"
,
"validation"
:
{
"fieldLength"
:
1
0.0
,
"collection"
:
"numeric"
,
"fieldLength"
:
3
0.0
,
"collection"
:
"
alpha
numeric"
,
"mandatory"
:
true
},
"readOnly"
:
true
...
...
WebContent/WebGde-Widgets/sample_schema/motoxps.json
0 → 100644
View file @
9096c908
{
"_attributes"
:
{
"readOnly"
:
false
,
"docTypeHidden"
:
true
,
"sectionHidden"
:
true
},
"DOCUMENT"
:
{
"Section"
:
{
"del_receipt1"
:
{
"fieldLabel"
:
"Delivery Receipt Page 1"
,
"aka"
:
"field2"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"image-capture"
,
"validDate"
:
""
,
"mandatory"
:
false
}
},
"del_receipt2"
:
{
"fieldLabel"
:
"Delivery Receipt Page 2"
,
"aka"
:
"field3"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"image-capture"
,
"validDate"
:
""
,
"mandatory"
:
false
}
},
"del_receipt3"
:
{
"fieldLabel"
:
"Delivery Receipt Page 3"
,
"aka"
:
"field4"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"image-capture"
,
"validDate"
:
""
,
"mandatory"
:
false
}
},
"buyer_info"
:
{
"fieldLabel"
:
"Buyer Information Sheet"
,
"aka"
:
"field5"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"image-capture"
,
"validDate"
:
""
,
"mandatory"
:
false
}
},
"ltms1"
:
{
"fieldLabel"
:
"LTMS Page 1"
,
"aka"
:
"field6"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"file-upload"
,
"validDate"
:
""
,
"mandatory"
:
false
}
},
"ltms2"
:
{
"fieldLabel"
:
"LTMS Page 2"
,
"aka"
:
"field7"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"file-upload"
,
"validDate"
:
""
,
"mandatory"
:
false
}
},
"sales_invoice"
:
{
"fieldLabel"
:
"Sales Invoice"
,
"aka"
:
"field8"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"image-capture"
,
"validDate"
:
""
,
"mandatory"
:
false
}
},
"ctpl"
:
{
"fieldLabel"
:
"CTPL"
,
"aka"
:
"field9"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"image-capture"
,
"validDate"
:
""
,
"mandatory"
:
false
}
},
"affidavit"
:
{
"fieldLabel"
:
"Affidavit of Sidecar Attachment"
,
"aka"
:
"field10"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"image-capture"
,
"validDate"
:
""
,
"mandatory"
:
false
}
},
"loan_form1"
:
{
"fieldLabel"
:
"Loan Application Form Page 1"
,
"aka"
:
"field11"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"image-capture"
,
"validDate"
:
""
,
"mandatory"
:
false
}
},
"loan_form2"
:
{
"fieldLabel"
:
"Loan Application Form Page 2"
,
"aka"
:
"field12"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"image-capture"
,
"validDate"
:
""
,
"mandatory"
:
false
}
},
"loan_form3"
:
{
"fieldLabel"
:
"Loan Application Form Page 3"
,
"aka"
:
"field13"
,
"validation"
:
{
"fieldLength"
:
1.0
,
"collection"
:
"image-capture"
,
"validDate"
:
""
,
"mandatory"
:
false
}
}
}
}
}
WebContent/script.js
View file @
9096c908
...
...
@@ -43,7 +43,7 @@ async function initializeWebGDE() {
// Get current timestamp
const
currentTimeStamp
=
Date
.
now
();
const
currentDate
=
new
Date
(
currentTimeStamp
);
const
humanReadableTime
=
currentDate
.
toLocaleString
();
const
humanReadableTime
=
currentDate
.
toLocaleString
(
'en-US'
);
// Save to session storage
sessionStorage
.
setItem
(
"timeStart"
,
humanReadableTime
);
...
...
src/main/java/com/svi/webgde/restservice/utils/XMLUtil.java
View file @
9096c908
...
...
@@ -294,6 +294,57 @@ public class XMLUtil {
Document
document
=
builder
.
parse
(
xml
.
getOutputDir
());
document
.
getElementsByTagName
(
"exception_remark"
).
item
(
0
).
setTextContent
(
xml
.
getExceptionRemark
());
document
.
getElementsByTagName
(
"userid"
).
item
(
0
).
setTextContent
(
xml
.
getUserId
());
// Get the fields map from the XMLContents object
Map
<
String
,
String
>
fields
=
xml
.
getFields
();
// Get the list of field elements
NodeList
fieldNodes
=
document
.
getElementsByTagName
(
"field"
);
// Track which field numbers already exist in the XML
Map
<
String
,
Element
>
existingFields
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
fieldNodes
.
getLength
();
i
++)
{
Element
fieldElement
=
(
Element
)
fieldNodes
.
item
(
i
);
String
fieldNumber
=
fieldElement
.
getAttribute
(
"no"
);
existingFields
.
put
(
fieldNumber
,
fieldElement
);
}
// Get the parent node where new fields should be appended (e.g., sub-record)
Node
subRecordNode
=
document
.
getElementsByTagName
(
"sub-record"
).
item
(
0
);
// Iterate through the fields map
for
(
Map
.
Entry
<
String
,
String
>
entry
:
fields
.
entrySet
())
{
String
fieldNumber
=
entry
.
getKey
();
String
fieldValue
=
entry
.
getValue
();
// Check if the field already exists
if
(
existingFields
.
containsKey
(
fieldNumber
))
{
// Field exists, update the value
Element
fieldElement
=
existingFields
.
get
(
fieldNumber
);
NodeList
valueNodes
=
fieldElement
.
getElementsByTagName
(
"value"
);
if
(
valueNodes
.
getLength
()
>
0
)
{
valueNodes
.
item
(
0
).
setTextContent
(
fieldValue
);
}
else
{
// If <value> element doesn't exist, create it
Element
valueElement
=
document
.
createElement
(
"value"
);
valueElement
.
setTextContent
(
fieldValue
);
fieldElement
.
appendChild
(
valueElement
);
}
}
else
{
// Field doesn't exist, create and append it
Element
newFieldElement
=
document
.
createElement
(
"field"
);
newFieldElement
.
setAttribute
(
"no"
,
fieldNumber
);
Element
valueElement
=
document
.
createElement
(
"value"
);
valueElement
.
setTextContent
(
fieldValue
);
newFieldElement
.
appendChild
(
valueElement
);
// Append the new field to the sub-record node
subRecordNode
.
appendChild
(
newFieldElement
);
}
}
TransformerFactory
transformerFactory
=
TransformerFactory
.
newInstance
();
Transformer
transformer
=
transformerFactory
.
newTransformer
();
...
...
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