Package es.ipsa.atril.doc.user

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


  public String incomingDeposits(AtrilSession oSes) {
    for (Document d : getDocument().children())
      if (d.type().name().equals("IncomingDeposits"))
        return d.id();
    Dms oDms = oSes.getDms();
    Document oDoc = oDms.newDocument(oDms.getDocumentType("IncomingDeposits"), getDocument());
    oDoc.save("");
    oSes.commit();
    return oDoc.id();
  }
View Full Code Here


    super.save(oSes);
  }

  public CustomerAccount customerAccount(Dms oDms) {
    Document txps = oDms.getDocument(getDocument().parents().get(0).id());
    return new CustomerAccount(oDms, txps.parents().get(0).id());
  }
View Full Code Here

         break;
        }
    } // next
   
    if (null==oAccountingAccounts) {
      Document n = oSes.getDms().newDocument(oSes.getDms().getDocumentType("AccountingAccounts"), getDocument());
      n.save("");
      DocumentIndexer oIdx = oSes.getDocumentIndexer();
      oIdx.indexDocument(n);
      oAccountingAccounts = new AccountingAccounts(n);
      populateAccountingAccountsWithDefaultValues(oSes, oSes.getDms(), oIdx, customerAccount(oSes.getDms()));
    }
View Full Code Here

    lStart = lEnd;
   
    int nAacs = aDefs.size();
    if (nAacs>0) {
      DocumentType oDtp = oDms.getDocumentType("AccountingAccount");
      Document p = oAccountingAccounts.getDocument();
      for (AccountingAccountDefault d : aDefs) {
        try {
          oAccountingAccounts.seek(oSes, d.getString("account_code"));
        } catch (ElementNotFoundException enfe) {
          Document a = oDms.newDocument(oDtp, p);
          a.attribute("account_code").set(d.getString("account_code"));
          a.attribute("account_desc").set(d.getString("account_desc"));
          a.attribute("account_uuid").set(Gadgets.generateUUID());
          a.attribute("is_active").set("1");
          a.save("");
          oIdx.indexDocument(a);         
        }
      }   

      Log.out.debug("PROFILING: Copy Default AccountingAccounts to Customer AccountingAccounts "+String.valueOf((lEnd=new Date().getTime())-lStart)+" ms");
View Full Code Here

    oSes.commit();

    Log.out.debug("PROFILING: Save TaxPayer "+String.valueOf((lEnd=new Date().getTime())-lStart)+" ms");
    lStart = lEnd;
   
    Document oInvoices = oDms.newDocument(oDms.getDocumentType("Invoices"), oPayer.getDocument());
    oInvoices.save("");
    oIdx.indexDocument(oInvoices);

    Document oBillNotes = oDms.newDocument(oDms.getDocumentType("BillNotes"), oPayer.getDocument());
    oBillNotes.save("");
    oIdx.indexDocument(oBillNotes);

    Document oEmployees = oDms.newDocument(oDms.getDocumentType("Employees"), oPayer.getDocument());
    oEmployees.save("");
    oIdx.indexDocument(oEmployees);

    Log.out.debug("PROFILING: Create TaxPayer child documents "+String.valueOf((lEnd=new Date().getTime())-lStart)+" ms");
    lStart = lEnd;
   
View Full Code Here

  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("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)
View Full Code Here

    oDoc.save("");
    return oCpt;
  }
 
  public static CaptureTypes top(AtrilSession oSes) throws ElementNotFoundException {
    Document r = oSes.getDms().getRootDocument();
    CaptureTypes t = new CaptureTypes();
    for (Document d : r.children()) {
      if (d.type().name().equals(t.getTypeName())) {
        t.setDocument(oSes.getDms().getDocument(d.id()));
        break;
      }
    } // next
View Full Code Here

    throws ElementNotFoundException, NotEnoughRightsException, DmsException, InstantiationException, IllegalAccessException {
    AuthorizationManager oAum = oSes.getAuthorizationManager();
    Dms oDms = oSes.getDms();
    DocumentRights oGrt = RightsFactory.getDocumentRightsAllGrant();
    ArrayList<User> aUsrs = Users.top(oSes).list(oSes);
    Document oCpts = getDocument();
    for (User u : aUsrs) {
      String sNick = u.getNickName();
      if (!sNick.equals("admin")) {
        es.ipsa.atril.sec.user.User oUsr = oAum.getUser(sNick);
        oAum.setDocumentRights(oUsr, oCpts, oGrt);
        for (Document t : oCpts.children()) {
          oAum.setDocumentRights(oUsr, oDms.getDocument(t.id()), oGrt);
          for (Document f : t.children()) {
            oAum.setDocumentRights(oUsr, oDms.getDocument(f.id()), oGrt);
            for (Document s : f.children()) {
              oAum.setDocumentRights(oUsr, oDms.getDocument(s.id()), oGrt);             
View Full Code Here

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

  public static Countries top(AtrilSession oSes) throws ElementNotFoundException {
    Document z = Zesped.top(oSes).getDocument();
    Countries c = new Countries();
    for (Document d : z.children()) {
      if (d.type().name().equals(c.getTypeName())) {
        c.setDocument(oSes.getDms().getDocument(d.id()));
        break;
      }
    } // next
View Full Code Here

  }

  public Country getCountry(AtrilSession oSes, String sISOCode) {
    Country oCntr = new Country();
    if (aCntrs==null) {
      Document oDoc = oCntr.exists(oSes, "id", sISOCode);
      if (oDoc==null) {
        return null;
      } else {
        oCntr.setDocument(oDoc);
        return oCntr;     
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.