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
e7d704ba
Commit
e7d704ba
authored
Jan 17, 2023
by
Jorem Magcawas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update reject return element
parent
d2c4fdf5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
172 additions
and
42 deletions
+172
-42
dir.php
WebGde/WebContent/dir.php
+0
-13
index.html
WebGde/WebContent/index.html
+0
-3
getElement.js
WebGde/WebContent/src/BPO/getElement.js
+1
-1
rejectElement.js
WebGde/WebContent/src/BPO/rejectElement.js
+123
-25
GDEWebServices.java
...a/com/svi/webgde/restservice/services/GDEWebServices.java
+23
-0
XMLUtil.java
...c/main/java/com/svi/webgde/restservice/utils/XMLUtil.java
+25
-0
No files found.
WebGde/WebContent/dir.php
deleted
100644 → 0
View file @
d2c4fdf5
var Dirfiles =
<?php
$arrFiles
=
array
();
$path
=
'./input'
;
$iterator
=
new
FilesystemIterator
(
$path
);
foreach
(
$iterator
as
$entry
)
{
$arrFiles
[]
=
'./input/'
.
$entry
->
getFilename
();
// $iter = new FilesystemIterator($entry);
// foreach($iter as $ent) {
// $arrFiles[] = './input/' . $entry-> getFilename() . '/' . $ent-> getFilename();
// }
}
echo
json_encode
(
$arrFiles
);
?>
\ No newline at end of file
WebGde/WebContent/index.html
View file @
e7d704ba
...
...
@@ -209,9 +209,6 @@
</body>
<!--body onload-->
<script
src=
'dir.php'
></script>
<script
src=
"./src/BPO/bpoService.js"
></script>
<script
src=
"./src/BPO/getElement.js"
></script>
<script
src=
"./src/BPO/returnElement.js"
></script>
...
...
WebGde/WebContent/src/BPO/getElement.js
View file @
e7d704ba
...
...
@@ -170,7 +170,7 @@ async function createOutputXml(fields, metrics, doctype, section) {
"
projCode
": PROJECT_CODE,
"
userId
": sessionStorage.getItem("
user_id
"),
"
elementId
": elementId,
"
schema
":
"
_SCHEMA
"
,
"
schema
":
SCHEMA_FILE
,
"
totalRec
": Dirfiles.length,
"
maxRec
": "
1
",
"
totalKeystroke
": metrics[0],
...
...
WebGde/WebContent/src/BPO/rejectElement.js
View file @
e7d704ba
...
...
@@ -23,22 +23,19 @@ createRejectWindow(); //window for reason rejecting element
var
rejectButton
=
document
.
getElementById
(
'reject'
);
rejectButton
.
onclick
=
function
()
{
//
let screenMain = document.getElementById('parent_Window');
//
screenMain.style.display = 'block';
// rejectButton.disabled = true;
rejectElement
();
const
fieldForm
=
document
.
getElementById
(
"fields"
);
fieldForm
.
querySelector
(
'input[type="submit"]'
).
click
();
let
screenMain
=
document
.
getElementById
(
'parent_Window'
);
screenMain
.
style
.
display
=
'block'
;
rejectButton
.
disabled
=
true
;
//
rejectElement();
//
const fieldForm = document.getElementById("fields");
//
fieldForm.querySelector('input[type="submit"]').click();
};
window
.
addEventListener
(
'keydown'
,
function
(
e
)
{
if
(
e
.
ctrlKey
==
true
&&
e
.
keyCode
==
69
){
// let screenMain = document.getElementById('parent_Window');
// screenMain.style.display = 'block';
// rejectButton.disabled = true;
rejectElement
();
const
fieldForm
=
document
.
getElementById
(
"fields"
);
fieldForm
.
querySelector
(
'input[type="submit"]'
).
click
();
let
screenMain
=
document
.
getElementById
(
'parent_Window'
);
screenMain
.
style
.
display
=
'block'
;
rejectButton
.
disabled
=
true
;
}
});
...
...
@@ -47,28 +44,42 @@ function createRejectWindow(){
let
screenMain
=
document
.
createElement
(
'div'
);
screenMain
.
id
=
'parent_Window'
;
screenMain
.
style
.
display
=
'none'
;
document
.
body
.
appendChild
(
screenMain
);
document
.
body
.
appendChild
(
screenMain
);
//checkbox&label
screenMain
.
appendChild
(
checkLabelComponent
(
'Reason 1'
,
'check1'
));
screenMain
.
appendChild
(
checkLabelComponent
(
'Reason 2'
,
'check2'
));
screenMain
.
appendChild
(
checkLabelComponent
(
'Reason 3'
,
'check3'
));
screenMain
.
appendChild
(
checkLabelComponent
(
'Reason 4'
,
'check4'
));
screenMain
.
appendChild
(
checkLabelComponent
(
'Others'
,
'check5'
));
screenMain
.
appendChild
(
checkLabelComponent
(
'Reason 1'
,
'
Reason 1'
,
'
check1'
));
screenMain
.
appendChild
(
checkLabelComponent
(
'Reason 2'
,
'
Reason 1'
,
'
check2'
));
screenMain
.
appendChild
(
checkLabelComponent
(
'Reason 3'
,
'
Reason 1'
,
'
check3'
));
screenMain
.
appendChild
(
checkLabelComponent
(
'Reason 4'
,
'
Reason 1'
,
'
check4'
));
screenMain
.
appendChild
(
checkLabelComponent
(
'Others'
,
'
'
,
'
check5'
));
screenMain
.
appendChild
(
createMessageBox
(
'text-area'
));
screenMain
.
appendChild
(
okCancelButton
());
//set radio button text area value
let
radioMessage
=
document
.
getElementById
(
'check5'
);
let
text
=
document
.
getElementById
(
'text-area'
);
radioMessage
.
value
=
text
.
value
;
}
function
checkLabelComponent
(
textLabel
,
checkboxId
){
function
checkLabelComponent
(
textLabel
,
inputval
,
checkboxId
){
let
checkBoxCont
=
document
.
createElement
(
'div'
);
checkBoxCont
.
id
=
'checkBoxCont'
;
let
inp
=
document
.
createElement
(
"input"
);
inp
.
id
=
checkboxId
;
inp
.
setAttribute
(
'type'
,
'
checkbox
'
);
inp
.
name
=
checkboxId
;
inp
.
value
=
textLabe
l
;
inp
.
setAttribute
(
'type'
,
'
radio
'
);
inp
.
name
=
"rejectRadio"
;
inp
.
value
=
inputva
l
;
inp
.
style
.
order
=
1
;
inp
.
style
.
marginTop
=
0
;
if
(
checkboxId
==
'check1'
){
inp
.
checked
=
true
;
}
var
newlabel
=
document
.
createElement
(
"Label"
);
newlabel
.
setAttribute
(
"for"
,
checkboxId
);
...
...
@@ -82,21 +93,33 @@ function checkLabelComponent(textLabel,checkboxId){
}
function
okCancelButton
(){
let
screenMain
=
document
.
getElementById
(
'parent_Window'
);
let
buttonCont
=
document
.
createElement
(
'div'
);
buttonCont
.
id
=
'okCancelCont'
;
let
okButton
=
document
.
createElement
(
'button'
);
//okButton.setAttribute('type', 'submit');
okButton
.
id
=
'reject_ok'
;
okButton
.
innerHTML
=
'ok'
okButton
.
innerHTML
=
'ok'
;
okButton
.
onclick
=
function
()
{
saveExceptionToXml
();
//save xml
rejectElement
();
//reject on bpo
screenMain
.
style
.
display
=
'none'
;
rejectButton
.
disabled
=
false
;
return
false
;
}
let
cancelButton
=
document
.
createElement
(
'button'
);
cancelButton
.
id
=
'reject_Cancel'
;
cancelButton
.
innerHTML
=
'cancel'
;
cancelButton
.
onclick
=
function
()
{
let
screenMain
=
document
.
getElementById
(
'parent_Window'
);
screenMain
.
style
.
display
=
'none'
;
rejectButton
.
disabled
=
false
;
return
false
;
}
buttonCont
.
appendChild
(
okButton
);
...
...
@@ -106,13 +129,87 @@ function okCancelButton(){
}
function
saveExceptionToXml
(){
var
selected
=
document
.
querySelector
(
'input[name="rejectRadio"]:checked'
).
value
;
var
elementId
=
sessionStorage
.
getItem
(
"element_id"
);
let
xmlData
=
{
"projCode"
:
PROJECT_CODE
,
"userId"
:
sessionStorage
.
getItem
(
"user_id"
),
"elementId"
:
elementId
,
"schema"
:
SCHEMA_FILE
,
"totalRec"
:
Dirfiles
.
length
,
"maxRec"
:
"1"
,
"totalKeystroke"
:
0
,
"procTime"
:
""
,
"procDuration"
:
0
,
"eob"
:
""
,
"exceptionRemark"
:
selected
,
"recordNo"
:
"1"
,
"totalSubRec"
:
"1"
,
"maxSubRec"
:
"1"
,
"imageName"
:
File_Path
,
"subRecordNo"
:
"1"
,
"eor"
:
""
,
"fields"
:
{},
"outputDir"
:
sessionStorage
.
getItem
(
"element_file_loc"
)
+
"/"
+
(
ENCODING_PASS
==
"PASS1"
?
elementId
+
".DTA"
:
elementId
+
".DTB"
),
"doctype"
:
""
,
"section"
:
""
}
updateXMLException
(
xmlData
);
return
false
;
}
function
createMessageBox
(
id
){
var
mssgBox
=
document
.
createElement
(
'textarea'
);
mssgBox
.
name
=
"
post
"
;
mssgBox
.
name
=
"
rejectRadio
"
;
mssgBox
.
maxLength
=
"1000"
;
mssgBox
.
cols
=
"24"
;
mssgBox
.
rows
=
"5"
;
mssgBox
.
id
=
id
;
mssgBox
.
disabled
=
true
;
mssgBox
.
onkeyup
=
function
()
{
let
radioFive
=
document
.
getElementById
(
'check5'
);
radioFive
.
value
=
mssgBox
.
value
;
}
return
mssgBox
;
}
var
addressOther
=
document
.
querySelectorAll
(
'input[name="rejectRadio"]'
);
var
addressField
=
document
.
getElementById
(
'text-area'
);
var
tempAddress
=
""
;
for
(
var
i
=
0
;
i
<
addressOther
.
length
;
i
++
)
{
addressOther
[
i
].
addEventListener
(
"change"
,
addressHandler
);
}
function
addressHandler
()
{
if
(
this
.
id
==
"check5"
)
{
addressField
.
disabled
=
false
;
addressField
.
value
=
tempAddress
;
}
else
{
tempAddress
=
addressField
.
value
;
addressField
.
value
=
""
;
addressField
.
disabled
=
true
;
}
}
async
function
updateXMLException
(
xmlData
){
let
response
=
await
fetch
(
'http://35.169.23.0:8080/WebGde/svc/gfs-rest/update-exception'
,
{
method
:
"POST"
,
headers
:
{
'Content-Type'
:
'application/json'
},
body
:
JSON
.
stringify
(
xmlData
)
});
if
(
response
.
status
==
200
)
{
alert
(
"Exception Updated"
);
}
else
{
alert
(
`Error
${
response
.
status
}
: Xml Update`
);
}
return
false
;
}
\ No newline at end of file
WebGde/src/main/java/com/svi/webgde/restservice/services/GDEWebServices.java
View file @
e7d704ba
...
...
@@ -204,5 +204,28 @@ public class GDEWebServices {
}
return
Response
.
ok
(
"Success"
).
build
();
}
@POST
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
@Path
(
"/update-exception"
)
public
Response
updateException
(
XMLContents
xml
)
{
try
{
File
file
=
new
File
(
xml
.
getOutputDir
());
if
(
file
.
exists
())
{
XMLUtil
.
updateExceptionRmrk
(
xml
);
}
else
{
XMLUtil
.
generateXML
(
xml
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
Response
.
status
(
500
).
entity
(
"Failed"
).
build
();
// return Response.status(500).entity("Fail").build();
}
return
Response
.
ok
(
"Success"
).
build
();
}
}
WebGde/src/main/java/com/svi/webgde/restservice/utils/XMLUtil.java
View file @
e7d704ba
...
...
@@ -226,4 +226,29 @@ public class XMLUtil {
StreamResult
result
=
new
StreamResult
(
xml
.
getOutputDir
());
transformer
.
transform
(
source
,
result
);
}
public
static
void
updateExceptionRmrk
(
XMLContents
xml
)
throws
ParserConfigurationException
,
SAXException
,
IOException
,
TransformerException
{
DocumentBuilderFactory
factory
=
DocumentBuilderFactory
.
newInstance
();
DocumentBuilder
builder
=
factory
.
newDocumentBuilder
();
Document
document
=
builder
.
parse
(
xml
.
getOutputDir
());
document
.
getElementsByTagName
(
"exception_remark"
).
item
(
0
).
setTextContent
(
xml
.
getExceptionRemark
());
TransformerFactory
transformerFactory
=
TransformerFactory
.
newInstance
();
Transformer
transformer
=
transformerFactory
.
newTransformer
();
transformer
.
setOutputProperty
(
OutputKeys
.
ENCODING
,
"ISO-8859-1"
);
transformer
.
setOutputProperty
(
OutputKeys
.
INDENT
,
"yes"
);
transformer
.
setOutputProperty
(
OutputKeys
.
STANDALONE
,
"no"
);
transformer
.
setOutputProperty
(
"{http://xml.apache.org/xslt}indent-amount"
,
"4"
);
removeEmptyText
(
document
);
DOMSource
source
=
new
DOMSource
(
document
);
StreamResult
result
=
new
StreamResult
(
xml
.
getOutputDir
());
transformer
.
transform
(
source
,
result
);
}
}
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