}
public void execute() throws Exception {
XWConnection xwconn = null;
ConfBean confBean = null;
ConnectionManager connectionManager = new ConnectionManager();
// questa lista pu essere presa da un file di configurazione
List<String> confControl = new ArrayList<String>();
confControl.add("query-multiarchive");
confControl.add("valoriControllati");
try {
UserBean userBean = (UserBean) modelMap.get("userBean");
confBean = (ConfBean) modelMap.get("confBean");
WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
editingManager.setTheXML(new XMLBuilder("root"));
confBean = editingManager.rewriteMultipleConf(confControl);
confBean.setTheXMLConfQuery(confBean.getTheXMLConfQueryMultiArchive());
QueryBean queryBean = new QueryBean();
try {
xwconn = connectionManager.getConnection(workFlowBean.getArchive());
XMLBuilder theXMLconf = confBean.getTheXMLConfQuery();
// System.out.println("theXMLconftheXMLconftheXMLconftheXMLconf " + theXMLconf);
it.highwaytech.db.QueryResult qr = null;
if (theXMLconf.valoreNodo("/root/query/@numDocInfoQuery").equals("")) {
qr = xwconn.selectQR("([UD,/xw/@UdType/]=\"" + workFlowBean.getArchive().getPne() + "\")");
} else {
qr = xwconn.selectQR(theXMLconf.valoreNodo("/root/query/@numDocInfoQuery", false));
}
queryBean.setTotNumDoc(qr.elements);
queryBean.setLastUpdate(xwconn.getLastUpdate());
} catch (Exception e) {
// TODO: handle exception
}
// System.out.println("QueryPageCommand.execute() " + confBean.getTheXMLConfQuery().getXML("ISO-8859-1"));
// System.out.println("QueryPageCommand.execute() " + confBean.getTheXMLValControllati().getXML("ISO-8859-1"));
modelMap.put("confBean", confBean);
modelMap.put("queryBean", queryBean);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(e.toString());
} finally {
connectionManager.closeConnection(xwconn);
}
}