Package es.ipsa.atril.doc.user

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


    put("active", a ? "1" : "0");
  }
   
  public ArrayList<BillNote> billNotes(AtrilSession oSes) {
    ArrayList<BillNote> aLst = new ArrayList<BillNote>();
    Dms oDms = oSes.getDms();
    List<Document> oLbn = oDms.query("BillNote$employee_uuid='"+getUuid()+"'");
    if (!oLbn.isEmpty()) {
        for (Document b : oLbn) {
          aLst.add(new BillNote(oDms, b.id()));
      }
    } 
View Full Code Here


  }
 
  public QueryResultSet<Ticket> queryTickets(AtrilSession oSes, Boolean bProcessed, Boolean bHasMistakes, Boolean bOnlyOpen, BigDecimal[] aAmountRange, Integer[] aMonthsRange, Integer[] aYearsRange, String sBiller, String sSearchStr, int iMaxRows, int iOffset)
    throws DocumentIndexerException {
    QueryResultSet<Ticket> aLst = new QueryResultSet<Ticket>();
    Dms oDms = oSes.getDms();
    DocumentIndexer oIdx = oSes.getDocumentIndexer();
    if (aAmountRange==null && aMonthsRange==null && aYearsRange==null)
      oIdx.setMaximumNumberOfDocumentReturned(iOffset+iMaxRows);
    String sQry = DocumentIndexer.AdditionalDocumentFields.DOCUMENT_TYPE_NAME.value() + ":" + "Ticket AND employee_uuid:\""+getUuid()+"\" AND taxpayer:\""+getTaxPayer(oSes).id()+"\"";
    if (bProcessed!=null)
View Full Code Here

      Log.out.error("AsyncSendInvitation new MailSessionHandler() "+ioe.getClass().getName()+" "+ioe.getMessage(), ioe);
    }
     
      AtrilSession oSes = DAO.getAdminSession("AsyncSendInvitation");
      oSes.autoCommit(true);
      Dms oDms = oSes.getDms();
    CustomerAccount oAcc = new CustomerAccount(oDms, sAccId);
     
    for (int t=0; t<aTxprs.length; t++) {
      String sTxpId = aTxprs[t];
        TaxPayer oTxp = new TaxPayer (oDms, sTxpId);
View Full Code Here

  public void multiSheetDocument(boolean msd) {
    put("MultiSheetDocument", new Long(msd ? 1l : 0l));   
  }
 
  public Fields fields(AtrilSession oSes) {
    Dms oDms = oSes.getDms();
    for (Document d : getDocument().children())
      if (d.type().name().equals("Fields"))
        return new Fields(oDms.getDocument(d.id()));
    throw new ElementNotFoundException("Fields not found");
  }
View Full Code Here

    throw new ElementNotFoundException("Fields not found");
  }

  public Collection<Scanner> scanners (AtrilSession oSes)
    throws NotEnoughRightsException, DmsException {
    Dms oDms = oSes.getDms();
    ArrayList<Scanner> aScanners = new ArrayList<Scanner>();
    for (Document d : getDocument().children())
      if (d.type().name().equals("Scanner"))
        aScanners.add(new Scanner(oDms.getDocument(d.id())));
    return aScanners;
  }
View Full Code Here

    return aScanners;
  }

  public Scanner seek (AtrilSession oSes, String sScannerName)
    throws ElementNotFoundException, NotEnoughRightsException, DmsException  {
    Dms oDms = oSes.getDms();
    for (Document d : getDocument().children()) {
      if (d.type().name().equals("Scanner")) {
        Scanner s = new Scanner(oDms.getDocument(d.id()));
        if (s.name().equals(sScannerName))
          return s;
      }
    }
    throw new ElementNotFoundException("Scanner "+sScannerName+" not found");
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);
View Full Code Here

      createAllModules();
    }

    AtrilSession oSess = DAO.getAdminSession(getClass().getName()+".createDataModel");

    Dms oDms = oSess.getDms();
    InternationalizationManager oInm = oDms.getInternationalizationManager();
    Locale oES = new Locale("es", "ES");
   
    createTypeHierarchy(oDms, oDms.getRootType(), new String[]{"Configurations","Endorsements","Endorsement"});
    createTypeHierarchy(oDms, oDms.getRootType(), new String[]{"Deposits","Deposit","Document","Side"});
    createTypeHierarchy(oDms, oDms.getRootType(), new String[]{"CaptureTypes","CaptureType","Fields","Field"});
    createTypeHierarchy(oDms, oDms.getDocumentType("CaptureType"), new String[]{"Scanner"});
    createTypeHierarchy(oDms, oDms.getRootType(), new String[]{"DeviceInformationType"});
    createTypeHierarchy(oDms, oDms.getRootType(), new String[]{"Zesped","CustomerAccount","TaxPayers","TaxPayer","Invoices","Invoice","InvoiceThumbnail"});
    createTypeHierarchy(oDms, oDms.getRootType(), new String[]{"Zesped","CaptureServiceFlavor"});
    createTypeHierarchy(oDms, oDms.getRootType(), new String[]{"Zesped","Countries","Country","States","State","Cities","City"});
    createTypeHierarchy(oDms, oDms.getRootType(), new String[]{"Zesped","VatPercents","VatPercent"});
    createTypeHierarchy(oDms, oDms.getDocumentType("Zesped"), new String[]{"Users","User","AllowedTaxPayers","AllowedTaxPayer"});
    createTypeHierarchy(oDms, oDms.getDocumentType("User"), new String[]{"DeniedTaxPayers","DeniedTaxPayer"});
    createTypeHierarchy(oDms, oDms.getDocumentType("Zesped"), new String[]{"Messages","Message"});
    createTypeHierarchy(oDms, oDms.getDocumentType("Zesped"), new String[]{"Products","Product"});
    createTypeHierarchy(oDms, oDms.getDocumentType("Zesped"), new String[]{"AccountingAccountsDefaults","AccountingAccountDefault"});
    createTypeHierarchy(oDms, oDms.getDocumentType("CustomerAccount"), new String[]{"Orders","Order","OrderLine"});
    createTypeHierarchy(oDms, oDms.getDocumentType("CustomerAccount"), new String[]{"Clients","Client"});
    createTypeHierarchy(oDms, oDms.getDocumentType("CustomerAccount"), new String[]{"CustomerAccountCredits"});
    createTypeHierarchy(oDms, oDms.getDocumentType("TaxPayer"), new String[]{"BillNotes","BillNote","Ticket","TicketThumbnail"});
    createTypeHierarchy(oDms, oDms.getDocumentType("TaxPayer"), new String[]{"Employees","Employee"});
    createTypeHierarchy(oDms, oDms.getDocumentType("TaxPayer"), new String[]{"AccountingAccounts","AccountingAccount"});
    createTypeHierarchy(oDms, oDms.getDocumentType("TaxPayer"), new String[]{"IncomingDeposits"});
   
    addTypeAttributes(oSess, oDms.getDocumentType("AccountingAccount"), new AccountingAccount().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("AccountingAccountDefault"), new AccountingAccountDefault().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("AllowedTaxPayer"), new AllowedTaxPayer().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("CaptureServiceFlavor"), new CaptureServiceFlavor().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("CaptureTypes"), new CaptureTypes().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("CaptureType"), new CaptureType().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("BillNote"), new BillNote().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("City"), new City().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Client"), new Client().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Country"), new Country().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("CustomerAccount"), new CustomerAccount().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("CustomerAccountCredits"), new CustomerAccountCredits().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("DeniedTaxPayer"), new DeniedTaxPayer().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Deposit"), new Deposit().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Deposits"), new Deposits().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("DeviceInformationType"), new DeviceInformationType().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Document"), new com.zesped.model.Document().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Employee"), new Employee().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Endorsement"), new Endorsement().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Field"), new Field().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Invoice"), new Invoice().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("InvoiceThumbnail"), new InvoiceThumbnail().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Message"), new Message().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Order"), new Order().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("OrderLine"), new OrderLine().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Product"), new Product().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Scanner"), new Scanner().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Side"), new Side().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("State"), new State().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("TaxPayer"), new TaxPayer().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("Ticket"), new Ticket().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("TicketThumbnail"), new TicketThumbnail().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("User"), new User().attributes());
    addTypeAttributes(oSess, oDms.getDocumentType("VatPercent"), new VatPercent().attributes());
   
    oInm.setCaptionFormat(oDms.getDocumentType("Zesped"), Locale.ENGLISH, "{#TypeName}");
    oInm.setCaptionFormat(oDms.getDocumentType("Zesped"), oES, "{#TypeName}");

    oInm.setCaptionFormat(oDms.getDocumentType("CaptureServiceFlavor"), Locale.ENGLISH, "{id}");
    oInm.setCaptionFormat(oDms.getDocumentType("CaptureServiceFlavor"), oES, "{id}");
   
    oInm.setCaptionFormat(oDms.getDocumentType("TaxPayers"), Locale.ENGLISH, "{#TypeName}");
    oInm.setCaptionFormat(oDms.getDocumentType("TaxPayers"), oES, "{#TypeName}");
    oInm.setCaptionFormat(oDms.getDocumentType("Invoices"), Locale.ENGLISH, "{#TypeName}");
    oInm.setCaptionFormat(oDms.getDocumentType("Invoices"), oES, "{#TypeName}");

    oInm.setCaptionFormat(oDms.getDocumentType("Country"), Locale.ENGLISH, "{en}");
    oInm.setCaptionFormat(oDms.getDocumentType("Country"), oES, "{es}");

    oInm.setCaptionFormat(oDms.getDocumentType("State"), Locale.ENGLISH, "{name}");
    oInm.setCaptionFormat(oDms.getDocumentType("State"), oES, "{name}");

    oInm.setCaptionFormat(oDms.getDocumentType("City"), Locale.ENGLISH, "{name}");
    oInm.setCaptionFormat(oDms.getDocumentType("City"), oES, "{name}");
   
    oInm.setCaptionFormat(oDms.getDocumentType("Users"), Locale.ENGLISH, "{#TypeName}");
    oInm.setCaptionFormat(oDms.getDocumentType("Users"), oES, "{#TypeName}");

    oInm.setCaptionFormat(oDms.getDocumentType("VatPercent"), Locale.ENGLISH, "{percentage} {description}");
    oInm.setCaptionFormat(oDms.getDocumentType("VatPercent"), oES, "{percentage} {description}");
   
    oInm.setCaptionFormat(oDms.getDocumentType("AccountingAccountsDefaults"), Locale.ENGLISH, "{#TypeName}");
    oInm.setCaptionFormat(oDms.getDocumentType("AccountingAccountsDefaults"), oES, "{#TypeName}");

    oInm.setCaptionFormat(oDms.getDocumentType("AccountingAccountDefault"), Locale.ENGLISH, "{account_code} - {account_desc}");
    oInm.setCaptionFormat(oDms.getDocumentType("AccountingAccountDefault"), oES, "{account_code} - {account_desc}");

    oInm.setCaptionFormat(oDms.getDocumentType("Messages"), Locale.ENGLISH, "{#TypeName}");
    oInm.setCaptionFormat(oDms.getDocumentType("Messages"), oES, "{#TypeName}");
   
    oInm.setCaptionFormat(oDms.getDocumentType("Products"), Locale.ENGLISH, "{#TypeName}");
    oInm.setCaptionFormat(oDms.getDocumentType("Products"), oES, "{#TypeName}");
   
    oInm.setCaptionFormat(oDms.getDocumentType("Orders"), Locale.ENGLISH, "{#TypeName}");
    oInm.setCaptionFormat(oDms.getDocumentType("Orders"), oES, "{#TypeName}");

    oInm.setCaptionFormat(oDms.getDocumentType("Clients"), Locale.ENGLISH, "{#TypeName}");
    oInm.setCaptionFormat(oDms.getDocumentType("Clients"), oES, "{#TypeName}");

    oInm.setCaptionFormat(oDms.getDocumentType("BillNotes"), Locale.ENGLISH, "{#TypeName}");
    oInm.setCaptionFormat(oDms.getDocumentType("BillNotes"), oES, "{#TypeName}");

    oInm.setCaptionFormat(oDms.getDocumentType("Employees"), Locale.ENGLISH, "{#TypeName}");
    oInm.setCaptionFormat(oDms.getDocumentType("Employees"), oES, "{#TypeName}");

    oInm.setCaptionFormat(oDms.getDocumentType("Employee"), Locale.ENGLISH, "{employee_name} ({employee_id})");
    oInm.setCaptionFormat(oDms.getDocumentType("Employee"), oES, "{employee_name} ({employee_id})");
       
    oInm.setCaptionFormat(oDms.getDocumentType("AccountingAccounts"), Locale.ENGLISH, "{#TypeName}");
    oInm.setCaptionFormat(oDms.getDocumentType("AccountingAccounts"), oES, "{#TypeName}");

    oInm.setCaptionFormat(oDms.getDocumentType("AccountingAccount"), Locale.ENGLISH, "{account_code} - {account_desc}");
    oInm.setCaptionFormat(oDms.getDocumentType("AccountingAccount"), oES, "{account_code} - {account_desc}");
   
    oInm.setCaptionFormat(oDms.getDocumentType("CustomerAccount"), Locale.ENGLISH, "{business_name}");
    oInm.setCaptionFormat(oDms.getDocumentType("CustomerAccount"), oES, "{business_name}");

    oInm.setCaptionFormat(oDms.getDocumentType("CustomerAccountCredits"), Locale.ENGLISH, "Used {credits_used} Left {credits_left}");
    oInm.setCaptionFormat(oDms.getDocumentType("CustomerAccountCredits"), oES, "Usados {credits_used} Disponibles {credits_left}");
   
    oInm.setCaptionFormat(oDms.getDocumentType("Order"), Locale.ENGLISH, "{order_id} / {creation_date}");
    oInm.setCaptionFormat(oDms.getDocumentType("Order"), oES, "{order_id} / {creation_date}");

    oInm.setCaptionFormat(oDms.getDocumentType("OrderLine"), Locale.ENGLISH, "{line_num}: {product_name}");
    oInm.setCaptionFormat(oDms.getDocumentType("OrderLine"), oES, "{line_num}: {product_name}");
   
    oInm.setCaptionFormat(oDms.getDocumentType("TaxPayer"), Locale.ENGLISH, "{business_name} ({tax_id})");
    oInm.setCaptionFormat(oDms.getDocumentType("TaxPayer"), oES, "{business_name} ({tax_id})");
   
    oInm.setCaptionFormat(oDms.getDocumentType("Client"), Locale.ENGLISH, "{business_name} ({tax_id})");
    oInm.setCaptionFormat(oDms.getDocumentType("Client"), oES, "{business_name} ({tax_id})");
   
    oInm.setCaptionFormat(oDms.getDocumentType("Invoice"), Locale.ENGLISH, "{invoice_number}");
    oInm.setCaptionFormat(oDms.getDocumentType("Invoice"), oES, "{invoice_number}");
   
    oInm.setCaptionFormat(oDms.getDocumentType("BillNote"), Locale.ENGLISH, "{employee_name} {comments}");
    oInm.setCaptionFormat(oDms.getDocumentType("BillNote"), oES, "{employee_name} {comments}");

    oInm.setCaptionFormat(oDms.getDocumentType("Ticket"), Locale.ENGLISH, "{ticket_date} {comments}");
    oInm.setCaptionFormat(oDms.getDocumentType("Ticket"), oES, "{ticket_date} {comments}");
   
    oInm.setCaptionFormat(oDms.getDocumentType("User"), Locale.ENGLISH, "{email}");
    oInm.setCaptionFormat(oDms.getDocumentType("User"), oES, "{email}");
   
    oInm.setCaptionFormat(oDms.getDocumentType("Message"), Locale.ENGLISH, "{message_subject}");
    oInm.setCaptionFormat(oDms.getDocumentType("Message"), oES, "{message_subject}");

    oInm.setCaptionFormat(oDms.getDocumentType("Product"), Locale.ENGLISH, "{product_name}");
    oInm.setCaptionFormat(oDms.getDocumentType("Product"), oES, "{product_name} ({price} {currency})");

    oInm.setCaptionFormat(oDms.getDocumentType("CaptureType"), Locale.ENGLISH, "{name}");
    oInm.setCaptionFormat(oDms.getDocumentType("CaptureType"), oES, "{name}");

    oInm.setCaptionFormat(oDms.getDocumentType("DeviceInformationType"), Locale.ENGLISH, "{brand} {model}");
    oInm.setCaptionFormat(oDms.getDocumentType("DeviceInformationType"), oES, "{brand} {model}");
   
    DocumentType oDepT = oDms.getDocumentType("Deposit");
    DocumentType oSidT = oDms.getDocumentType("Side");
    DocumentType oInvT = oDms.getDocumentType("Invoice");
    DocumentType oTckT = oDms.getDocumentType("Ticket");
    DocumentType oIncT = oDms.getDocumentType("IncomingDeposits");
    try {
      oSidT.addParent(oInvT);
        oSidT.save();
    } catch (IllegalArgumentException yaespadre) { }
    try {
        oSidT.addParent(oTckT);
        oSidT.save();
    } catch (IllegalArgumentException yaespadre) { }
    try {
      oDepT.addParent(oIncT);
      oDepT.save();
    } catch (IllegalArgumentException yaespadre) { }

    oSess.commit();

    String sMountBase = "/usr/local/apache-tomcat-6.0.36/webapps/zesped/WEB-INF/volumes/"; // DAO.getVolumesMountBase();
    if (sMountBase.length()>0) {
      boolean bDefaultVolumeExists = false;
      VolumeManager oVolm = oDms.getVolumeManager();
      for (Volume v : oVolm.getVolumeList()) {
        bDefaultVolumeExists = v.name().equals("Default");
        if (bDefaultVolumeExists) break;
      }
      if (!bDefaultVolumeExists) {
View Full Code Here

      else
        aAmountRange = new BigDecimal[]{null,new BigDecimal(sAmountTo)};

      try {
        connect(sNickN, sPassw);
        Dms oDms = getSession().getDms();
        DocumentIndexer oIdx = getSession().getDocumentIndexer();
        oIdx.setMaximumNumberOfDocumentReturned(iMaxRows);

        if (sBillNote.length()>0) {
          aLst = new QueryResultSet<Ticket>();
View Full Code Here

  }

  public static String forEmail(String sEmailAddr) throws NullPointerException,ElementNotFoundException {
    if (sEmailAddr==null) throw new NullPointerException("Email address may not be null");
    AtrilSession oSes = DAO.getAdminSession("User.forEmail");   
    Dms oDms = oSes.getDms();
    SortableList<Document> oLst = oDms.query("User$email='"+sEmailAddr.toLowerCase().trim()+"'");
    if (oLst.isEmpty()) {
      oSes.disconnect();
      oSes.close();
      throw new ElementNotFoundException("No user found with email "+sEmailAddr.toLowerCase().trim());
    } else {
View Full Code Here

TOP

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

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.