Package es.ipsa.atril.doc.user

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


    if (!isNull("thread_id")) {
      if (getString("thread_id").length()>0) {
        SortableList<Document> oThd = oDms.query("Message$thread_id='"+getString("thread_id")+"'");
        if (!oThd.isEmpty()) {
          for (Document m : oThd) {
            Document oMsg = oDms.getDocument(m.id());
            oMsg.attribute("is_archived").set("1");
            oMsg.save("archive");
          }         
        }
      }
    }
  }
View Full Code Here


    setDocument(d);
  }
 
  public AccountingAccountDefault(AtrilSession oSes, String sCode, String sDesc) {
    super("AccountingAccountDefault");
    Document oDoc = exists(oSes, "account_code", sCode);
    Document oParent = AccountingAccountsDefaults.top(oSes).getDocument();
    if (oDoc==null)
      newDocument(oSes, oParent);
    else
      setDocument(oDoc);
    put("account_code",sCode);
View Full Code Here

    return null;
  }

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

    super(d);
  }
 
  public CaptureServiceFlavor(AtrilSession oSes, String sId, CaptureService eCaptureServ, String sName, int iCredits) {
    super("CaptureServiceFlavor");
    Document oDoc = exists(oSes, "id", sId);
    if (oDoc==null)
      newDocument(oSes, Zesped.top(oSes).getDocument());
    else
      setDocument(oDoc);
    put("id",sId);
View Full Code Here

 
  public static Collection<VatPercent> listAll() {
    if (oAllPercents==null) {
      AtrilSession oSes = DAO.getAdminSession("VatPercents");
      Dms oDms = oSes.getDms();
      Document p = VatPercents.top(oSes).getDocument();
      oAllPercents = new ArrayList<VatPercent>();
      for (Document d : p.children()) {
        oAllPercents.add(new VatPercent(oDms.getDocument(d.id())));
      }
      oSes.disconnect();
      oSes.close();
      Collections.sort(oAllPercents, oVatCmp);
View Full Code Here

  public static Collection<VatPercent> listActive() {
    if (oActivePercents==null) {
      AtrilSession oSes = DAO.getAdminSession("VatPercents");
      Dms oDms = oSes.getDms();
      Document p = VatPercents.top(oSes).getDocument();
      oActivePercents = new ArrayList<VatPercent>();
      for (Document d : p.children()) {
        VatPercent v = new VatPercent(oDms.getDocument(d.id()));
        if (v.isActive()) oActivePercents.add(v);
      }
      oSes.disconnect();
      oSes.close();
View Full Code Here

    v.save(oSes);
    return v;
  }

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

    return taxPayer(oDms).customerAccount(oDms);
  }

  @Override
  public Volume getVolume(AtrilSession oSes) throws ElementNotFoundException {
    Document oDoc = getDocument();
    if (oDoc==null) {
      return null;
    } else {
      VolumeManager oVolm = oSes.getDms().getVolumeManager();
      if (oVolm.hasVolume(oDoc))
        return oVolm.getVolume(oDoc);
      else {
        Document oTxp = oSes.getDms().getDocument(getTaxPayer());
        if (oVolm.hasVolume(oTxp))
          return oVolm.getVolume(oTxp);
        else
          return null;       
      }
View Full Code Here

  public BaseCompanyObject biller(AtrilSession oSes) {
    BaseCompanyObject oObj;
    if (isNull("biller_taxpayer")) {
      oObj=null;
    } else {
      Document d = oSes.getDms().getDocument(getString("biller_taxpayer"));
      if (d.type().name().equals("TaxPayer"))
        oObj=new TaxPayer(d);
      else if (d.type().name().equals("Client"))
        oObj=new Client(d);
      else
        oObj=null;
    }
    return oObj;
View Full Code Here

  public CaptureType create(AtrilSession oSes, String sMimeType, boolean bMultiPage, boolean bMultiSheet,
                boolean bSign, boolean bServerSign, String sName, String sDescripcion) {
    CaptureType oCpt = new CaptureType();
    Dms oDms = oSes.getDms();
    Document oDoc = oDms.newDocument(oDms.getDocumentType(oCpt.getTypeName()), getDocument());
    oDoc.attribute("name").set(sName);
    oDoc.attribute("description").set(sDescripcion);
    oDoc.attribute("MimeType").set(sMimeType);
    oDoc.attribute("MultiPageItem").set(bMultiPage ? 1 : 0);
    oDoc.attribute("MultiSheetDocument").set(bMultiSheet ? 1 : 0);
    oDoc.attribute("Sign").set(bSign ? 1 : 0);
    oDoc.attribute("SignInClient").set(bSign ? 1 : 0);
    oDoc.attribute("SignInServer").set(bServerSign ? 1 : 0);
    oDoc.attribute("IsPDFA").set(0);
    oDoc.attribute("XMPMetadataStructure").set("");
    oDoc.attribute("bitsDepth").set(0);
    oDoc.save("");
    oCpt.setDocument(oDoc);
    oDoc = oDms.newDocument(oDms.getDocumentType("Fields"), oCpt.getDocument());
    oDoc.save("");
    return oCpt;
  }
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.