public void execute() throws Exception {
XWConnection xwconn = null;
ConnectionManager connectionManager = new ConnectionManager();
ConfBean confBean = null;
EditingBean editingBean = null;
String physDoc = MyRequest.getParameter("physDoc", "", parameterMap);
//vuol dire che vengo dal preinsert
if(modelMap.get("physDoc")!=null){
physDoc = (String) modelMap.get("physDoc");
}
List<String> confControl = new ArrayList<String>();
confControl.add("docEdit");
confControl.add("valoriControllati");
try {
UserBean userBean = (UserBean) modelMap.get("userBean");
//confBean = (ConfBean) modelMap.get("confBean");
confBean = new ConfBean();
WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
if (physDoc.equals("")) {
physDoc = (String) workFlowBean.getRequest().getAttribute("physDoc");
}
editingBean = new EditingBean();
editingBean.setPhysDoc(Integer.parseInt(physDoc));
xwconn = connectionManager.getConnection(workFlowBean.getArchive());
editingBean.setDocXml(xwconn.getSingleXMLFromNumDoc(editingBean.getPhysDoc()));
XMLBuilder theXMLDoc = new XMLBuilder(editingBean.getDocXml(), "ISO-8859-1");
editingBean.setXmlBuilder(theXMLDoc);
MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
editingManager.setTheXML(editingBean.getXmlBuilder());
confBean = editingManager.rewriteMultipleConf(confControl);
int docFather = xwconn.docRelNavigate(xwconn.connection, workFlowBean.getAlias(), it.highwaytech.broker.ServerCommand.navigarel_FIGLIOPADRE, editingBean.getPhysDoc());
editingBean.setDocFather(docFather);
int docSon = xwconn.docRelNavigate(xwconn.connection, workFlowBean.getAlias(), it.highwaytech.broker.ServerCommand.navigarel_PADREFIGLIO, editingBean.getPhysDoc());
editingBean.setDocSon(docSon);
int docUpperBrother = xwconn.docRelNavigate(xwconn.connection, workFlowBean.getAlias(), it.highwaytech.broker.ServerCommand.navigarel_MAGGIOREMINORE, editingBean.getPhysDoc());
editingBean.setDocUpperBrother(docUpperBrother);
int docLowerBrother = xwconn.docRelNavigate(xwconn.connection, workFlowBean.getAlias(), it.highwaytech.broker.ServerCommand.navigarel_MINOREMAGGIORE, editingBean.getPhysDoc());
editingBean.setDocLowerBrother(docLowerBrother);
editingBean.setPos(MyRequest.getParameter("pos", parameterMap));
editingBean.setSelid(MyRequest.getParameter("selid", parameterMap));
if (!editingBean.getSelid().equals("") && !editingBean.getPos().equals("")) {
QueryResult queryResult = xwconn.getQRFromSelId(editingBean.getSelid());
try {
editingBean.setPhysDocNext(xwconn.getNumDocFromQRElement(queryResult, Integer.parseInt(editingBean.getPos()) + 1));
} catch (Exception e) {
editingBean.setPhysDocNext(-1);
}
try {
editingBean.setPhysDocPrev(xwconn.getNumDocFromQRElement(queryResult, Integer.parseInt(editingBean.getPos()) - 1));
} catch (Exception e) {
editingBean.setPhysDocPrev(-1);
}
if (Integer.parseInt(editingBean.getPos()) < queryResult.elements - 1) {
editingBean.setPosNext(Integer.parseInt(editingBean.getPos()) + 1);
}
if (queryResult.elements > 0) {
editingBean.setPosPrev(Integer.parseInt(editingBean.getPos()) - 1);
}
}
if (!MyRequest.getParameter("thePne", parameterMap).equals("")) {
editingBean.setThePne(MyRequest.getParameter("thePne", parameterMap));
} else {
editingBean.setThePne(workFlowBean.getArchive().getPne());
}
modelMap.put("confBean", confBean);
modelMap.put("editingBean", editingBean);
} catch (Exception e) {