Package es.ipsa.atril.doc.user

Examples of es.ipsa.atril.doc.user.Dms.query()


    if (dtCreationFrom!=null)
      sQry += (sQry.length()==0 ? "" : " & ") + "(Invoice$creation_date>='"+oFmt.format(dtCreationFrom)+"')";
    if (dtCreationTo!=null)
      sQry += (sQry.length()==0 ? "" : " & ") + "(Invoice$creation_date<='"+oFmt.format(dtCreationTo)+"')";
    Log.out.debug("Dms.query("+sQry+")");
    SortableList<Document> oLst = oDms.query(sQry);
    if (!oLst.isEmpty()) {
      int o = 0, n = 0;
      for (Document d : oLst) {
        if (iOffset<=o++) {
          try {
View Full Code Here


    IllegalAccessException, ClassCastException, IllegalStateException {
    Dms oDms = oSes.getDms();
    Document d = oDms.getDocument(sDocId);
    Log.out.debug("TaxPayer.delete(AtrilSession, "+sDocId+")");
    if (null==d) throw new ElementNotFoundException("Document "+sDocId+" not found");
    List <Document> oAlwed = oDms.query("AllowedTaxPayer$taxpayer='"+sDocId+"'");
    List <Document> oDnied = oDms.query("DeniedTaxPayer$taxpayer='"+sDocId+"'");
    for(Document a : oAlwed)
      BaseModelObject.delete(oSes, a.id());
    for(Document n : oDnied)
      BaseModelObject.delete(oSes, n.id());
View Full Code Here

    Dms oDms = oSes.getDms();
    Document d = oDms.getDocument(sDocId);
    Log.out.debug("TaxPayer.delete(AtrilSession, "+sDocId+")");
    if (null==d) throw new ElementNotFoundException("Document "+sDocId+" not found");
    List <Document> oAlwed = oDms.query("AllowedTaxPayer$taxpayer='"+sDocId+"'");
    List <Document> oDnied = oDms.query("DeniedTaxPayer$taxpayer='"+sDocId+"'");
    for(Document a : oAlwed)
      BaseModelObject.delete(oSes, a.id());
    for(Document n : oDnied)
      BaseModelObject.delete(oSes, n.id());
    BaseModelObject o = new TaxPayer();
View Full Code Here

    if (!containsKey("is_active")) put("is_active", "1");

    super.save(oSes);

    Dms oDms = oSes.getDms();
    List<Document> oLst = oDms.query("Ticket$account_uuid='" + getString("account_uuid") + "'");
    for (Document d : oLst) {
      Ticket oTck = new Ticket(oDms.getDocument(d.id()));
      oTck.put("accounting_code", getString("account_code"));
      oTck.put("accounting_desc", Gadgets.removeChars(getString("account_desc"),"\"\n`'"));
      oTck.save(oSes);
View Full Code Here

      default:
        throw new IllegalArgumentException("Folder must be SENT, RECEIVED or ARCHIVED");
    }
    Dms oDms = oSes.getDms();
    Log.out.debug("Dms.query("+sQry+")");
    SortableList<Document> oLst = oDms.query(sQry);
    int nTotalMsgs = oLst.size();
    ArrayList<Message> aMsgs = new ArrayList<Message>(nTotalMsgs==0 ? 1 : nTotalMsgs);
    ArrayList<Message> aSubl = new ArrayList<Message>(iMaxMsgs==0 ? 1 : iMaxMsgs);
    if (!oLst.isEmpty())
      for (Document d : oLst)
View Full Code Here

  public static Collection<Country> list() {
    if (aCntrs==null) {
      AtrilSession oSes = DAO.getAdminSession("Countries");
      Dms oDms = oSes.getDms();
      SortableList<Document> oLst = (SortableList<Document>) oDms.query("Country");
      aCntrs = new ArrayList<Country>();
      for (Document d : oLst) {
        Country c = new Country();
        c.setDocument(oDms.getDocument(d.id()));
        aCntrs.add(c);
View Full Code Here

    Dms oDms;
    Resolution oRes = new RedirectResolution(ListNewInvoices.class);
    try {
      connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
      oDms = getSession().getDms();
      SortableList<Document> oNext = oDms.query("(Invoice$is_processed='0') & (Invoice$recipient_taxpayer='"+getRecipientTaxPayer()+"')");
      if (!oNext.isEmpty()) {
        oRes = new RedirectResolution("/EditInvoice.action?a=0&id="+oNext.get(0).id());
        setParam("former_id", getId());
      }
      disconnect();
View Full Code Here

      Dms oDms;
      Resolution oRes = new RedirectResolution(ListPendingInvoices.class);
      try {
        connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
        oDms = getSession().getDms();
        SortableList<Document> oNext = oDms.query("(Invoice$is_processed='1') & (Invoice$is_approved='0') & (Invoice$recipient_taxpayer='"+getRecipientTaxPayer()+"')");
        if (!oNext.isEmpty()) {
          oRes = new RedirectResolution("/EditInvoice.action?a=1&id="+oNext.get(0).id());
          setParam("former_id", getId());
        }
        disconnect();
View Full Code Here

      Resolution oRes = new RedirectResolution(ListPendingInvoices.class);
      try {
        connect();
        oDms = getSession().getDms();
        Log.out.debug("Dms.query((Invoice$is_processed='1') & (Invoice$is_approved='0') & (Invoice$recipient_taxpayer='"+getRecipientTaxPayer()+"'))");
        SortableList<Document> oNext = oDms.query("(Invoice$is_processed='1') & (Invoice$is_approved='0') & (Invoice$recipient_taxpayer='"+getRecipientTaxPayer()+"')");
        if (!oNext.isEmpty()) {
          oRes = new RedirectResolution("/EditInvoice.action?a=1&id="+oNext.get(0).id());
          setParam("former_id", getId());
        }
        User oMe = new User(getSession(), getSessionAttribute("user_docid"));
View Full Code Here

          if (aAttrs[a].required && isNull(aAttrs[a].name)) throw new NullPointerException(getTypeName()+" attribute "+aAttrs[a].name+" is required");
          if (aAttrs[a].unique && !isNull(aAttrs[a].name)) {
            List<Document> oLst;
            if (aAttrs[a].dataType.equals(DataType.STRING))
              if (getString(aAttrs[a].name).indexOf("'")<0)
                oLst = oDms.query(getTypeName()+"$"+aAttrs[a].name+"='"+escape(getString(aAttrs[a].name))+"'");
              else
              oLst = null;
            else if (aAttrs[a].dataType.equals(DataType.NUMBER))
                oLst = oDms.query(getTypeName()+"$"+aAttrs[a].name+"="+get(aAttrs[a].name));
            else
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.