Package es.ipsa.atril.doc.user

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


        break;
      }
    }
    if (null==sId) {
      Dms oDms = oSes.getDms();
      Document oCredits = oDms.newDocument(oDms.getDocumentType("CustomerAccountCredits"), getDocument());
      oCredits.attribute("account_id").set(getString("account_id"));
      oCredits.attribute("credits_used").set(BigDecimal.ZERO);
      oCredits.attribute("credits_left").set(BigDecimal.ZERO);
      oCredits.save("");
      oAccCredits = new CustomerAccountCredits(oCredits);
      oSes.commit();
    } else {
      oAccCredits = new CustomerAccountCredits(oSes.getDms(), sId);     
    }   
View Full Code Here


    UsersGroup oGgrp = new UsersGroup(oAum, oGuestsGrp);
    UsersGroup oUgrp = new UsersGroup(oAum, oUsersGrp);
    UsersGroup oOgrp = new UsersGroup(oAum, oOpersGrp);
    UsersGroup oAgrp = new UsersGroup(oAum, oAdminsGrp);   
    for (BaseModelObject oObj : aObjs) {
      Document oDoc = oObj.getDocument();
      oGgrp.grantReadOnly(oDoc);
      oUgrp.grantAll(oDoc);
      oOgrp.grantAll(oDoc);
      oAgrp.grantAll(oDoc);
    }
View Full Code Here

    UsersGroup oGgrp = new UsersGroup(oAum, oGuestsGrp);
    UsersGroup oUgrp = new UsersGroup(oAum, oUsersGrp);
    UsersGroup oOgrp = new UsersGroup(oAum, oOpersGrp);
    UsersGroup oAgrp = new UsersGroup(oAum, oAdminsGrp);   
    for (BaseModelObject oObj : aObjs) {
      Document oDoc = oObj.getDocument();
      oGgrp.grantReadOnly(oDoc);
      oUgrp.grantAll(oDoc);
      oOgrp.grantAll(oDoc);
      oAgrp.grantAll(oDoc);
    }
View Full Code Here

    AttributeMultiValue oAttr = oUsr.getDocument().attribute("customer_acount");
    oAttr.set(oNew.getUuid());
    oUsr.getDocument().save("");
    oIdx.indexDocument(oUsr.getDocument());

    Document oOrders = oDms.newDocument(oDms.getDocumentType("Orders"), oNew.getDocument());
    oOrders.save("");
    oIdx.indexDocument(oOrders);
   
    Document oClients = oDms.newDocument(oDms.getDocumentType("Clients"), oNew.getDocument());
    oClients.save("");
    oIdx.indexDocument(oClients);

    Document oPayers = oDms.newDocument(oDms.getDocumentType("TaxPayers"), oNew.getDocument());
    oPayers.save("");
    oIdx.indexDocument(oPayers);

    Document oCredits = oDms.newDocument(oDms.getDocumentType("CustomerAccountCredits"), oNew.getDocument());
    oCredits.attribute("account_id").set(oNew.getString("account_id"));
    oCredits.attribute("credits_used").set(0l);
    oCredits.attribute("credits_left").set(0l);
    oCredits.save("");
    oIdx.indexDocument(oCredits);
   
    Log.out.debug("PROFILING: Create CustomerAccount child documents "+String.valueOf((lEnd=new Date().getTime())-lStart)+" ms");
    lStart = lEnd;
   
View Full Code Here

    bAsc = bAscending;
  }

  @Override
  public int compare(BaseModelObject oObj1, BaseModelObject oObj2) {
    Document oDoc1 = oObj1.getDocument();
    Document oDoc2 = oObj2.getDocument();
    DataType oTyp = oDoc1.attribute(sAtr).type().getDataType();
    Comparable oAtr1=null, oAtr2=null;
    switch (oTyp) {
      case STRING:
        if (oDoc1.attribute(sAtr).isEmpty())
          oAtr1 = null;
        else
          oAtr1 = oDoc1.attribute(sAtr).toString();
        if (oDoc2.attribute(sAtr).isEmpty())
          oAtr2 = null;
        else
          oAtr2 = oDoc2.attribute(sAtr).toString();
        break;
      case DATE:
      case DATE_TIME:
        if (oDoc1.attribute(sAtr).isEmpty())
          oAtr1 = null;
        else
          oAtr1 = oObj1.getDate(sAtr);
        if (oDoc2.attribute(sAtr).isEmpty())
          oAtr2 = null;
        else
          oAtr2 = oObj2.getDate(sAtr);
        break;
      case NUMBER:
        if (oDoc1.attribute(sAtr).isEmpty())
          oAtr1 = null;
        else
          oAtr1 = oDoc1.attribute(sAtr).toBigDecimal();
        if (oDoc2.attribute(sAtr).isEmpty())
          oAtr2 = null;
        else
          oAtr2 = oDoc2.attribute(sAtr).toBigDecimal();
        break;
    }
    if (oAtr1==null && oAtr2==null)
      return 0;
    else if (oAtr1==null)
View Full Code Here

  public Attr[] attributes() {
    return aAttrs;
  }

  public TaxPayer getTaxPayer(AtrilSession oSes) {
    Document oParent = oSes.getDms().getDocument(parentId());
    TaxPayer oTxpr = new TaxPayer(oParent);
    return oTxpr;
  }
View Full Code Here

 
  public Scanner addScanner(AtrilSession oSes, String sName, InputStream oConfigProperties)
    throws ElementNotFoundException, IOException {
    Scanner oScr = new Scanner();
    Dms oDms = oSes.getDms();
    Document oDoc = oDms.newDocument(oDms.getDocumentType(oScr.getTypeName()), getDocument());
    oDoc.attribute("name").set(sName);
    oDoc.save("");
    oScr.setDocument(oDoc);
    oScr.insertContentFromInputStream(oSes, oConfigProperties, sName+".properties");
    oScr.save(oSes);
    return oScr;
  }
View Full Code Here

            else if (getUser().getDeniedTaxPayers().size()>0)
              setPermissions("deny");
            else
              setPermissions("all");
            emp = new Employee();
            Document e = emp.exists(getSession(), "employee_uuid", usr.getNickName());
            if (e!=null) {
              ise = true;
              emp.load(getSession(), e.id());
              setTaxPayer(emp.getTaxPayer(getSession()).id());
            }
            disconnect();
          } catch (Exception xcpt) {
            Log.out.error(xcpt.getMessage(), xcpt);
View Full Code Here

    if (!containsKey("creation_date")) put("creation_date", new Date());
    if (!containsKey("is_open")) put("is_open", "1");
    if (!isNull("concept")) put("concept", Gadgets.removeChars(getString("concept"),"\"\n'"));

    Document oBil = exists(oSes, new NameValuePair("concept", getString("concept")), new NameValuePair("employee_uuid", getString("employee_uuid")));
   
    if (oBil!=null)
      if (oBil.id().equals(id()))
        throw new DmsException("A previous bill note with the same concept for the same employee already exists");

    super.save(oSes);
  }
View Full Code Here

    }

  public static Zesped top(AtrilSession oSes)
    throws ElementNotFoundException, NotEnoughRightsException {
      Log.out.debug("Begin com.zesped.model.Zesped.top()");
    Document r = oSes.getDms().getRootDocument();
    Zesped z = new Zesped();
    for (Document d : r.children()) {
      if (d.type().name().equals(z.getTypeName())) {
        z.setDocument(oSes.getDms().getDocument(d.id()));
        break;
      }
    } // next
View Full Code Here

TOP

Related Classes of es.ipsa.atril.doc.user.Document

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.