// questa lista pu� essere presa da un file di configurazione
List<String> confControl = new ArrayList<String>();
confControl.add("titleManager");
confControl.add("docEdit");
try {
UserBean userBean = (UserBean) modelMap.get("userBean");
confBean = (ConfBean) modelMap.get("confBean");
workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
XWConnection xwconnone = connectionManager.getConnection(workFlowBean.getArchive());
MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
editingManager.setTheXML(new XMLBuilder(xwconnone.getSingleXMLFromNumDoc(Integer.parseInt(physDoc)), "ISO-8859-1"));
confBean = editingManager.rewriteMultipleConf(confControl);
connectionManager.closeConnection(xwconnone);
XMLBuilder theXMLconf = confBean.getTheXMLConfEditing();
if (!codeToFind.equals("") && makeAction.equals("")) {
Map<String, List<ElementToFindBean>> hashDbToFind = buildElementToFindBean.buildElementToFindBean(theXMLconf, workFlowBean.getAlias());
System.out.println("ModifyAuther.execute() (hashDbToFind) " + (hashDbToFind));
int contaArchProc = 0;
String archivioCorrente = "";
QueryResult qr = null;
for (Entry<String, List<ElementToFindBean>> entrySet : hashDbToFind.entrySet()) {
String dbToFind = entrySet.getKey();
List<ElementToFindBean> arrElmToFind = hashDbToFind.get(dbToFind);
archivioCorrente = dbToFind;
if(userBean.getArchivesMap().get(dbToFind)==null){
continue;
}
Archive archiveBean = userBean.getArchivesMap().get(dbToFind);
String descrArchive = archiveBean.getArchiveDescr();
List<String> listCtrlModAuther = new ArrayList<String>();
if (!archiveBean.getAlias().equals("")) {
for (int a = 0; a < arrElmToFind.size(); a++) {
ModifyAutherBean autherBean = new ModifyAutherBean();
ElementToFindBean elementToFindBean = (ElementToFindBean) arrElmToFind.get(a);
System.out.println("ModifyAuther.execute() elementToFindBean.getStrQuery()" + elementToFindBean.getStrQuery() + "AAAA");
if (elementToFindBean.getStrQuery() != null && !elementToFindBean.getStrQuery().equals("null")) {
String query = "(" + elementToFindBean.getStrQuery() + "=" + codeToFind + ")";
System.out.println("query " + query + "<br>");
System.out.println("archivioCorrente " + archivioCorrente + "<br>");
XWConnection xwconn = null;
try {
xwconn = connectionManager.getConnection(archiveBean);
qr = xwconn.getQRfromPhrase(query);
System.out.println("ModifyAuther.execute() qr " + qr.elements);
} catch (Exception e) {
// throw new Exception("ERRORE NELLA CONNESSIONE CON IL DATABASE " + archiviBean.getTheArch());
} finally {
connectionManager.closeConnection(xwconn);
}
// System.out.println("<span style=\"background:#fff;\"><b>" + archivioCorrente + "</b>" + query + " occorrenze=" + qr.elements + "</span><br>");
autherBean.setArchivioAlias(archivioCorrente);
autherBean.setArchivioDescr(descrArchive);
autherBean.setElementToFindBean(elementToFindBean);
autherBean.setQuery(query);
autherBean.setNumElementi(qr.elements);
// escludere per ArchivioAlias e query
if (!listCtrlModAuther.contains(archivioCorrente + query)) {
modifyAutherBean.addArrModifyAutherBean(autherBean);
listCtrlModAuther.add(archivioCorrente + query);
}
}
}
}
}
modifyAutherBean.setDispatchView(jspDispatchMenu);
} else if (!codeToFind.equals("") && makeAction.equals("true")) {
System.out.println("ModifyAuther.execute() - SONO IN MODIFICA AUTH 1");
Map<String, List<ElementToFindBean>> hashDbToFind = buildElementToFindBean.buildElementToFindBean(theXMLconf, workFlowBean.getAlias());
int modificatiTotali = 0;
int erroriTotali = 0;
int modificatiXPathToChange = 0;
for (Entry<String, List<ElementToFindBean>> entrySet : hashDbToFind.entrySet()) {
System.out.println("ModifyAuther.execute() - SONO IN MODIFICA AUTH 2");
try {
String dbToFind = entrySet.getKey();
List<ElementToFindBean> arrElmToFind = hashDbToFind.get(dbToFind);
// Enumeration elementi = myRequest.getHttpServletRequest().getParameterNames();
boolean processArch = false;
System.out.println("ModifyAuther.execute() - SONO IN MODIFICA AUTH 3");
// while (elementi.hasMoreElements()) {
for (Entry<String, String[]> entry : parameterMap.entrySet()) {
String nome = entry.getKey();
if (nome.indexOf("theArchiveToProcess_") != -1) {
String tmpArch = MyRequest.getParameter(nome, parameterMap);
if (tmpArch.indexOf(dbToFind) != -1) {
// out.println(theArch+"vado a processare i record <br>");
processArch = true;
break;
}
}
}
System.out.println("ModifyAuther.execute() - SONO IN MODIFICA AUTH 3 processArch " + processArch);
if (processArch) {
if(userBean.getArchivesMap().get(dbToFind)==null){
continue;
}
Archive archiveBean = userBean.getArchivesMap().get(dbToFind);
System.out.println("ModifyAuther.execute() - SONO IN MODIFICA AUTH 4 archiviBean " + archiveBean);
String descrArchive = archiveBean.getArchiveDescr();
System.out.println("ModifyAuther.execute() - SONO IN MODIFICA AUTH 5 descrArchive " + descrArchive);
for (int z = 0; z < arrElmToFind.size(); z++) {