Commit 065ff2c4 authored by manohar's avatar manohar

some additional SOP for debugging added


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92891 ce508802-f39f-4f6c-b175-0d175dae99d5
parent db86e37e
...@@ -881,6 +881,8 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U ...@@ -881,6 +881,8 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String alreadyExists = "N"; String alreadyExists = "N";
String foundRights = null;
int operation = -1;
String sql = " SELECT RIGHTS FROM USER_RIGHTS " String sql = " SELECT RIGHTS FROM USER_RIGHTS "
+ " WHERE PROFILE_ID = ? " + " WHERE PROFILE_ID = ? "
+ " AND APPLICATION = ? " + " AND APPLICATION = ? "
...@@ -889,11 +891,9 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U ...@@ -889,11 +891,9 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
+ " AND MENU_SUBCOL = ? " + " AND MENU_SUBCOL = ? "
+ " AND LEVEL_4 = ? " + " AND LEVEL_4 = ? "
+ " AND LEVEL_5 = ? "; + " AND LEVEL_5 = ? ";
try {
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
String foundRights = null;
int operation = -1;
pstmt.setString(1,profileId); pstmt.setString(1,profileId);
pstmt.setString(2,application); pstmt.setString(2,application);
...@@ -922,19 +922,40 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U ...@@ -922,19 +922,40 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
operation = 2; operation = 2;
else if(foundRights != null && rights == null && "Y".equals(alreadyExists)) else if(foundRights != null && rights == null && "Y".equals(alreadyExists))
operation = 3; operation = 3;
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);// added by akhilesh on 31/oct/12
}
finally
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
return operation; return operation;
} }
// end 01/06/10 manoharan // end 01/06/10 manoharan
int searchUserRight(String searchKey, String rights) int searchUserRight(String searchKey, String rights) throws Exception
{ {
System.out.println("searchKey in function ["+searchKey+"]");
System.out.println("rights in function ["+rights+"]");
String foundRights = null; String foundRights = null;
int operation = -1; int operation = -1;
try {
System.out.println("searchKey in function ["+searchKey+"]");
System.out.println("rights in function ["+rights+"]");
foundRights = (String) userRightsMap.get(searchKey); foundRights = (String) userRightsMap.get(searchKey);
System.out.println("Found rights in function ["+foundRights+"]"); System.out.println("Found rights in function ["+foundRights+"]");
...@@ -945,14 +966,24 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U ...@@ -945,14 +966,24 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
operation = 2; operation = 2;
else if(foundRights != null && rights == null) else if(foundRights != null && rights == null)
operation = 3; operation = 3;
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);// added by akhilesh on 31/oct/12
}
return operation; return operation;
} }
private ArrayList getAllSubMenu(String application, int level1, int level2, int level3, int level4, int level5, Connection conn) private ArrayList getAllSubMenu(String application, int level1, int level2, int level3, int level4, int level5, Connection conn) throws Exception
throws SQLException
{ {
String tApplication = null; String tApplication = null;
String tKey = null;
String tWinName = null;
ArrayList subMenuList = new ArrayList();
PreparedStatement pstmt = null;
ResultSet rs = null;
String parentKey = "";
int tLevel1 = 0; int tLevel1 = 0;
int tLevel2 = 0; int tLevel2 = 0;
int tLevel3 = 0; int tLevel3 = 0;
...@@ -967,18 +998,15 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U ...@@ -967,18 +998,15 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
" and ( level_1 = 0 or (level_1 <> 0 and (LEVEL_1 = " + level1 + " AND LEVEL_2 > 0))) " + " and ( level_1 = 0 or (level_1 <> 0 and (LEVEL_1 = " + level1 + " AND LEVEL_2 > 0))) " +
" and ( level_2 = 0 or (level_2 <> 0 and (LEVEL_2 = " + level2 + " AND LEVEL_3 > 0))) " + " and ( level_2 = 0 or (level_2 <> 0 and (LEVEL_2 = " + level2 + " AND LEVEL_3 > 0))) " +
" and ( level_3 = 0 or ( level_3 <> 0 and (LEVEL_3 = " + level3 + " AND LEVEL_4 > 0))) " + " and ( level_3 = 0 or ( level_3 <> 0 and (LEVEL_3 = " + level3 + " AND LEVEL_4 > 0))) " +
" and ( level_4 = 0 or ( level_4 <> 0 and (LEVEL_4 = " + level4 + " AND LEVEL_5 > 0))) "; //+ " and ( level_4 = 0 or ( level_4 <> 0 and (LEVEL_4 = " + level4 + " AND LEVEL_5 > 0))) " +
//" and WIN_NAME <> '-' " ; " and WIN_NAME <> '-' " ;
System.out.println("Get All Sub Menu SQL :: " + getSubMenuSql); System.out.println("Get All Sub Menu SQL :: " + getSubMenuSql);
String parentKey = application + ":" + level1 + ":" + level2 + ":" + level3 + ":" + level4 + ":" + level5; parentKey = application + ":" + level1 + ":" + level2 + ":" + level3 + ":" + level4 + ":" + level5;
ArrayList subMenuList = new ArrayList();
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
pstmt = conn.prepareStatement(getSubMenuSql); pstmt = conn.prepareStatement(getSubMenuSql);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -991,11 +1019,9 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U ...@@ -991,11 +1019,9 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
tLevel3 = rs.getInt(4); tLevel3 = rs.getInt(4);
tLevel4 = rs.getInt(5); tLevel4 = rs.getInt(5);
tLevel5 = rs.getInt(6); tLevel5 = rs.getInt(6);
String tWinName = null;
tWinName = rs.getString(7); tWinName = rs.getString(7);
String tKey = null;
tKey = tApplication + ":" + tLevel1 + ":" + tLevel2 + ":" + tLevel3 + ":" + tLevel4 + ":" + tLevel5; tKey = tApplication + ":" + tLevel1 + ":" + tLevel2 + ":" + tLevel3 + ":" + tLevel4 + ":" + tLevel5;
System.out.println("tKey :: " + tKey); System.out.println("tKey [" + tKey + "] tWinName [" + tWinName + "]");
subMenuList.add(tKey); subMenuList.add(tKey);
tMenuName = rs.getString(8); tMenuName = rs.getString(8);
...@@ -1019,12 +1045,30 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U ...@@ -1019,12 +1045,30 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
if(subMenuList.size() == 0) if(subMenuList.size() == 0)
subMenuList.add(parentKey); subMenuList.add(parentKey);
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);// added by akhilesh on 31/oct/12
}
finally
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
return subMenuList; return subMenuList;
} }
private String getUserRights(String profileId, String application, int level1, int level2, int level3, int level4, int level5, Connection conn) private String getUserRights(String profileId, String application, int level1, int level2, int level3, int level4, int level5, Connection conn) throws Exception
throws SQLException
{ {
String userRightsSql = " select RIGHTS " + String userRightsSql = " select RIGHTS " +
" from user_rights " + " from user_rights " +
...@@ -1043,6 +1087,8 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U ...@@ -1043,6 +1087,8 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
try
{
pstmt = conn.prepareStatement(userRightsSql); pstmt = conn.prepareStatement(userRightsSql);
...@@ -1059,6 +1105,26 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U ...@@ -1059,6 +1105,26 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);// added by akhilesh on 31/oct/12
}
finally
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
return rights; return rights;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment