Examples of WorkflowBean


Examples of org.xdams.workflow.bean.WorkFlowBean

      UserBean userBean = (UserBean) pageContext.findAttribute("userBean");

      ViewBean viewBean = (ViewBean) pageContext.findAttribute("viewBean");

      WorkFlowBean workFlowBean = (WorkFlowBean) pageContext.findAttribute("workFlowBean");

      JspWriter out = pageContext.getOut();
      if (targetServlet.equals("")) {
        targetServlet = "_top";
      }
      TitleManager titleManager = new TitleManager(confBean.getTheXMLConfTitle());
      int numeroLivelli = hierPath.depth();
      String divHierPath = "";
      if (getHierMode().equals("")) {
        for (int i = 0; i < numeroLivelli - 1; i++) {
          int spaziatore = 18 * (i - 1);
          int theFatherTemp = hierPath.docNumber(i + 1);
          divHierPath += "<div class=\"hierPath\">";
          divHierPath += "<a href=\"" + pageContext.findAttribute("contextPath") + "/hier/" + workFlowBean.getAlias() + "/hierBrowser.html?docToggle=" + theFatherTemp + "&amp;docStart=" + theFatherTemp + "\" target=\"" + targetServlet + "\">";
          String strTitoloManager = titleManager.defaultParsedTitle(hierPath.getTitle(i + 1), "hierTitle");
          divHierPath += strTitoloManager;
          divHierPath += "</a>";
        }
        for (int i = 0; i < numeroLivelli - 1; i++) {
View Full Code Here

Examples of org.xdams.workflow.bean.WorkFlowBean

    confControl.add("docEdit");
    try {
      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);

      xwconn = connectionManager.getConnection(workFlowBean.getArchive());
      MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
      editingManager.setTheXML(new XMLBuilder(xwconn.getSingleXMLFromNumDoc(Integer.parseInt(physDoc)), "ISO-8859-1"));
      confBean = editingManager.rewriteMultipleConf(confControl);
      if (httpSession.getAttribute(workFlowBean.getManagingBeanName()) != null) {
        managingBean = ((ManagingBean) httpSession.getAttribute(workFlowBean.getManagingBeanName()));
      } else {
        managingBean = new ManagingBean();
      }
      // mi serve per contare i successi e no
      managingBean.setDocSuccessi(0);
View Full Code Here

Examples of org.xdams.workflow.bean.WorkFlowBean

    confControl.add("docEdit");
    try {
      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);
      xwconn = connectionManager.getConnection(workFlowBean.getArchive());
      MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
      editingManager.setTheXML(new XMLBuilder(xwconn.getSingleXMLFromNumDoc(Integer.parseInt(physDoc)), "ISO-8859-1"));
      confBean = editingManager.rewriteMultipleConf(confControl);
      managingBean.setSelid(selid);
      if (!physDoc.equals("") && makeAction.equals("")) {
        managingBean.setPhysDoc(Integer.parseInt(physDoc));
        managingBean.setDocLowerBrother(xwconn.getNumDocNextBrother(managingBean.getPhysDoc()));
        managingBean.setDocUpperBrother(xwconn.getNumDocPreviousBrother(managingBean.getPhysDoc()));
        it.highwaytech.db.QueryResult qrSons = xwconn.getSonsFromNumDoc(managingBean.getPhysDoc());
        managingBean.setNumElementiSons(qrSons.elements);
        it.highwaytech.db.QueryResult qrHier = xwconn.getQRFromHier(managingBean.getPhysDoc(), false);
        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.setDocXML(xwconn.getSingleXMLFromNumDoc(managingBean.getPhysDoc()));
        managingBean.setDispatchView("multiModMenu");
        if (httpSession.getAttribute(workFlowBean.getManagingBeanName()) != null) {
          ArrayList listDocs = ((ManagingBean) httpSession.getAttribute(workFlowBean.getManagingBeanName())).getListPhysDoc();
          if (listDocs != null && listDocs.size() > 0) {
            managingBean.setListPhysDoc(listDocs);
          }
        }
View Full Code Here

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);
      xwconn = connectionManager.getConnection(workFlowBean.getArchive());
      XMLBuilder theXMLDoc = null;
      if (!applyTo.equals("fromQuery")) {
        managingBean.setPhysDoc(Integer.parseInt(physDoc));
        String docXML = xwconn.getSingleXMLFromNumDoc(managingBean.getPhysDoc());
        managingBean.setDocXML(docXML);
        theXMLDoc = new XMLBuilder(managingBean.getDocXML(), "ISO-8859-1");
      } else {
        theXMLDoc = new XMLBuilder("root");
      }
      MultiEditingManager editingManager = new MultiEditingManager(parameterMap, confBean, userBean, workFlowBean);
      editingManager.setTheXML(theXMLDoc);
      confBean = editingManager.rewriteMultipleConf(confControl);
      XSLDir = findXSLPath(userBean, workFlowBean);
      if (XSLDir != null) {
        modelMap.put("XSLBeanArrayList", XSLLoader.loadXSL(XSLDir));
      } else {
        throw new Exception("Impostare pdfPrint.");
      }
      managingBean.setSelid(selid);
      // System.out.println("aaaaaaaaaaaaaaaaa 04");
      if (!physDoc.equals("") && makeAction.equals("")) {
        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);
        it.highwaytech.db.QueryResult qrSons = xwconn.getSonsFromNumDoc(managingBean.getPhysDoc());
        managingBean.setNumElementiSons(qrSons.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("pdfMenu");
        if (httpSession.getAttribute(workFlowBean.getManagingBeanName()) != null) {
          ArrayList listDocs = ((ManagingBean) httpSession.getAttribute(workFlowBean.getManagingBeanName())).getListPhysDoc();
          if (listDocs != null && listDocs.size() > 0) {
            managingBean.setListPhysDoc(listDocs);
          }
        }
        // System.out.println("aaaaaaaaaaaaaaaaa 05");
      } else if (!physDoc.equals("") && makeAction.equals("true")) { // DO
        String PDFPhrase = null;
        String PDFNdoc = null;
        ArrayList elementiNum = new ArrayList();
        if (applyTo.equals("selected") || applyTo.equals("prevSibling") || applyTo.equals("nextSibling") || applyTo.equals("this")) {
          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 if (applyTo.equals("this")) {
            elementiNum.add(new Integer(physDoc));
          } else {// DA SELEZIONE MULTIPLA
            elementiNum = ((ManagingBean) httpSession.getAttribute(workFlowBean.getManagingBeanName())).getListPhysDoc();
          }

          // System.out.println("aaaaaaaaaaaaaaaaa 07");
          if (elementiNum.size() > 0) {
            String idXpath = MyRequest.getParameter("idXpath", parameterMap);// "/c/@id";
            if (idXpath == null) {
              throw new Exception("Impostare idXpath");
            }
            xwconn.setTitleRole("XML," + idXpath);
            QueryResult qrTempTo = new QueryResult();
            for (int a = 0; a < elementiNum.size(); a++) {
              try {
                int docCorrente = 0;
                try {
                  docCorrente = ((Integer) elementiNum.get(a)).intValue();
                } catch (Exception e) {
                  docCorrente = (Integer.parseInt((String) elementiNum.get(a)));
                }
                String idValue = ((xwconn.getTitle(xwconn.connection, xwconn.getTheDb(), docCorrente)).getTitle()).trim();
                if (!idValue.equals("")) {
                  QueryResult qrTempFrom = xwconn.getQRfromPhrase("[XML," + idXpath + "]=\"" + idValue + "\"");
                  // System.out.println("xdams - [INFO]  :::::::: phrase " + "[XML," + idXpath + "]=\"" + idValue + "\"");
                  // System.out.println("qrTempFrom.elements: " + qrTempFrom.elements);
                  if (qrTempFrom.elements > 0) {
                    xwconn.addToQueryResult(qrTempTo, qrTempFrom);
                  }

                }

              } catch (Exception e) {
                e.printStackTrace();
              }
            }
            xwconn.restoreTitleRole();
            PDFType = "4";
            if (qrTempTo != null && qrTempTo.elements > 0)
              PDFPhrase = qrTempTo.id;
          }

        } else {
          // System.out.println("aaaaaaaaaaaaaaaaa 08");
          if (applyTo.equals("selid")) {
            PDFPhrase = (xwconn.getQRFromSelId(selid)).id;
            PDFType = "4";
          } else if (applyTo.equals("hier")) {
            PDFType = "3";
            PDFNdoc = MyRequest.getParameter("physDoc", parameterMap);
          } else if (applyTo.equals("single")) {
            PDFType = "1";
            PDFNdoc = MyRequest.getParameter("physDoc", parameterMap);
          } else if (applyTo.equals("sons")) {
            PDFType = "2";
            PDFNdoc = MyRequest.getParameter("physDoc", parameterMap);
          } else if (applyTo.equals("fromQuery")) {
            if (MyRequest.getParameter("fromQuery", parameterMap).trim().equals("")) {
              throw new Exception("Impostare fromQuery");
            }
            PDFPhrase = (xwconn.getQRfromPhrase(MyRequest.getParameter("fromQuery", parameterMap), MyRequest.getParameter("sortQuery", parameterMap))).id;
            PDFType = "4";
          }
        }

        // System.out.println("aaaaaaaaaaaaaaaaa 09");
        managingBean.setExportXML(executePDFPrint(workFlowBean, xwconn, PDFPhrase, PDFNdoc, PDFType, PDFXSLType));

        String headerPDF = MyRequest.getParameter("headerPDF", parameterMap).trim();
        String footerPDF = MyRequest.getParameter("footerPDF", parameterMap).trim();
        String subtitlePDF = MyRequest.getParameter("subtitlePDF", parameterMap).trim();
        if (!headerPDF.equals("") || !footerPDF.equals("") || !subtitlePDF.equals("")) {
          try {
            StringBuffer stringBuffer = new StringBuffer(managingBean.getExportXML());
            String stringInsert = "<pdfPrint>" + "<header></header>" + "<footer></footer>" + "<subtitle></subtitle>" + "</pdfPrint>";
            stringInsert = StringUtils.replace(stringInsert, "<header></header>", "<header>" + headerPDF + "</header>");
            stringInsert = StringUtils.replace(stringInsert, "<footer></footer>", "<footer>" + footerPDF + "</footer>");
            stringInsert = StringUtils.replace(stringInsert, "<subtitle></subtitle>", "<subtitle>" + subtitlePDF + "</subtitle>");
            // questo indexOf fa cagare
            stringBuffer.insert(managingBean.getExportXML().indexOf("\">") + 2, stringInsert);
            managingBean.setExportXML(stringBuffer.toString());
          } catch (Exception e) {
            e.printStackTrace();
          }

        }
        // System.out.println("aaaaaaaaaaaaaaaaa 10 "+managingBean.getExportXML());
        ManagingBean sessionMenaging = (ManagingBean) httpSession.getAttribute(workFlowBean.getManagingBeanName());
        System.out.println("aaaaaaaaaaaaaaaaa 11");
        // sessionMenaging.setListPhysDoc(new ArrayList()); // SVUOTO GLI ELEMENTI SELEZIONATI
        if (managingBean.getExportXML() != null && !(managingBean.getExportXML()).equals("")) { // STAMPO PDF
          // InputStream
          xsltInputStream = new FileInputStream(new File((XSLDir) + "/" + MyRequest.getParameter("PDFXSLType", parameterMap)));
View Full Code Here

Examples of org.xdams.workflow.bean.WorkFlowBean

  public void execute() throws Exception, SQLException {
    XWConnection xwconn = null;
    List<String> titleList = new ArrayList<String>();
    ConnectionManager connectionManager = new ConnectionManager();
     WorkFlowBean workFlowBean = null;
    Titles titlesPage = new Titles();
    LookupBean lookupBean = null;
    try {

       workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
      lookupBean = (LookupBean) modelMap.get("lookupBean");
      xwconn = connectionManager.getConnection(workFlowBean.getArchiveLookup());
      QueryResult qr = null;
      String startPage = "";
      String keyCountQuery = MyRequest.getParameter("inputPerPage", "10", parameterMap);
      System.out.println("keyCountQuery keyCountQuery " + keyCountQuery);
      System.out.println("ENTRATO QUI " + (String) modelMap.get("selId"));
      System.out.println("ENTRATO selId " + MyRequest.getParameter("selId", parameterMap));

      if (!(MyRequest.getParameter("selId", parameterMap).trim()).equals("")) {
        qr = xwconn.getQRFromSelId(MyRequest.getParameter("selId", parameterMap));
        System.out.println("Lookup.execute()1111" + qr);
      } else {
        // System.out.println("ENTRATO QUA " + getQrSelId());
        qr = find(xwconn, "singoloTermine", keyCountQuery, lookupBean);
        System.out.println("Lookup.execute()2222" + qr);
      }
      System.out.println("Lookup.execute() " + qr);
      if (!MyRequest.getParameter("flagXML", parameterMap).equals("true")) {
        if (!lookupBean.getInputTitleRule().trim().equals("")) {
          xwconn.setTitleRule(xwconn.connection, workFlowBean.getArchiveLookup().getAlias(), lookupBean.getInputTitleRule());
        }
        System.out.println("Lookup.execute()333333" + qr);
        int totElements = qr.elements;
        // setQrSelId(qr.id);
        // System.out.println("PIPPETTO " + qr.elements + " FINE");
        if (!MyRequest.getParameter("startPage", parameterMap).equals("")) {
          startPage = MyRequest.getParameter("startPage", parameterMap);
        }
        if (startPage.equals("")) {
          titlesPage.setPages(Integer.parseInt(keyCountQuery), totElements);
        } else {
          titlesPage.setPages(Integer.parseInt(keyCountQuery), totElements, Integer.parseInt(startPage));
        }
        int ilPrimo = titlesPage.getFirstElement() - 1;
        for (int x = 0; x < Integer.parseInt(keyCountQuery); x++) {
          if (x + ilPrimo < totElements) {
            Title titolo = xwconn.getTitle(xwconn.connection, workFlowBean.getArchiveLookup().getAlias(), qr, x + ilPrimo);
            System.out.println(titolo.getTitle());
            titleList.add(titolo.getTitle());
          }
        }
        System.out.println("Lookup.execute()44444" + qr);
        modelMap.put("selId", qr.id);
        System.out.println("Lookup.execute()6666666" + qr);
      } else if (MyRequest.getParameter("flagXML", parameterMap).equals("true")) {
        lookupBean.setInputTitleRule("");
        int totElements = qr.elements;
        // setQrSelId(qr.id);
        System.out.println("PIPPETTO " + qr.elements + " FINE");
        if (!MyRequest.getParameter("startPage", parameterMap).equals("")) {
          startPage = MyRequest.getParameter("startPage", parameterMap);
        }

        if (startPage.equals("")) {
          titlesPage.setPages(Integer.parseInt(keyCountQuery), totElements);
        } else {
          titlesPage.setPages(Integer.parseInt(keyCountQuery), totElements, Integer.parseInt(startPage));
        }
        int ilPrimo = titlesPage.getFirstElement() - 1;
        StringBuffer buffer = new StringBuffer();
        for (int x = 0; x < Integer.parseInt(keyCountQuery); x++) {
          if (x + ilPrimo < totElements) {
            int numDoc = xwconn.getNumDocFromQRElement(qr, x + ilPrimo);
            String strXml = xwconn.getSingleXMLFromQr(qr, x + ilPrimo, false);
            try {
              titleList.add(strXml);
            } catch (Exception e) {
              e.printStackTrace();
            }
          }
        }
        modelMap.put("selId", qr.id);
      }

    } catch (Exception e) {
      e.printStackTrace();
      throw new Exception(e.toString());
    } finally {
      modelMap.put("titleList", titleList);
      modelMap.put("titlesPage", titlesPage);
      try {
        if (!lookupBean.getInputTitleRule().trim().equals("")) {
          xwconn.restoreTitleRule(xwconn.connection, workFlowBean.getArchiveLookup().getAlias());
        }
        connectionManager.closeConnection(xwconn);
      } catch (Exception e1) {
        throw new Exception(e1.toString());
      }
View Full Code Here

Examples of org.xdams.workflow.bean.WorkFlowBean

    this.modelMap = modelMap;
  }

  public List<TitleBean> pagingXMLDocument(QueryResult queryResult, XWConnection xwConn) {
    List<TitleBean> titleBeans = new ArrayList<TitleBean>();
    WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
    HttpSession httpSession = workFlowBean.getRequest().getSession(false);
    try {
      // INIZIO PAGINAZIONE
      int pageToShow = 1;
      QRParser qRparser = null;
      QRPage currentPage = null;
      int perpage = 10;
      if (!MyRequest.getParameter("perpage", parameterMap).equals("")) {
        perpage = Integer.parseInt(MyRequest.getParameter("perpage", parameterMap));
      } else if (MyRequest.getAttribute("perpage", workFlowBean.getRequest()) != null) {
        perpage = Integer.parseInt((String) MyRequest.getAttribute("perpage", workFlowBean.getRequest()));
      }
      if (MyRequest.getParameter("fromId", parameterMap).equals("") || !MyRequest.getParameter("perpageChanged", parameterMap).equals("")) {
        int from = 0;
        try {
          from = Integer.parseInt(MyRequest.getParameter("toElement", parameterMap));
View Full Code Here

Examples of org.xdams.workflow.bean.WorkFlowBean

    return titleBeans;
  }
 
  public List<TitleBean> pagingTitleBean(QueryResult queryResult, XWConnection xwConn) {
    List<TitleBean> titleBeans = new ArrayList<TitleBean>();
    WorkFlowBean workFlowBean = (WorkFlowBean) modelMap.get("workFlowBean");
    HttpSession httpSession = workFlowBean.getRequest().getSession(false);
    try {
      // INIZIO PAGINAZIONE
      int pageToShow = 1;
      QRParser qRparser = null;
      QRPage currentPage = null;
      int perpage = 10;
      if (!MyRequest.getParameter("perpage", parameterMap).equals("")) {
        perpage = Integer.parseInt(MyRequest.getParameter("perpage", parameterMap));
      } else if (MyRequest.getAttribute("perpage", workFlowBean.getRequest()) != null) {
        perpage = Integer.parseInt((String) MyRequest.getAttribute("perpage", workFlowBean.getRequest()));
      }
      if (MyRequest.getParameter("fromId", parameterMap).equals("") || !MyRequest.getParameter("perpageChanged", parameterMap).equals("")) {
        int from = 0;
        try {
          from = Integer.parseInt(MyRequest.getParameter("toElement", parameterMap));
View Full Code Here

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

Examples of org.xdams.workflow.bean.WorkFlowBean

    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

Examples of org.xdams.workflow.bean.WorkFlowBean

    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
TOP
Copyright © 2018 www.massapi.com. 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.