customBrowserPreview.jsp
8.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ page import="weaver.interfaces.workflow.browser.Browser" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="FieldInputTools" class="weaver.integration.conftest.FieldInputTools" scope="page" />
<html>
<HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
</HEAD>
<BODY>
<%
String name = Util.null2String(request.getParameter("name"));
String actionid = Util.null2String(request.getParameter("actionid"));
String actionname = Util.null2String(request.getParameter("actionname"));
//System.out.println("actionid="+actionid+" actionname="+actionname);
String operation = Util.null2String(request.getParameter("operation"));
int paramsize = Util.getIntValue(request.getParameter("paramsize"),0);
Browser browser=(Browser)StaticObj.getServiceByFullname("browser."+actionname, Browser.class);
String outpage = Util.null2String(browser.getOutPageURL());
String href = Util.null2String(browser.getHref());
href = Util.null2String(browser.getHref(""+user.getUID(),href));
String from = Util.null2String(browser.getFrom());
String showtree = Util.null2String(browser.getShowtree());
String imagefilename = "/images/hdMaintenance_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(20961,user.getLanguage());
String needfav ="1";
String needhelp ="";
%>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(197,user.getLanguage())+",javascript:onSubmit(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
if(paramsize > 0){
RCMenu += "{"+SystemEnv.getHtmlLabelName(1290,user.getLanguage())+",javascript:goBack(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
}
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<FORM NAME=SearchForm STYLE="margin-bottom:0" action="customBrowserPreview.jsp" method=post>
<input type="hidden" name="paramsize" value="<%=paramsize %>">
<%
FieldInputTools.setUser(user);
FieldInputTools.setActionid(actionid);
FieldInputTools.setActionname(actionname);
FieldInputTools.setDatatype(operation);
FieldInputTools.setBrowser(browser);
Map fieldmap = FieldInputTools.getInputFieldName();
List searchFieldList = (List)fieldmap.get("searchFieldList");
List tempsearchFieldList = new ArrayList();
for(int i=0;i<searchFieldList.size();i++){
String fieldname = Util.null2String(searchFieldList.get(i));
String value = Util.null2String(request.getParameter(fieldname+"_search"));
if(tempsearchFieldList.indexOf(fieldname) < 0){
tempsearchFieldList.add(fieldname);
%>
<input type="hidden" name="<%=fieldname%>_search" value="<%=value %>">
<% }
}%>
<input type="hidden" name="actionid" value="<%=actionid %>">
<input type="hidden" name="actionname" value="<%=actionname %>">
<table id="topTitle" cellpadding="0" cellspacing="0">
<tr>
<td></td>
<td class="rightSearchSpan" style="text-align:right; width:500px!important">
<input type="button" value="<%=SystemEnv.getHtmlLabelName(197 ,user.getLanguage()) %>" class="e8_btn_top" onclick="onSubmit()"/>
<%if(paramsize > 0){%>
<input type="button" value="<%=SystemEnv.getHtmlLabelName(1290 ,user.getLanguage()) %>" class="e8_btn_top" onclick="goBack()"/>
<%} %>
<span title="<%=SystemEnv.getHtmlLabelName(23036 ,user.getLanguage()) %>" class="cornerMenu"></span>
</td>
</tr>
</table>
<div id="tabDiv" ><span style="font-size:14px;font-weight:bold;"></span></div>
<div class="cornerMenuDiv"></div>
<div class="advancedSearchDiv" id="advancedSearchDiv" style='display:none;'></div>
<%
Map showfieldMap = browser.getShowfieldMap();
int fieldsize = 2;
if("2".equals(from)){
if(null!=browser.getShowfieldMap()) {
fieldsize = browser.getShowfieldMap().size();
}
}
String tableString="";
int colwidth = 100/(fieldsize);
String requestjson = weaver.interfaces.workflow.browser.BaseBrowserDataSource.requestToSpitParam1(request);
if(from.equals("2")){
Set keyset = showfieldMap.keySet();
tableString = "<table instanceid=\"BrowseTableTest\" pageId=\"\" pagesize=\"10\" datasource=\"weaver.integration.conftest.ConfigureTestUtil.getBrowserDataListForSearch\" sourceparams=\""+Util.toHtmlForSplitPage(requestjson)+"\" tabletype=\"none\" pageBySelf=\"true\">"+
"<sql backfields=\"*\" sqlform=\"temp\" sqlorderby=\"id\" sqlprimarykey=\"id\" sqlsortway=\"desc\" />"+
"<head>";
tableString+= "<col width=\"0%\" hide=\"true\" text=\""+SystemEnv.getHtmlLabelName(413,user.getLanguage())+"\" column=\"ids\" orderkey=\"ids\"/>";
for(Iterator it = keyset.iterator();it.hasNext();){
String keyname = (String)it.next();
String showname = Util.null2String((String)showfieldMap.get(keyname));
if("".equals(showname))
continue;
tableString += "<col width=\""+colwidth+"%\" text=\""+Util.null2String(showname)+"\" column=\""+keyname+"s\" orderkey=\""+keyname+"s\"/>";
}
tableString += "</head>"+
"</table>";
}else{
tableString=""+
"<table instanceid=\"BrowseTable\" pageId=\"\" pagesize=\"10\" datasource=\"weaver.integration.conftest.ConfigureTestUtil.getBrowserDataListForSearch\" sourceparams=\""+Util.toHtmlForSplitPage(requestjson)+"\" tabletype=\"none\" pageBySelf=\"true\">"+
"<sql backfields=\"*\" sqlform=\"temp\" sqlorderby=\"id\" sqlprimarykey=\"id\" sqlsortway=\"desc\" />"+
"<head>";
tableString+= "<col width=\"0%\" hide=\"true\" text=\""+SystemEnv.getHtmlLabelName(413,user.getLanguage())+"\" column=\"ids\" orderkey=\"ids\"/>";
tableString+= "<col width=\""+colwidth+"%\" text=\""+Util.null2String(browser.getNameHeader())+"\" column=\"names\" orderkey=\"names\"/>";
tableString += "<col width=\""+colwidth+"%\" text=\""+Util.null2String(browser.getDescriptionHeader())+"\" column=\"descs\" orderkey=\"descs\"/>"+
"</head>"+
"</table>";
}
Map searchfieldMap = browser.getSearchfieldMap();
Map searchvaluemap = new HashMap();
if(null!=searchfieldMap){
Set keyset = searchfieldMap.keySet();
for(Iterator it = keyset.iterator();it.hasNext();){
String keyname = (String)it.next();
String keyvalue = Util.null2String(request.getParameter(keyname));
if(!"".equals(keyvalue))
searchvaluemap.put(keyname,keyvalue);
}
}
Map paramvalues = browser.getParamvalues();
if(null!=paramvalues){
Set keyset = paramvalues.keySet();
for(Iterator it = keyset.iterator();it.hasNext();){
String keyname = (String)it.next();
String keyvalue = Util.null2String(request.getParameter(keyname));
//System.out.println("111 keyname : "+keyname+" keyvalue : "+keyvalue);
if(!"".equals(keyvalue))
paramvalues.put(keyname,keyvalue);
}
browser.setParamvalues(paramvalues);
}
%>
<wea:layout type="4col">
<wea:group context='<%=SystemEnv.getHtmlLabelName(20550,user.getLanguage())%>' attributes="{'samePair':'BaseInfo','groupOperDisplay':'none','groupSHBtnDisplay':'none'}">
<%if(!from.equals("2")){ %>
<wea:item><%=Util.null2String(browser.getNameHeader())%></wea:item>
<wea:item attributes="{'colspan':'3'}"><input name='name' value='<%=name%>' class="InputStyle" ></wea:item>
<%}else{
if(null!=searchfieldMap)
{
Set keyset = searchfieldMap.keySet();
int allcolumn = keyset.size();
int i = 0;
for(Iterator it = keyset.iterator();it.hasNext();)
{
String keyname = (String)it.next();
String showname = (String)searchfieldMap.get(keyname);
String serchvalue = Util.null2String((String)searchvaluemap.get(keyname));
if("".equals(showname))
continue;
i++;
//System.out.println(keyname+" "+showname+" "+i+" "+allcolumn);
%>
<wea:item><%=showname%></wea:item>
<wea:item><input name='<%=keyname %>' value='<%=serchvalue%>' class="InputStyle" ></wea:item>
<%
}
}
%>
<%} %>
</wea:group>
</wea:layout>
</FORM>
<wea:SplitPageTag tableString='<%=tableString%>' isShowTopInfo="false" mode="run"/>
<div id="zDialog_div_bottom" class="zDialog_div_bottom">
<wea:layout needImportDefaultJsAndCss="false">
<wea:group context="" attributes="{'groupDisplay':'none'}">
<wea:item type="toolbar">
<input type="button" class=zd_btn_cancle accessKey=T id=btncancel value="<%=SystemEnv.getHtmlLabelName(309,user.getLanguage())%>" onclick='onBack();'></input>
</wea:item>
</wea:group>
</wea:layout>
</div>
</BODY>
<script type="text/javascript">
var dialog = parent.parent.getDialog(parent);
function onBack(){
dialog.close();
}
function onSubmit(){
SearchForm.submit();
}
function goBack(){
window.location.href="/integration/configuretest/inputdata.jsp?operation=browser&actionid=<%=actionid%>&actionname=<%=actionname%>";
}
</script>
</html>