Package es.ipsa.atril.documentindexer

Examples of es.ipsa.atril.documentindexer.DocumentIndexer


        aAmountRange = new BigDecimal[]{null,new BigDecimal(sAmountTo)};

      try {
        connect(sNickN, sPassw);
        Dms oDms = getSession().getDms();
        DocumentIndexer oIdx = getSession().getDocumentIndexer();
        oIdx.setMaximumNumberOfDocumentReturned(iMaxRows);

        if (sBillNote.length()>0) {
          aLst = new QueryResultSet<Ticket>();
          aLst.addAll(new BillNote(oDms, sBillNote).tickets(getSession()));
        } else if (sEmployee.length()>0) {
View Full Code Here


    return concepts(oSes, true, sEmployeeUuid);
  }
 
  public BillNote forConcept(AtrilSession oSes, String sConcept, String sEmployeeUuid) {
    String sTaxPayerId = getDocument().parents().get(0).id();
    DocumentIndexer oIdx = oSes.getDocumentIndexer();
    final String sQry = "taxpayer:\""+sTaxPayerId+"\" AND employee_uuid:\""+sEmployeeUuid+"\" AND concept:\"" + Gadgets.removeChars(sConcept,"\"\n'")+ "\" AND " + DocumentIndexer.AdditionalDocumentFields.DOCUMENT_TYPE_NAME.value() + ":" + "BillNote";
    Log.out.debug("DocumentIndexer.query("+sQry+")");
    SortableList<Document> oLst = (SortableList<Document>) oIdx.query(sQry);
    if (oLst.isEmpty())
      return create(oSes, "", "basic", sTaxPayerId, sConcept, sEmployeeUuid);
    else
      return new BillNote(oSes.getDms().getDocument(oLst.get(0).id()));
  }
View Full Code Here

  }

  protected static String forBusinessName(String sBusinessName, String sTypeNamethrows ElementNotFoundException, NullPointerException, IllegalArgumentException {
    if (null==sBusinessName) throw new NullPointerException("Business Name cannot be null");
    AtrilSession oSes = DAO.getAdminSession("forBusinessName");
    DocumentIndexer oIdx = oSes.getDocumentIndexer();
    String sSanitizedBusinessName = sanitizeBusinessName(sBusinessName);
    if (sSanitizedBusinessName.length()==0) {
      oSes.disconnect();
      oSes.close();
      throw new IllegalArgumentException("Business Name cannot be empty");
    }
    SortableList<Document> oLst = (SortableList<Document>) oIdx.query("business_name:\"" + sSanitizedBusinessName + "\" AND " + DocumentIndexer.AdditionalDocumentFields.DOCUMENT_TYPE_NAME.value() + ":" + sTypeName);
    if (oLst.isEmpty()) {
      oSes.disconnect();
      oSes.close();
      throw new ElementNotFoundException(sBusinessName+" not found");
    } else {
View Full Code Here

  }

  protected static String forTaxId(String sTaxId, String sTypeNamethrows ElementNotFoundException, NullPointerException, IllegalArgumentException {
    if (null==sTaxId) throw new NullPointerException("Tax Id cannot be null");
    AtrilSession oSes = DAO.getAdminSession("forTaxId");
    DocumentIndexer oIdx = oSes.getDocumentIndexer();
    if (sTaxId.length()==0) {
      oSes.disconnect();
      oSes.close();
      throw new IllegalArgumentException("Tax Id cannot be empty");
    }
    SortableList<Document> oLst = (SortableList<Document>) oIdx.query("tax_id:\"" + sTaxId + "\" AND " + DocumentIndexer.AdditionalDocumentFields.DOCUMENT_TYPE_NAME.value() + ":" + sTypeName);
    if (oLst.isEmpty()) {
      oSes.disconnect();
      oSes.close();
      throw new ElementNotFoundException(sTaxId+" not found");
    } else {
View Full Code Here

   
    setAdministeredUser(oAam.createUser(sNickName, getPassword(), getFirstName(), getLastName(), oGrp));

    String sUsrs = Users.top(oSes).getDocument().id();
   
    DocumentIndexer oIdx = oSes.getDocumentIndexer();
    SortableList<Document> oLst = (SortableList<Document>) oSes.getDms().query("User$email='"+getEmail()+"'");
    if (!oLst.isEmpty()) {
      Log.out.error("E-mail address "+getEmail()+" already belongs to another user");
      throw new IllegalArgumentException("E-mail address "+getEmail()+" already belongs to another user");
    }
   
    Dms oDms = oSes.getDms();
    Document oDoc = oDms.newDocument(oDms.getDocumentType("User"), oDms.getDocument(sUsrs));
    oDoc.save("");
    setDocument(oDoc);
   
    AttributeMultiValue oUid = oDoc.attribute("user_id");
    oUid.set(oDoc.id());
    AttributeMultiValue oUuid = oDoc.attribute("user_uuid");
    oUuid.set(sNickName);
    AttributeMultiValue oAttr = oDoc.attribute("email");
    oAttr.set(getEmail());
    AttributeMultiValue oActv = oDoc.attribute("active");
    oActv.set(getStringNull("active","1"));
    AttributeMultiValue oSrvs = oDoc.attribute("allowed_services");
    oSrvs.set(String.valueOf(CaptureService.INVOICES.toInt())+","+String.valueOf(CaptureService.BILLNOTES.toInt()));
    AttributeMultiValue oPassw = oDoc.attribute("password");
    oPassw.set(ACL.encript(getPassword(), ACL.PWD_DTIP_RC4_64));
    AttributeMultiValue oApr = oDoc.attribute("can_approve");
    oApr.set("1");
    AttributeMultiValue oStl = oDoc.attribute("can_settle");
    oStl.set("1");
    AttributeMultiValue oPre = oDoc.attribute("can_premium");
    oPre.set("1");
    oDoc.save("");
    oIdx.indexDocument(oDoc);

    put("user_id", oDoc.id());
    put("user_uuid", sNickName);
    put("can_approve", "1");
    put("can_settle", "1");
View Full Code Here

    Zesped.createGroups(oSess);
   
      oSess.commit();
     
    Dms oDms = oSess.getDms();
    DocumentIndexer oIdx = oSess.getDocumentIndexer();
    Document oZespedDoc = null;

    UsersGroup oUsrsGrp = new UsersGroup(oAum, Zesped.getUsersGroup(oAum));
    UsersGroup oOpersGrp = new UsersGroup(oAum, Zesped.getOperatorsGroup(oAum));
   
View Full Code Here

 
  // --------------------------------------------------------------------------
 
  public static void reindexDocument(AtrilSession oSes, Document oDoc) throws AuthenticationException, SecuritySystemException, SQLException {
    if (!bInitOK) throw new IllegalStateException("DAO was not properly initialized");
    DocumentIndexer oIdx = oSes.getDocumentIndexer();
    oIdx.indexDocument(oDoc);
    NodeList<Document> oChilds = oDoc.children();
    for (Document c : oChilds) {
      reindexDocument(oSes, oSes.getDms().getDocument(c.id()));
    }
  }
View Full Code Here

TOP

Related Classes of es.ipsa.atril.documentindexer.DocumentIndexer

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.