Package org.xdams.workflow.bean

Examples of org.xdams.workflow.bean.WorkFlowBean


    try {
      // ManagingBean esiste in sessione ma io uso uno nuovo per le funzioni di gestione
      managingBean = new ManagingBean();
      UserBean userBean = (UserBean) modelMap.get("userBean");
      confBean = (ConfBean) modelMap.get("confBean");
      WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
      httpSession = workFlowBean.getRequest().getSession(false);
      managingBean.setSelid(selid);
      MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
      // prendo i riferimenti al record
      if (!physDoc.equals("") && makeAction.equals("")) {
        xwconn = connectionManager.getConnection(workFlowBean.getArchive());
        managingBean.setPhysDoc(Integer.parseInt(physDoc));
        editingManager.setTheXML(new XMLBuilder(xwconn.getSingleXMLFromNumDoc(managingBean.getPhysDoc()), "ISO-8859-1"));
        confBean = editingManager.rewriteMultipleConf(confControl);
        managingBean.setDocLowerBrother(xwconn.getNumDocNextBrother(managingBean.getPhysDoc()));
        managingBean.setDocUpperBrother(xwconn.getNumDocPreviousBrother(managingBean.getPhysDoc()));

        it.highwaytech.db.QueryResult qrHier = xwconn.getQRFromHier(managingBean.getPhysDoc(), true);
        managingBean.setNumElementiHier(qrHier.elements);

        if (!selid.equals("")) {
          it.highwaytech.db.QueryResult qr = xwconn.getQRFromSelId(selid);
          managingBean.setNumElementi(qr.elements);
        }

        managingBean.setTitle((xwconn.getTitle(xwconn.connection, xwconn.getTheDb(), managingBean.getPhysDoc())).getTitle());
        managingBean.setDispatchView("eraseMenu");
        if (httpSession.getAttribute(workFlowBean.getManagingBeanName()) != null) {
          ArrayList listDocs = ((ManagingBean) httpSession.getAttribute(workFlowBean.getManagingBeanName())).getListPhysDoc();
          if (listDocs != null && listDocs.size() > 0) {
            managingBean.setListPhysDoc(listDocs);
          }
        }

      } else if (!physDoc.equals("") && makeAction.equals("true")) { // DO
        xwconn = connectionManager.getConnection(workFlowBean.getArchive());
        managingBean.setPhysDoc(Integer.parseInt(physDoc));
        editingManager.setTheXML(new XMLBuilder(xwconn.getSingleXMLFromNumDoc(managingBean.getPhysDoc()), "ISO-8859-1"));
        confBean = editingManager.rewriteMultipleConf(confControl);
        ArrayList elementiNum = new ArrayList();
        if (applyTo.equals("selected") || applyTo.equals("prevSibling") || applyTo.equals("nextSibling")) {
          if (applyTo.equals("nextSibling")) {
            int theBrother = managingBean.getPhysDoc();
            while (theBrother > 0) {
              theBrother = xwconn.getNumDocNextBrother(theBrother);
              if (theBrother > 0) {
                elementiNum.add(new Integer(theBrother));
              }
            }
          } else if (applyTo.equals("prevSibling")) {
            int theBrother = managingBean.getPhysDoc();
            while (theBrother > 0) {
              theBrother = xwconn.getNumDocPreviousBrother(theBrother);
              if (theBrother > 0) {
                elementiNum.add(new Integer(theBrother));
              }
            }
          } else {// DA SELEZIONE MULTIPLA
            elementiNum = ((ManagingBean) httpSession.getAttribute(workFlowBean.getManagingBeanName())).getListPhysDoc();
          }

        } else {
          it.highwaytech.db.QueryResult qr = null;
          if (applyTo.equals("selid")) {
            qr = xwconn.getQRFromSelId(selid);
            for (int z = 0; z < qr.elements; z++) {
              int theNumber = xwconn.getNumDocFromQRElement(qr, z);
              elementiNum.add(new Integer(theNumber));
            }
          } else if (applyTo.equals("hier") || applyTo.equals("hierfalse")) {
            boolean includeFather = true;
            if (applyTo.equals("hierfalse")) {
              includeFather = false;
            }
            qr = xwconn.getQRFromHier(managingBean.getPhysDoc(), includeFather);
            managingBean.setNumElementi(qr.elements);
            xwconn.deleteHier(managingBean.getPhysDoc());
            managingBean.setDocSuccessi(-100);
            managingBean.setDocErrori(-100);
          }

        }
        if (!applyTo.equals("hier") && !applyTo.equals("hierfalse")) {
          for (int i = 0; i < elementiNum.size(); i++) {
            QueryResult qrTemp = null;
            try {
              qrTemp = xwconn.getQRFromHier(((Integer) elementiNum.get(i)).intValue(), false);
            } catch (Exception e) {
              qrTemp = xwconn.getQRFromHier(Integer.parseInt((String) elementiNum.get(i)), false);
            }
            if (qrTemp != null && qrTemp.elements > 0) {
              for (int z = 0; z < qrTemp.elements; z++) {
                int theNumber = xwconn.getNumDocFromQRElement(qrTemp, z);
                elementiNum.add(new Integer(theNumber));
              }
            }
          }
          managingBean.setNumElementi(elementiNum.size());
          int totElementi = elementiNum.size();
          int processati = 0;
          int errori = 0;

          for (int i = 0; i < totElementi; i++) {
            int docCorrente = 0;
            try {
              docCorrente = ((Integer) elementiNum.get(i)).intValue();
            } catch (Exception e) {
              docCorrente = (Integer.parseInt((String) elementiNum.get(i)));
            }
            try {
              xwconn.delete(docCorrente);
              processati++;
            } catch (Exception e) {
              managingBean.addErrorMsg(e.getMessage());
              errori++;
            }
          }
          managingBean.setDocSuccessi(processati);
          managingBean.setDocErrori(errori);
        }
        managingBean.setTitle("");
        managingBean.setDispatchView("eraseResult");
        if (httpSession.getAttribute(workFlowBean.getManagingBeanName()) != null) {
          ManagingBean sessionMenaging = (ManagingBean) httpSession.getAttribute(workFlowBean.getManagingBeanName());
          sessionMenaging.setListPhysDoc(new ArrayList()); // SVUOTO GLI ELEMENTI SELEZIONATI
          httpSession.setAttribute(workFlowBean.getManagingBeanName(), sessionMenaging);
        }
      }
//      aReq.setAttribute("confBean", confBean);
//      aReq.setAttribute("userBean", userBean);
//      aReq.setAttribute("managingBean", managingBean);
View Full Code Here


    ConfBean confBean = null;
    AjaxBean ajaxBean = new AjaxBean();
    String laChiave = MyRequest.getParameter("key", req.getParameterMap());
    String ilValore = MyRequest.getParameter("value", req.getParameterMap());
    String filterQuery = MyRequest.getParameter("filterQuery", req.getParameterMap());
    WorkFlowBean workFlowBean = null;
    // System.out.println("AjaxCommandVocabolarioJson.execute() !!!" + ilValore+"!!!");
    // System.out.println("AjaxCommandVocabolarioJson.execute() " + ilValore);
    // System.out.println("AjaxCommandVocabolarioJson.execute() " + ilValore);
    // System.out.println("AjaxCommandVocabolarioJson.execute() " + ilValore);
    if (ilValore.trim().startsWith("\" ") && ilValore.trim().length() > 2) {
      ilValore = ilValore.substring(2, ilValore.length() - 1);
    }

    if (ilValore.trim().equals("") || ilValore.equals("*")) {
      ilValore = MyRequest.getParameter("attrFirstIdx", req.getParameterMap());
    }

    int numKeys = 10;
    try {
      numKeys = Integer.parseInt(MyRequest.getParameter("numKeys", req.getParameterMap()));
    } catch (Exception e) {
      // TODO: handle exception
    }
    boolean isQuery = false;

    String laTipologia = MyRequest.getParameter("typology", req.getParameterMap());
    String common = "";
    laChiave = laChiave.replaceAll("\\[", "").replaceAll("\\]", "");
    java.util.Vector result = null;
    byte ilByte = it.highwaytech.broker.ServerCommand.btree_FREQUENZE;
    byte ilByteVerso = it.highwaytech.broker.ServerCommand.btree_NEXTKEY;
    String verso = "up";

    boolean reverseMode = false;
    String valori = "";

    if (laTipologia.startsWith("double")) {
      common = " ";
    }
    if (laTipologia.startsWith("doubleQuery")) {
      isQuery = true;
    }

    if (laTipologia.indexOf("Reverse") > -1) {
      ilByteVerso = it.highwaytech.broker.ServerCommand.btree_PREVKEY;
      reverseMode = true;
      verso = "down";
    }

    try {
      workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
      xwconn = connectionManager.getConnection(workFlowBean.getArchive());
      if (!filterQuery.equals("")) {
        filterQuery = URLDecoder.decode(filterQuery, "ISO-8859-1");
        QueryResult qr = xwconn.getQRfromPhrase(filterQuery);
        xwconn.setCurrentSet(qr);
        ilByte |= it.highwaytech.broker.ServerCommand.btree_SPETTRALE;
        // result = xwconn.getSingleKeys(laChiave, qr.elements, verso, common + ilValore, 1, qr.elements, "", "frequenze|spettrale");
        result = xwconn.getIdxKeys(xwconn.connection, workFlowBean.getAlias(), "TABELLA", laChiave, common + ilValore, common, numKeys, ilByteVerso, ilByte, 1, 99999999, null);
      } else {
        result = xwconn.getIdxKeys(xwconn.connection, workFlowBean.getAlias(), "TABELLA", laChiave, common + ilValore, common, numKeys, ilByteVerso, ilByte, 1, 99999999, null);

      }
      if (result != null && result.size() > 0) {
        for (int i = 0; i < result.size(); i++) {

View Full Code Here

    confControl.add("titleManager");
    String physDoc = MyRequest.getParameter("physDoc", parameterMap);
    try {
      UserBean userBean = (UserBean) modelMap.get("userBean");
      confBean = (ConfBean) modelMap.get("confBean");
      WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
      preInsertBean = new PreInsertBean();
      // serve quando sono in preinsert dalla lookup
      if(modelMap.containsAttribute("srcArchive")){
        preInsertBean.setSrcArchive((String)modelMap.get("srcArchive"));
      }
      xwconn = connectionManager.getConnection(workFlowBean.getArchive());
      // Mi carico il file selezionato per l'inserimento se il physDoc e diverso da null
      if (!physDoc.equals("")) {
        // System.out.println("PreInsertPageCommand.execute() INIZIO CARICAMENTO DOCUMENTO SELEZIONATO");
        preInsertBean.setPhysDocSelected(Integer.parseInt(physDoc));
        String docXML = xwconn.getSingleXMLFromNumDoc(preInsertBean.getPhysDocSelected());
        preInsertBean.setDocXmlSelected(docXML);
        HierPath hierPath = xwconn.getHierPath(Integer.parseInt(physDoc));
        XMLBuilder theXMLDoc = new XMLBuilder(preInsertBean.getDocXmlSelected(), "ISO-8859-1");
        preInsertBean.setXmlBuilderSelected(theXMLDoc);
        preInsertBean.setDepthSelected(hierPath.depth());
        preInsertBean.setTitleSelected((xwconn.getTitle(xwconn.connection, xwconn.getTheDb(), Integer.parseInt(physDoc))).getTitle());
        MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
        editingManager.setTheXML(theXMLDoc);
        confBean = editingManager.rewriteMultipleConf(confControl);
        // System.out.println("PreInsertPageCommand.execute() FINE CARICAMENTO DOCUMENTO SELEZIONATO");
        // prendo il documento padre ma controllo che non sono il padre stesso...
        String ilPath = "/hierValues";
        preInsertBean.setXPathHierValues(ilPath);
        // System.out.println("aaaaaaaaaa " + "/" + ilPath + "/macroarea");
        int numeroMacroarea = (confBean.getTheXMLConfEditing()).contaNodi("/" + ilPath + "/macroarea");
        // System.out.println("numeroMacroarea " + numeroMacroarea);
        if (numeroMacroarea > 0) {
          int iLivelli = Integer.parseInt((confBean.getTheXMLConfEditing()).valoreNodo("/" + ilPath + "/@level"));
          int docFather = Integer.parseInt(physDoc);
          if (iLivelli > 0) {
            for (int i = 0; i < iLivelli; i++) {
              if (xwconn.getNumDocFather(docFather) > 0) {
                docFather = xwconn.getNumDocFather(docFather);
              }
            }
          }
          // System.out.println("PreInsertPageCommand.execute() INIZIO CARICAMENTO DOCUMENTO PADRE");
          preInsertBean.setPhysDocFather(docFather);
          docXML = xwconn.getSingleXMLFromNumDoc(preInsertBean.getPhysDocFather());
          preInsertBean.setDocXmlFather(docXML);
          theXMLDoc = new XMLBuilder(preInsertBean.getDocXmlFather(), "ISO-8859-1");
          preInsertBean.setXmlBuilderFather(theXMLDoc);
          preInsertBean.setDepthFather(hierPath.depth() - 1);
          preInsertBean.setTitleFather((xwconn.getTitle(xwconn.connection, xwconn.getTheDb(), preInsertBean.getPhysDocFather())).getTitle());
          // System.out.println("PreInsertPageCommand.execute() FINE CARICAMENTO DOCUMENTO PADRE");

        }

        // prendo il documento root dell'archivio quello con detph==1
        if ((hierPath.depth()) - (hierPath.depth() - 1) == 1) {
          // System.out.println("PreInsertPageCommand.execute() INIZIO CARICAMENTO DOCUMENTO ROOT");
          preInsertBean.setPhysDocRoot(hierPath.docNumber(1));
          docXML = xwconn.getSingleXMLFromNumDoc(preInsertBean.getPhysDocRoot());
          preInsertBean.setDocXmlRoot(docXML);
          theXMLDoc = new XMLBuilder(preInsertBean.getDocXmlRoot(), "ISO-8859-1");
          preInsertBean.setXmlBuilderRoot(theXMLDoc);
          preInsertBean.setDepthRoot(1);
          preInsertBean.setTitleRoot((xwconn.getTitle(xwconn.connection, xwconn.getTheDb(), preInsertBean.getPhysDocRoot())).getTitle());
          // System.out.println("PreInsertPageCommand.execute() FINE CARICAMENTO DOCUMENTO ROOT");
        }

      } else {
        // in caso di nuovo documento senza il phisDoc, come ad esempio un inserimento da lookup
        MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
        XMLBuilder builder = new XMLBuilder("root");
        editingManager.setTheXML(builder);
        confBean = editingManager.rewriteMultipleConf(confControl);
        preInsertBean.setXmlBuilderSelected(builder);
        preInsertBean.setXmlBuilderFather(builder);
      }
      // TODO DA VALUTARE introdotto per adv-editing
      preInsertBean.setXmlBuilderEmpty(new XMLBuilder(workFlowBean.getAlias()));

      modelMap.put("confBean", confBean);
      modelMap.put("preInsertBean", preInsertBean);

    } catch (Exception e) {
View Full Code Here

    HttpSession httpSession = null;
    ManagingBean managingBean = null;
    String valori = "";
    try {
      UserBean userBean = (UserBean) modelMap.get("userBean");
      WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
      httpSession = workFlowBean.getRequest().getSession(false);
      if (httpSession.getAttribute(workFlowBean.getManagingBeanName()) == null) {
        managingBean = new ManagingBean();
        if (aReq.getParameter("physDoc") != null) {
          managingBean.addListPhysDoc(aReq.getParameter("physDoc"));
        }
        httpSession.setAttribute(workFlowBean.getManagingBeanName(), managingBean);
      } else {
        managingBean = (ManagingBean) httpSession.getAttribute(workFlowBean.getManagingBeanName());
        if (aReq.getParameter("action") != null && aReq.getParameter("action").equals("addElement")) {
          if (!(managingBean.getListPhysDoc()).contains(aReq.getParameter("physDoc"))) {
            managingBean.addListPhysDoc(aReq.getParameter("physDoc"));
          }
        } else if (aReq.getParameter("action") != null && aReq.getParameter("action").equals("removeElement")) {
          if ((managingBean.getListPhysDoc()).contains(aReq.getParameter("physDoc"))) {
            managingBean.removePhysDoc(aReq.getParameter("physDoc"));
          }
        }
        System.out.println("AjaxSessionCommand.execute()" + aReq.getParameter("action"));
        System.out.println("AjaxSessionCommand.execute()" + managingBean.getMultipleChoise() + " managingBean.getMultipleChoise()");
        if (aReq.getParameter("action").equals("switch")) {
          System.out.println("AjaxSessionCommand.execute()1" + aReq.getParameter("action"));
          System.out.println("AjaxSessionCommand.execute()2" + managingBean.getMultipleChoise() + " managingBean.getMultipleChoise()");
          if ((managingBean.getMultipleChoise()).equals("")) {
            managingBean.setMultipleChoise("none");
          } else {
            managingBean.setMultipleChoise("");
          }
          if (aReq.getParameter("svuota") != null && aReq.getParameter("svuota").equals("ok")) {
            managingBean.setListPhysDoc(new ArrayList());
          }
        }
        httpSession.setAttribute(workFlowBean.getManagingBeanName(), managingBean);
      }
      Enumeration enumeration = httpSession.getAttributeNames();
      while (enumeration.hasMoreElements()) {
        String element = (String) enumeration.nextElement();
        valori += "<sessionDoc><text>" + element + "</text><value>" + httpSession.getAttribute(element) + "</value></sessionDoc>\n";
View Full Code Here

    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) {
View Full Code Here

    ConnectionManager connectionManager = new ConnectionManager();
    BuildElementToFindBean buildElementToFindBean = new BuildElementToFindBean();
    ConfBean confBean = null;
    ModifyAutherBean modifyAutherBean = new ModifyAutherBean();
    WorkFlowBean workFlowBean = null;
    // 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");
View Full Code Here

    ManagingBean managingBean = null;
    String valori = "";
    ConnectionManager connectionManager = new ConnectionManager();
    XWConnection xwconn = null;
    ConfBean confBean = null;
    WorkFlowBean workFlowBean = null;
    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");
      httpSession = workFlowBean.getRequest().getSession(false);
      if (httpSession.getAttribute(workFlowBean.getManagingBeanName()) == null) {
        managingBean = new ManagingBean();
        managingBean.setMultipleChoise("none");
      } else {
        managingBean = (ManagingBean) httpSession.getAttribute(workFlowBean.getManagingBeanName());
      }

      xwconn = connectionManager.getConnection(workFlowBean.getArchive());
      MultiEditingManager editingManager = new MultiEditingManager(req.getParameterMap(), confBean, userBean, workFlowBean);
      editingManager.setTheXML(new XMLBuilder(xwconn.getSingleXMLFromNumDoc(Integer.parseInt(physDoc)), "ISO-8859-1"));
      confBean = editingManager.rewriteMultipleConf(confControl);

      if (actionType.equals("cut") || actionType.equals("paste") || actionType.equals("no_rel") || actionType.equals("only_hier")) {
        TitleManager titleManager = new TitleManager(confBean.getTheXMLConfTitle());
      //  System.out.println("AjaxCutPasteCopyCommand.execute() getTheXMLConfTitle " + confBean.getTheXMLConfTitle().getXML("ISO-8859-1"));
        try {
          managingBean.setCutPhysDoc(Integer.parseInt(physDoc));
          String titoloDoc = xwconn.getTitleFromNumDoc(Integer.parseInt(physDoc));
          System.out.println("AjaxCutPasteCopyCommand.execute() titoloDoc " + titoloDoc);
          managingBean.setCutTitle(titoloDoc);
        } catch (Exception e) {
          e.printStackTrace();
        }
        String azioneDescr = "";
        if (actionType.equals("cut")) {
          azioneDescr = "tagliato";
        } else if (actionType.equals("paste")) {
          azioneDescr = "copiato";
        } else if (actionType.equals("no_rel")) {
          azioneDescr = "copiato";
        } else if (actionType.equals("only_hier")) {
          azioneDescr = "copiato";
        }

        String contenitoreIni = "\n<div class=\"cont_ul2\"><ul class=\"bottoniMenu\">";
        String string0 = "";
        String string1 = "";
        String string2 = "";
        if (!actionType.equals("no_rel")) {
          string0 = "<li><a href=\"#\" target=\"\" onclick=\"ajaxSetSessionDocsToCut('" + managingBean.getCutPhysDoc() + "','@@physDocToPaste@@','" + actionType + "_as_son','" + workFlowBean.getAlias() + "');\" >INC.FIGLIO</a></li>";
          string1 = "<li><a href=\"#\" target=\"\" onclick=\"ajaxSetSessionDocsToCut('" + managingBean.getCutPhysDoc() + "','@@physDocToPaste@@','" + actionType + "_as_before','" + workFlowBean.getAlias() + "');\" >INC.PRIMA</a></li>";
          string2 = "<li><a href=\"#\" target=\"\" onclick=\"ajaxSetSessionDocsToCut('" + managingBean.getCutPhysDoc() + "','@@physDocToPaste@@','" + actionType + "_as_after','" + workFlowBean.getAlias() + "');\" >INC.DOPO</a></li>";
        }

        String string3 = "";
        // if(actionType.equals("paste") || actionType.equals("no_rel")){
        if (actionType.equals("no_rel")) {
          actionType = "paste";
          string3 = "<li><a href=\"#\" target=\"\" onclick=\"ajaxSetSessionDocsToCut('" + managingBean.getCutPhysDoc() + "','@@physDocToPaste@@','" + actionType + "_as_norel','" + workFlowBean.getAlias() + "');\" >NO REL</a></li>";
        }

        String string4 = "<li><a href=\"#\" target=\"\" onclick=\"ajaxSetSessionDocsToCut('" + managingBean.getCutPhysDoc() + "','@@physDocToPaste@@','" + actionType + "_delete','" + workFlowBean.getAlias() + "');\" >ANNULLA</a></li>";
        String contenitoreEnd = "</ul></div><div class=\"cutPasteClazz\">elemento " + azioneDescr + " " + (titleManager.defaultParsedTitle(managingBean.getCutTitle(), "hierTitle")) + "</div>";
        String string = contenitoreIni + string0 + string1 + string2 + string3 + string4 + contenitoreEnd;
        ajaxBean.setStrXmlOutput(string);
        managingBean.setCutHtmlOutput(string);
        // managingBean.setCutHtmlOutput(managingBean.getCutHtmlOutput(String.valueOf(managingBean.getCutPhysDoc())));
      }

      boolean cutTest = true;
      boolean pasteTest = true;
      try {
        if (actionType.startsWith("cut_as")) {
          HierPath hierPath = xwconn.getHierPath(Integer.parseInt(physDocToPaste));
          int numeroLivelli = hierPath.depth();
          for (int i = 1; i < numeroLivelli; i++) {
            int theFatherTemp = hierPath.docNumber(i);
            if (theFatherTemp == Integer.parseInt(physDoc) || Integer.parseInt(physDoc) == Integer.parseInt(physDocToPaste)) {
              cutTest = false;
              break;
            }
          }
        }
      } catch (Exception e) {
        cutTest = false;
      }

      if (!cutTest) {
        ajaxBean.setStrXmlOutput("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<error>" + StringEscapeUtils.escapeXml("Attenzione:\nNon e possibile effettuare l'operazione richiesta") + "</error>");
      }

      if (actionType.equals("cut_as_son")) {
        // elemento da tagliare physDoc
        if (cutTest) {
          xwconn.cut_paste(Integer.parseInt(physDoc), Integer.parseInt(physDocToPaste), it.highwaytech.broker.ServerCommand.navigarel_FIGLIOPADRE);
          ajaxBean.setStrXmlOutput("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<succes>reloadLocation()</succes>");
        }
        // elemento in cui spostare il documento tagliato physDocToPaste
      } else if (actionType.equals("cut_as_before")) {
        // elemento da tagliare physDoc
        if (cutTest) {
          xwconn.cut_paste(Integer.parseInt(physDoc), Integer.parseInt(physDocToPaste), it.highwaytech.broker.ServerCommand.navigarel_MINOREMAGGIORE);
          ajaxBean.setStrXmlOutput("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<succes>reloadLocation()</succes>");
        }
        // elemento in cui spostare il documento tagliato physDocToPaste
      } else if (actionType.equals("cut_as_after")) {
        // elemento da tagliare physDoc
        if (cutTest) {
          xwconn.cut_paste(Integer.parseInt(physDoc), Integer.parseInt(physDocToPaste), it.highwaytech.broker.ServerCommand.navigarel_MAGGIOREMINORE);
          ajaxBean.setStrXmlOutput("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<succes>reloadLocation()</succes>");
        }
        // elemento in cui spostare il documento tagliato physDocToPaste
      } else if (actionType.equals("cut_delete")) {
        managingBean.setCutTitle("");
        managingBean.setCutHtmlOutput("<div id=\"scriviQui\"></div>");
        ajaxBean.setStrXmlOutput("<div id=\"scriviQui\"></div>");
        managingBean.setCutPhysDoc(-1);
      } else if (actionType.equals("paste_as_son")) {
        // elemento da tagliare physDoc
        String xmlDoc = xwconn.getSingleXMLFromNumDoc(Integer.parseInt(physDoc));
        String newXML = XMLCopy.xmlCopy(confBean.getTheXMLConfEditing(), new XMLBuilder(xmlDoc, "ISO-8859-1"), userBean);
        int recordNum = xwconn.insert(newXML);
        int toPaste = -1;
        try {
          toPaste = Integer.parseInt(physDocToPaste);
        } catch (Exception e) {
          toPaste = Integer.parseInt(physDoc);
        }
        System.out.println("AjaxCutPasteCopyCommand.execute() " + newXML);
        int esitoAzione = xwconn.docRelInsert(xwconn.connection, xwconn.getTheDb(), it.highwaytech.broker.ServerCommand.navigarel_FIGLIOPADRE, recordNum, toPaste);
        ajaxBean.setStrXmlOutput("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<succes>reloadLocation()</succes>");
        // elemento in cui spostare il documento tagliato physDocToPaste
      } else if (actionType.equals("paste_as_before")) {
        // elemento da tagliare physDoc
        String xmlDoc = xwconn.getSingleXMLFromNumDoc(Integer.parseInt(physDoc));
        String newXML = XMLCopy.xmlCopy(confBean.getTheXMLConfEditing(), new XMLBuilder(xmlDoc, "ISO-8859-1"), userBean);
        int recordNum = xwconn.insert(newXML);
        int toPaste = -1;
        try {
          toPaste = Integer.parseInt(physDocToPaste);
        } catch (Exception e) {
          toPaste = Integer.parseInt(physDoc);
        }
        int esitoAzione = xwconn.docRelInsert(xwconn.connection, xwconn.getTheDb(), it.highwaytech.broker.ServerCommand.navigarel_MINOREMAGGIORE, recordNum, toPaste);
        ajaxBean.setStrXmlOutput("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<succes>reloadLocation()</succes>");
        // elemento in cui spostare il documento tagliato physDocToPaste
      } else if (actionType.equals("paste_as_after")) {
        // elemento da tagliare physDoc
        String xmlDoc = xwconn.getSingleXMLFromNumDoc(Integer.parseInt(physDoc));
        String newXML = XMLCopy.xmlCopy(confBean.getTheXMLConfEditing(), new XMLBuilder(xmlDoc, "ISO-8859-1"), userBean);
        int recordNum = xwconn.insert(newXML);
        int toPaste = -1;
        try {
          toPaste = Integer.parseInt(physDocToPaste);
        } catch (Exception e) {
          toPaste = Integer.parseInt(physDoc);
        }
        System.out.println("AjaxCutPasteCopyCommand.execute() " + newXML);
        int esitoAzione = xwconn.docRelInsert(xwconn.connection, xwconn.getTheDb(), it.highwaytech.broker.ServerCommand.navigarel_MAGGIOREMINORE, recordNum, toPaste);
        ajaxBean.setStrXmlOutput("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<succes>reloadLocation()</succes>");
        // elemento in cui spostare il documento tagliato physDocToPaste
      } else if (actionType.equals("paste_as_norel")) {
        // elemento da tagliare physDoc
        String xmlDoc = xwconn.getSingleXMLFromNumDoc(Integer.parseInt(physDoc));
        String newXML = XMLCopy.xmlCopy(confBean.getTheXMLConfEditing(), new XMLBuilder(xmlDoc, "ISO-8859-1"), userBean);
        int recordNum = xwconn.insert(newXML);
        /*
         * int toPaste = -1; try { toPaste = Integer.parseInt(physDocToPaste); } catch (Exception e) { toPaste = Integer.parseInt(physDoc); } System.out.println("AjaxCutPasteCopyCommand.execute() " + newXML); int esitoAzione = xwconn.docRelInsert(xwconn.connection, xwconn.getTheDb(),
         * it.highwaytech.broker.ServerCommand.navigarel_MAGGIOREMINORE, recordNum, toPaste);
         */
        ajaxBean.setStrXmlOutput("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<succes>reloadLocation()</succes>");
        // elemento in cui spostare il documento tagliato physDocToPaste
      } else if (actionType.equals("paste_delete")) {
        managingBean.setCutTitle("");
        managingBean.setCutHtmlOutput("<div id=\"scriviQui\"></div>");
        ajaxBean.setStrXmlOutput("<div id=\"scriviQui\"></div>");
        managingBean.setCutPhysDoc(-1);
      }

    } catch (Exception e) {
      e.printStackTrace();
      ajaxBean.setStrXmlOutput("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<error>" + StringEscapeUtils.escapeXml("Attenzione:\nimpossibile effettuare l'operazione, il documento selezionato potrebbe non essere pi� in gerarchia") + "\n" + e.getMessage() + "</error>");
    } finally {
      httpSession.setAttribute(workFlowBean.getManagingBeanName(), managingBean);
      connectionManager.closeConnection(xwconn);
    }

    // ajaxBean.setStrXmlOutput("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<?xml-stylesheet type=\"text/xsl\" href=\"http://localhost:8080//xdams-front/REGEXE/xslt/prova.xslt\"?>\n" + "<sessionList>\n" + valori + "</sessionList>");
    return ajaxBean;
View Full Code Here

    Vector<Key> result = new Vector<Key>();
    System.out.println("Vocabulary.execute() parameterMap\n " + parameterMap);
    System.out.println("Vocabulary.execute() searchAlias\n " + parameterMap.get("searchAlias")[0]);
    String searchAlias = parameterMap.get("searchAlias")[0];
    System.out.println("searchAlias: " + searchAlias);
    WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
    System.out.println(workFlowBean);
    String name = "";
    try {
      if (parameterMap.get("name") != null) {
        name = parameterMap.get("name")[0];
        System.out.println("name VALUE IS: " + name);
      }
    } catch (Exception e) {
    }

    String startParam = "";
    try {
      if (parameterMap.get("startParam") != null) {
        startParam = parameterMap.get("startParam")[0];
        System.out.println("startParam: " + startParam);
      }
    } catch (Exception e) {
    }

    String orientation = "up";
    try {
      if (parameterMap.get("orientation") != null) {
        orientation = parameterMap.get("orientation")[0];
        System.out.println("orientation: " + orientation);
      }
    } catch (Exception e) {
    }
    int totResult = 3;
    try {
      if (parameterMap.get("totResult") != null) {
        totResult = Integer.parseInt(parameterMap.get("totResult")[0]);
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
    System.out.println("numero risultati per pagina: " + totResult);

    try {
      xwconn = connectionManager.getConnection(workFlowBean.getArchive());
      result = xwconn.getSingleKeys(searchAlias, totResult, orientation, startParam);
    } catch (Exception e) {
      throw e;
    } finally {
      modelMap.put("resultVoc", result);
View Full Code Here

    confControl.add("titleManager");
    confControl.add("query");
    try {
      UserBean userBean = (UserBean) modelMap.get("userBean");
      confBean = (ConfBean) modelMap.get("confBean");
      WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
      treeBean = new TreeBean();
      MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
      editingManager.setTheXML(new XMLBuilder("root"));
      confBean = editingManager.rewriteMultipleConf(confControl);
      xwconn = connectionManager.getConnection(workFlowBean.getArchive());
      if (MyRequest.getParameter("docStart", parameterMap) != null && !MyRequest.getParameter("docStart", parameterMap).equals("")) {
        treeBean.setDocStart(Integer.parseInt(MyRequest.getParameter("docStart", parameterMap)));
        String docXML = xwconn.getSingleXMLFromNumDoc(treeBean.getDocStart());
        editingManager.setTheXML(new XMLBuilder(docXML, "ISO-8859-1"));
        confBean = editingManager.rewriteMultipleConf(confControl);
View Full Code Here

    // aReq.getParameter("nameFileXml");
    String xpath = MyRequest.getParameter("xpath", req.getParameterMap());// aReq.getParameter("xpath");
    // System.err.println("aaaaaaaaaaaaaaaaaaaaaaa xpath " + xpath);
    // System.err.println("aaaaaaaaaaaaaaaaaaaaaaa nameFileXml " + nameFileXml);
    ConfBean confBean = null;
    WorkFlowBean workFlowBean = null;
    ConnectionManager connectionManager = new ConnectionManager();
    XWConnection xwconn = null;
    List<String> confControl = new ArrayList<String>();
    confControl.add("query");
    try {
      UserBean userBean = (UserBean) modelMap.get("userBean");
      confBean = (ConfBean) modelMap.get("confBean");
      workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");

      xwconn = connectionManager.getConnection(workFlowBean.getArchive());
      MultiEditingManager editingManager = new MultiEditingManager(req.getParameterMap(), confBean, userBean, workFlowBean);
      editingManager.setTheXML(new XMLBuilder("root"));
      confBean = editingManager.rewriteMultipleConf(confControl);
      XMLBuilder xmlBuilder = confBean.getTheXMLConfQuery();
      String qlphrase = xmlBuilder.valoreNodo("/root/access_method/query[@ajaxCheck='notinhier']/text()");
      System.out.println("AjaxCommandNotInHier.execute() qlphrase " + qlphrase);
      if (!qlphrase.trim().equals("")) {
        int intDoc = Integer.parseInt(StringUtils.substringAfter(qlphrase.toLowerCase(), "notinhier:"));
        QueryResult queryResult = xwconn.getQRFromHier(intDoc, true);
        String query = " NOT ([?SEL]=" + queryResult.id + ") AND ([UD,/xw/@UdType/]=\"" + workFlowBean.getArchive().getPne() + "\")";
        queryResult = xwconn.getQRfromPhrase(query);
        if (queryResult.elements != 0) {
          ajaxBean.setStrXmlOutput("" + queryResult.elements);
        }
View Full Code Here

TOP

Related Classes of org.xdams.workflow.bean.WorkFlowBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.