Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BatchLoad components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rishikesh Santosh Kumar
BatchLoad components
Commits
ec45769d
Commit
ec45769d
authored
Jan 09, 2024
by
Rishikesh Santosh Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
cbbac562
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
187 additions
and
0 deletions
+187
-0
ShowBatchLoadLog.jsp
ShowBatchLoadLog.jsp
+187
-0
No files found.
ShowBatchLoadLog.jsp
0 → 100644
View file @
ec45769d
<!doctype html>
<%@page
import=
"java.util.Base64"
%>
<%@page
import=
"ibase.webitm.utility.ITMException"
%>
<%@page
import=
"java.rmi.RemoteException"
%>
<%@page
import=
"ibase.webitm.ejb.DBAccessEJB"
%>
<%@page
import=
"ibase.utility.BaseLogger"
%>
<%@page
import=
"java.io.File"
%>
<%@page
import=
"ibase.utility.CommonConstants"
%>
<%@page
import=
"ibase.utility.E12GenericUtility"
%>
<%@page
import=
"ibase.webitm.ejb.ITMDBAccessEJB"
%>
<%@page
import=
"ibase.utility.UserInfoBean"
%>
<%@page
import=
"ibase.ejb.CommonDBAccessEJB"
%>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<title>
Download Log
</title>
<base
href=
""
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<link
rel=
"icon"
type=
"image/x-icon"
href=
"favicon.ico"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"ws/assets/css/indigo-pink.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"ws/assets/bootstrap/scss/_root.scss"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"show-file-content/assets/styles.css"
/>
</head>
<%
System
.
out
.
println
(
"@@@@@@@@@ In BatchLoadDisplayLog.jsp @@@@@@@@@@@@@@@@111"
);
String
objName
=
request
.
getParameter
(
"OBJ_NAME"
);
String
batchid
=
request
.
getParameter
(
"batch_id.String"
);
String
winName
=
request
.
getParameter
(
"load_stat.String"
);
String
userCode
=
request
.
getParameter
(
"chg_user.String"
);
String
ediAddr
=
request
.
getParameter
(
"error_msg.String"
);
String
ediDataLogPathEncodedString
=
""
;
CommonDBAccessEJB
commonDBAccessEJB
=
new
CommonDBAccessEJB
();
DBAccessEJB
dbAccess
=
new
DBAccessEJB
();
UserInfoBean
userInfo
=
commonDBAccessEJB
.
createUserInfo
(
userCode
);
String
transDB
=
userInfo
.
getTransDB
();
String
tranId
=
request
.
getParameter
(
"tran_id.String"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
" value of tranId "
+
tranId
);
DBAccessEJB
dbacessEjb
=
new
DBAccessEJB
();
String
response_info
=
dbacessEjb
.
getDBColumnValue
(
"api_call_log"
,
"to_char(response_info)"
,
"tran_id='"
+
tranId
+
"'"
,
transDB
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Response_info...... "
+
response_info
);
int
indexLogFileName
=
response_info
.
lastIndexOf
(
":"
);
String
logFileName
=
response_info
.
substring
(
indexLogFileName
+
1
);
String
ediDataLogPath
=
CommonConstants
.
EDI_LOG
+
File
.
separator
+
logFileName
.
trim
();
String
batchID
=
""
;
String
errorLogFileName
=
""
;
String
dataFileName
=
""
;
// changes done by Amol S, On click of show Log button it shows the log file when load_stat is "E".
// If load_stat is other than E, it shows a message.
try
{
dataFileName
=
dbAccess
.
getDBColumnValue
(
"BATCHLOAD"
,
"DATA_FILE_NAME"
,
"BATCH_ID = '"
+
batchid
+
"'"
,
userInfo
.
getTransDB
());
batchID
=
dbAccess
.
getDBColumnValue
(
"BATCHLOAD"
,
"BATCH_ID"
,
"DATA_FILE_NAME = '"
+
dataFileName
.
trim
()
+
"'"
,
userInfo
.
getTransDB
());
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Value of batchID... ["
+
batchID
+
"]"
);
// Check if BATCHLOAD.LOAD_STAT is 'E' for the specified DATA_FILE_NAME
String
loadStat
=
dbAccess
.
getDBColumnValue
(
"BATCHLOAD"
,
"LOAD_STAT"
,
"DATA_FILE_NAME = '"
+
dataFileName
.
trim
()
+
"'"
,
userInfo
.
getTransDB
());
if
(
"E"
.
equals
(
loadStat
))
{
String
errorMsg
=
dbAccess
.
getDBColumnValue
(
"BATCHLOAD"
,
"ERROR_MSG"
,
"LOAD_STAT = 'E' AND DATA_FILE_NAME = '"
+
dataFileName
.
trim
()
+
"'"
,
userInfo
.
getTransDB
());
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Value of BATCHLOAD.ERROR_MSG... ["
+
errorMsg
+
"]"
);
// Use BATCHLOAD.ERROR_MSG for the error log file path
String
errorLogFilePath
=
CommonConstants
.
JBOSSHOME
+
"upload_failed"
;
errorLogFileName
=
batchID
+
"_server.log"
;
ediDataLogPath
=
errorLogFilePath
+
File
.
separator
+
errorLogFileName
;
if
(!
ediDataLogPath
.
isEmpty
())
{
byte
[]
ediDataLogPathEncoded
=
Base64
.
getEncoder
().
encode
(
ediDataLogPath
.
getBytes
());
ediDataLogPathEncodedString
=
new
String
(
ediDataLogPathEncoded
);
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
%>
<script
src=
"//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"
></script>
<script>
function
loadComponent
(
targetId
,
componentName
)
{
console
.
log
(
'
load Task window.ShowFileContentPlugin gsb
'
,
window
.
ShowFileContentPlugin
);
console
.
log
(
"
<%=
ediDataLogPath
%>
"
);
var
visionEDILogFileName
=
"
<%=
errorLogFileName
%>
"
;
// setBBHostURL();
if
(
window
.
ShowFileContentPlugin
)
{
var
pluginEmitter
=
window
.
ShowFileContentPlugin
.
pluginEvtEmitter
;
var
pluginConfig
=
window
.
ShowFileContentPlugin
.
pluginConfig
;
var
evtEmit
=
new
pluginEmitter
();
evtEmit
.
subscribe
((
pluginEvent
)
=>
{
});
var
objName
=
"
showdata
"
;
var
data
=
{
"
target-id
"
:
targetId
,
"
compData
"
:
{
"
objName
"
:
objName
},
"
cacheComp
"
:
false
};
var
ShowFileContentPlugin
=
window
.
ShowFileContentPlugin
.
loadPlugin
(
componentName
,
data
,
window
.
ShowFileContentPlugin
.
pluginMI
,
evtEmit
);
console
.
log
(
'
ShowFileContentPlugin >>
'
,
ShowFileContentPlugin
);
}
var
element
=
document
.
getElementById
(
'
display-file-content
'
);
var
filepath
=
element
.
getAttribute
(
'
filepath
'
);
var
url
=
window
.
location
.
origin
+
"
/ibase/rest/EDIService/edifiles/
"
+
filepath
;
console
.
log
(
"
url:::::
"
+
url
);
var
request
=
$
.
ajax
({
url
:
url
,
method
:
"
GET
"
});
request
.
done
(
function
(
resp
)
{
console
.
log
(
"
Type of response:::::
"
+
typeof
resp
);
if
(
typeof
resp
===
'
object
'
)
{
console
.
log
(
"
Response:::::
"
+
"
No data found
"
);
}
else
if
(
typeof
resp
===
'
string
'
)
{
console
.
log
(
"
Response:::::
"
+
resp
);
downloadLogFile
(
resp
);
}
else
{
}
});
function
downloadLogFile
(
logContent
)
{
var
blob
=
new
Blob
([
logContent
],
{
type
:
'
text/plain
'
});
var
url
=
window
.
URL
.
createObjectURL
(
blob
);
var
a
=
document
.
createElement
(
'
a
'
);
a
.
href
=
url
;
a
.
download
=
visionEDILogFileName
;
document
.
body
.
appendChild
(
a
);
a
.
click
();
// Cleanup
window
.
URL
.
revokeObjectURL
(
url
);
document
.
body
.
removeChild
(
a
);
}
}
function
showAlertAndClose
()
{
alert
(
'
Download Log is only available when load stat = E
'
);
window
.
close
();
}
var
loadStat
=
"
<%=
winName
%>
"
;
if
(
loadStat
===
'
N
'
||
loadStat
===
'
Y
'
)
{
showAlertAndClose
();
}
</script>
<body
onload=
"document.getElementById('display-file-content').click();"
>
<div
style=
"position: absolute; z-index: 1;"
>
<!-- Gagan -->
<button
class=
"square-button"
onClick=
"loadComponent('appContainer', 'app-show-data')"
id=
"display-file-content"
filepath=
"
<%=
ediDataLogPathEncodedString
%>
"
style=
"display: none"
>
Search Scope
</button>
<!-- Gagan -->
</div>
<div>
<input
type=
"hidden"
name=
"myhiddenvalue"
id=
"filePath"
value=
"
<%=
ediDataLogPath
%>
"
/>
</div>
<div>
<!-- Additional HTML content if needed -->
</div>
</body>
<!-- Added by Gagan -->
<script
src=
"show-file-content/runtime.js"
type=
"module"
></script>
<script
src=
"show-file-content/runtime.js"
nomodule
defer
></script>
<script
src=
"show-file-content/polyfills.js"
type=
"module"
></script>
<script
src=
"show-file-content/polyfills.js"
nomodule
defer
></script>
<script
src=
"show-file-content/main.js"
type=
"module"
></script>
<script
src=
"show-file-content/main.js"
nomodule
defer
></script>
</html>
\ No newline at end of file
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