Examples of DMS


Examples of es.ipsa.atril.doc.user.Dms

    final String id = getParam("id","");

    try {
          connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
          Dms oDms = getSession().getDms();
      Client clnt = new Client(oDms, id);
      if (clnt.invoicesCount(oDms)>0)
        addError(new LocalizableError("com.zesped.action.CheckCanDeleteClient.hasInvoices",clnt.getBusinessName()));
      else if (clnt.ticketsCount(oDms)>0)
        addError(new LocalizableError("com.zesped.action.CheckCanDeleteClient.hasTickets",clnt.getBusinessName()));
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

      oTxp.incTotalTicketsCount(oSes, -1l);
    }
  }
 
  public void changeBillNote(AtrilSession oSes, String sNewBillNoteId) throws ElementNotFoundException, DmsException, NotYetConnectedException {
    Dms oDms = oSes.getDms();
    BillNote oBln = new BillNote(oDms.getDocument(sNewBillNoteId));
    getDocument().parents().replace(oDms.getDocument(parentId()), oBln.getDocument());
    if (oBln.isNull("employee_uuid"))
      put("employee_uuid","");
    else
      put("employee_uuid",oBln.getEmployeeId());     
  }
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

  }

  public static void delete(AtrilSession oSes, String sDocId)
    throws DmsException, ElementNotFoundException, ClassNotFoundException, InstantiationException,
    IllegalAccessException, ClassCastException, IllegalStateException {
    Dms oDms = oSes.getDms();
    new Ticket(oDms, sDocId).delete(oSes, oDms);
 
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

  }
 
  public Resolution save() {
    Log.out.debug("Begin EditInvoice.save()");
    Invoice oInv = saveInvoice();
    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

Examples of es.ipsa.atril.doc.user.Dms

      Log.out.debug("EditInvoice.approve()");
      setApproved(true);
      setProcessed(true);
      setMistakes(false);
      saveInvoice();
      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

Examples of es.ipsa.atril.doc.user.Dms

      Log.out.debug("Begin EditInvoice.reject()");
      setApproved(false);
      setProcessed(false);
      setMistakes(true);
      Invoice oInv = saveInvoice();
      Dms oDms;
      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

Examples of es.ipsa.atril.doc.user.Dms

  public Document getDocument() {
    return oDoc;
  }

  protected void newDocument(AtrilSession oSes, Document oParent) {
    Dms oDms = oSes.getDms();
    DocumentType oDoct = oDms.getDocumentType(getTypeName());
    oDoc = oDms.newDocument(oDoct, oParent);
    setTypeName(oDoc.type().name());
    sId = oDoc.id();
    clear();
  } // newDocument
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

    if (oParents.isEmpty()) throw new ElementNotFoundException("Parent not found");
    return oParents.get(0).id();
  }

  public void load(AtrilSession oSes, String sDocId) throws ElementNotFoundException, NotEnoughRightsException , DmsException {
    Dms oDms = oSes.getDms();
    Document d = oDms.getDocument(sDocId);
    if (null==d) throw new ElementNotFoundException("Document "+sDocId+" not found");
    setDocument(d);
  }
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

           AttributeTypeHasValuesException, NotYetConnectedException, DmsException, DmsDocumentModificationException {
    if (oDoc==null) throw new IllegalStateException(getTypeName()+" document not set before calling save() method");

    if (DAO.checkConstraints) {
      AtrilSession oAdm = DAO.getAdminSession("checkConstraints");
      Dms oDms = oAdm.getDms();
      DocumentIndexer oIdx = oAdm.getDocumentIndexer();
      final Attr[] aAttrs = attributes();
      final int nAttrs = (aAttrs==null ? 0 : aAttrs.length);
      try {
        for (int a=0; a<nAttrs; a++) {
          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
              oLst = null;
            if (null!=oLst) {
              if (!oLst.isEmpty()) {
                String p = parentId();           
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

  }
 
  public static void delete(AtrilSession oSes, String sDocId)
    throws DmsException, ElementNotFoundException, ClassNotFoundException, InstantiationException,
    IllegalAccessException, ClassCastException, IllegalStateException {
    Dms oDms = oSes.getDms();
    Document d = oDms.getDocument(sDocId);
    Log.out.debug("BaseModelObject.delete(AtrilSession, "+sDocId+")");
    if (null==d) throw new ElementNotFoundException("Document "+sDocId+" not found");
    Class t = Class.forName("com.zesped.model."+d.type().name());
    BaseModelObject o = (BaseModelObject) t.newInstance();
    o.setDocument(d);
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.