%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ page import="com.k_int.oql.iface.*,com.k_int.oql.util.*,com.k_int.QueryDescriptor.*,net.sf.hibernate.*,net.sf.hibernate.type.*,java.util.*" %>
<%!
public static int recurseQueryTree(QueryNode qn,
JspWriter out,
org.apache.struts.util.PropertyMessageResources messages,
java.util.Locale locale,
HttpServletRequest request,
net.sf.hibernate.Session sess) throws java.io.IOException {
int count=0;
if ( qn instanceof BooleanNode ) {
BooleanNode bn = (BooleanNode)qn;
for ( java.util.Iterator e = bn.getComponents().iterator(); e.hasNext(); ) {
count += recurseQueryTree((QueryNode)e.next(), out, messages, locale, request,sess);
}
}
else {
ExpressionNode en = (ExpressionNode)qn;
if ( en.getEditingInfo() != null ) {
String value = request.getParameter(en.getId());
if ( value == null ) value="";
String name = messages.getMessage(locale,en.getName());
if ( name == null )
name = en.getName();
if ( ( en.getUIHint() == null ) ) {
out.write("
" + name + ": | ");
out.write(" |
\n");
}
else if ( en.getUIHint() instanceof com.k_int.QueryDescriptor.ui.Combo ) {
com.k_int.QueryDescriptor.ui.Combo combo_info = (com.k_int.QueryDescriptor.ui.Combo) en.getUIHint();
out.write("" + name + ": | ");
out.write("");
out.write("");
out.write(" |
\n");
}
else if ( en.getUIHint() instanceof com.k_int.QueryDescriptor.ui.RadioButtons ) {
com.k_int.QueryDescriptor.ui.RadioButtons radio_buttons = (com.k_int.QueryDescriptor.ui.RadioButtons)en.getUIHint();
out.write("" + name + ": | ");
out.write("");
if ( radio_buttons.getAllowNull() ) {
out.write(" Any");
}
if ( radio_buttons.getDataSource() != null ) {
for ( java.util.Iterator i = radio_buttons.getDataSource().getValues(sess).iterator(); i.hasNext(); ) {
com.k_int.QueryDescriptor.ui.StaticValue val = (com.k_int.QueryDescriptor.ui.StaticValue) i.next();
out.write(" ");
out.write(val.getLabel());
}
}
out.write(" |
\n");
}
count++;
}
}
return count;
}
%>
<%
long max_results = 500;
long result_count = 0;
String base_dir = request.getContextPath();
String action="";
String show_descriptor = (String) request.getAttribute("showDescriptor");
String sort_order = (String) request.getAttribute("sortOrder");
String title = (String) request.getAttribute("qm.title");
String sf = (String) request.getAttribute("sf");
if ( sf != null ) {
// System.err.println("sf="+sf);
int rec_no = 0;
String record = (String) request.getAttribute("record");
if(record!=null){
rec_no = Integer.parseInt(record);
}
boolean sd = false;
String change_sort = request.getParameter("ChangeSort");
if(change_sort==null) change_sort = (String) request.getAttribute("change_sort");
System.out.println("CHANGE SORT = "+change_sort);
if ( change_sort != null ) {
String[] sort_params = change_sort.split(":");
sort_order = sort_params[1]+":"+sort_params[2]+":"+sort_params[3];
}
%>