Commit 0a0803ff authored by manohar's avatar manohar

get_date returned xml instead of tab delimited string


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@94373 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 0ad13c57
......@@ -99,7 +99,13 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
Statement stmt = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
StringBuffer retTabSepStrBuff = new StringBuffer();
//StringBuffer retTabSepStrBuff = new StringBuffer();
StringBuffer retTabSepStrBuff = new StringBuffer("<?xml version = \"1.0\"?>");
retTabSepStrBuff.append("<DocumentRoot>");
retTabSepStrBuff.append("<description>").append("Datawindow Root").append("</description>");
retTabSepStrBuff.append("<group0>");
retTabSepStrBuff.append("<description>").append("Group0 description").append("</description>");
retTabSepStrBuff.append("<Header0>");
String userId = null;
Object date = null;
String sql = "";
......@@ -137,7 +143,7 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
{
retTabSepStrBuff.append(" \t");
//LEVEL_1
/* //LEVEL_1
retTabSepStrBuff.append(" \t");
//LEVEL_2
......@@ -164,6 +170,11 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
retTabSepStrBuff.append(" ").append("\t");
retTabSepStrBuff.append("\n");
*/
retTabSepStrBuff.append("</Header0>");
retTabSepStrBuff.append("</group0>");
retTabSepStrBuff.append("</DocumentRoot>");
resultString = retTabSepStrBuff.toString();
}
else
......@@ -273,41 +284,59 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
key = tApplication + ":" + rs.getInt(2) + ":" + rs.getInt(3) + ":" + rs.getInt(4)
+ ":" + rs.getInt(5) + ":" + rs.getInt(6);
// 14/03/14 manoharan to avoid link names
tWinName = rs.getString("WIN_NAME");
tWinName = (tWinName==null?"":tWinName);
if (tWinName.indexOf("/ibase/") > -1)
{
continue;
}
retTabSepStrBuff.append("<Detail2>");
//APPLICATION
retTabSepStrBuff.append(tApplication==null?"":rs.getString(1)).append("\t");
//retTabSepStrBuff.append(tApplication==null?"":rs.getString(1)).append("\t");
retTabSepStrBuff.append("<application>").append("<![CDATA[" + (rs.getString("APPLICATION")==null?"":rs.getString("APPLICATION")) +"]]>").append("</application>");
//LEVEL_1
retTabSepStrBuff.append(rs.getInt(2)).append("\t");
//retTabSepStrBuff.append(rs.getInt(2)).append("\t");
retTabSepStrBuff.append("<level_1>").append("<![CDATA[" + rs.getInt("LEVEL_1") +"]]>").append("</level_1>");
//LEVEL_2
retTabSepStrBuff.append(rs.getInt(3)).append("\t");
//retTabSepStrBuff.append(rs.getInt(3)).append("\t");
retTabSepStrBuff.append("<level_2>").append("<![CDATA[" + rs.getInt("LEVEL_2") +"]]>").append("</level_2>");
//LEVEL_3
retTabSepStrBuff.append(rs.getInt(4)).append("\t");
//retTabSepStrBuff.append(rs.getInt(4)).append("\t");
retTabSepStrBuff.append("<level_3>").append("<![CDATA[" + rs.getInt("LEVEL_3") +"]]>").append("</level_3>");
//LEVEL_4
retTabSepStrBuff.append(rs.getInt(5)).append("\t");
//retTabSepStrBuff.append(rs.getInt(5)).append("\t");
retTabSepStrBuff.append("<level_4>").append("<![CDATA[" + rs.getInt("LEVEL_4") +"]]>").append("</level_4>");
//LEVEL_5
retTabSepStrBuff.append(rs.getInt(6)).append("\t");
//retTabSepStrBuff.append(rs.getInt(6)).append("\t");
retTabSepStrBuff.append("<level_5>").append("<![CDATA[" + rs.getInt("LEVEL_5") +"]]>").append("</level_5>");
//DESCR
tMenuName = rs.getString(8);
retTabSepStrBuff.append(rs.getString(8)==null?"":rs.getString(8)).append("\t");
tMenuName = rs.getString("DESCR");
//retTabSepStrBuff.append(rs.getString(8)==null?"":rs.getString(8)).append("\t");
retTabSepStrBuff.append("<descr>").append("<![CDATA[" + (rs.getString("DESCR")==null?"":rs.getString("DESCR")) +"]]>").append("</descr>");
//RIGHTS
retTabSepStrBuff.append(rs.getString(9)==null?"":rs.getString(9)).append("\t");
//retTabSepStrBuff.append(rs.getString(9)==null?"":rs.getString(9)).append("\t");
retTabSepStrBuff.append("<rights>").append("<![CDATA[" + (rs.getString("RIGHTS")==null?"":rs.getString("RIGHTS")) +"]]>").append("</rights>");
//WIN_NAME
tWinName = rs.getString(7);
retTabSepStrBuff.append(rs.getString(7)==null?"":rs.getString(7)).append("\t");
tWinName = rs.getString("WIN_NAME");
//retTabSepStrBuff.append(rs.getString(7)==null?"":rs.getString(7)).append("\t");
retTabSepStrBuff.append("<win_name>").append("<![CDATA[" + (rs.getString("WIN_NAME")==null?"":rs.getString("WIN_NAME")) +"]]>").append("</win_name>");
//retTabSepStrBuff.append(" ").append("\t");
//retTabSepStrBuff.append("\n");
retTabSepStrBuff.append(" ").append("\t");
retTabSepStrBuff.append("\n");
retTabSepStrBuff.append("</Detail2>");
System.out.println("Key getdata function ["+key+"]");
System.out.println("rights in function ["+ rs.getString(9) +"]");
userRightsMap.put(key, rs.getString(9));
System.out.println("rights in function ["+ rs.getString("RIGHTS") +"]");
userRightsMap.put(key, rs.getString("RIGHTS"));
if(tWinName != null && tWinName.trim().length() > 2)
winNameMap.put(key, tWinName.trim().substring(2, tWinName.trim().length()));
......@@ -317,6 +346,9 @@ public class UserRightsPrc extends ProcessEJB implements UserRightsPrcLocal , U
rs = null;
pstmt.close();
pstmt = null;
retTabSepStrBuff.append("</Header0>");
retTabSepStrBuff.append("</group0>");
retTabSepStrBuff.append("</DocumentRoot>");
}
// end 24/03/12 manoharan
}//try
......
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