Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Component Sharing
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
2
Merge Requests
2
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
Gagandeep Singh Bhatia
Component Sharing
Commits
3b32945d
Commit
3b32945d
authored
Feb 27, 2024
by
Sonawane Amol Madhjuar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete ExternalAPI.java
parent
faefd7d6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
122 deletions
+0
-122
Amol/API/External API/ExternalAPI.java
Amol/API/External API/ExternalAPI.java
+0
-122
No files found.
Amol/API/External API/ExternalAPI.java
deleted
100644 → 0
View file @
faefd7d6
package
ibase
.
webitm
.
ejb
.
sys
;
import
java.rmi.RemoteException
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
javax.ejb.Stateless
;
import
org.w3c.dom.Document
;
import
org.w3c.dom.Node
;
import
org.w3c.dom.NodeList
;
import
ibase.utility.BaseLogger
;
import
ibase.utility.CommonConstants
;
import
ibase.utility.E12GenericUtility
;
import
ibase.utility.GenericUtility
;
import
ibase.utility.UserInfoBean
;
import
ibase.webitm.ejb.ITMDBAccessEJB
;
import
ibase.webitm.ejb.ValidatorEJB
;
import
ibase.webitm.utility.ITMException
;
@Stateless
public
class
ExternalAPI
extends
ValidatorEJB
{
@Override
public
String
wfValData
(
String
xmlString
,
String
xmlString1
,
String
xmlString2
,
String
objContext
,
String
editFlag
,
String
xtraParams
)
throws
RemoteException
,
ITMException
{
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Inside the ExternalAPI class"
);
Document
dom
=
null
;
Document
dom1
=
null
;
Document
dom2
=
null
;
String
errString
=
""
;
GenericUtility
genericUtility
=
GenericUtility
.
getInstance
();
try
{
BaseLogger
.
log
(
"3"
,
null
,
null
,
"xmlString:::"
+
xmlString
);
if
(
xmlString
!=
null
&&
xmlString
.
length
()
!=
0
)
{
dom
=
genericUtility
.
parseString
(
xmlString
);
}
if
(
xmlString1
!=
null
&&
xmlString1
.
length
()
!=
0
)
{
dom1
=
genericUtility
.
parseString
(
xmlString1
);
}
if
(
xmlString2
!=
null
&&
xmlString2
.
length
()
!=
0
)
{
dom2
=
genericUtility
.
parseString
(
xmlString2
);
}
errString
=
wfValData
(
dom
,
dom1
,
dom2
,
objContext
,
editFlag
,
xtraParams
);
}
catch
(
Exception
e
)
{
// Handle the exception appropriately
}
return
errString
;
}
@Override
public
String
wfValData
(
Document
dom
,
Document
dom1
,
Document
dom2
,
String
objContext
,
String
editFlag
,
String
xtraParams
)
throws
RemoteException
,
ITMException
{
BaseLogger
.
log
(
"3"
,
null
,
null
,
" inside the wfvaldata::"
);
NodeList
parentNodeList
=
null
;
NodeList
childNodeList
=
null
;
Node
parentNode
=
null
;
Node
childNode
=
null
;
UserInfoBean
userInfo
=
super
.
getUserInfo
();
int
ctr
=
0
,
currentFormNo
=
0
,
childNodeListLength
=
0
;
String
childNodeName
=
null
;
GenericUtility
genericUtility
=
GenericUtility
.
getInstance
();
String
errString
=
""
;
String
userId
=
""
;
try
{
userId
=
getValueFromXTRA_PARAMS
(
xtraParams
,
"loginCode"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
genericUtility
.
getApplDateFormat
());
if
(
objContext
!=
null
&&
objContext
.
trim
().
length
()
>
0
)
{
currentFormNo
=
Integer
.
parseInt
(
objContext
);
}
BaseLogger
.
log
(
"3"
,
null
,
userInfo
.
getLoginCode
(),
"*************Validation for empty inputs Formno="
+
currentFormNo
);
switch
(
currentFormNo
)
{
case
1
:
parentNodeList
=
dom
.
getElementsByTagName
(
"Detail"
+
currentFormNo
);
parentNode
=
parentNodeList
.
item
(
0
);
childNodeList
=
parentNode
.
getChildNodes
();
childNodeListLength
=
childNodeList
.
getLength
();
for
(
ctr
=
0
;
ctr
<
childNodeListLength
;
ctr
++)
{
childNode
=
childNodeList
.
item
(
ctr
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Child Node=>"
+
ctr
+
"=>"
+
childNode
);
childNodeName
=
childNode
.
getNodeName
().
trim
();
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Child Node Name=>"
+
ctr
+
"=>"
+
childNodeName
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"Child Node Value=>"
+
ctr
+
"=>"
+
genericUtility
.
getColumnValue
(
childNodeName
,
dom
));
if
(
childNodeName
.
equalsIgnoreCase
(
"eff_from"
))
{
Date
fromDate
=
sdf
.
parse
(
genericUtility
.
getColumnValue
(
"eff_from"
,
dom
));
Date
toDate
=
sdf
.
parse
(
genericUtility
.
getColumnValue
(
"valid_upto"
,
dom
));
BaseLogger
.
log
(
"3"
,
null
,
null
,
"fromDate is ["
+
fromDate
+
"]"
);
BaseLogger
.
log
(
"3"
,
null
,
null
,
"toDate is ["
+
toDate
+
"]"
);
if
(
fromDate
.
compareTo
(
toDate
)
>
0
)
{
errString
=
getErrorString
(
"valid_upto"
,
"DATEXEPT"
,
userId
);
}
}
}
break
;
// Add more cases as needed
}
// Close the switch statement properly
}
catch
(
Exception
e
)
{
// Handle the exception appropriately
}
return
errString
;
}
public
static
String
checkNull
(
String
input
)
{
if
(
input
==
null
||
"null"
.
equalsIgnoreCase
(
input
)
||
"undefined"
.
equalsIgnoreCase
(
input
))
{
input
=
""
;
}
return
input
.
trim
();
}
}
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