Package es.ipsa.atril.doc.user

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


   
      oSess.commit();
     
    Dms oDms = oSess.getDms();
    DocumentIndexer oIdx = oSess.getDocumentIndexer();
    Document oZespedDoc = null;

    UsersGroup oUsrsGrp = new UsersGroup(oAum, Zesped.getUsersGroup(oAum));
    UsersGroup oOpersGrp = new UsersGroup(oAum, Zesped.getOperatorsGroup(oAum));
   
    SortableList<Document> oLst = oDms.query("DeviceInformationType$brand='TWAIN'");
    if (oLst.isEmpty()) {
      Document oDit = oDms.newDocument(oDms.getDocumentType("DeviceInformationType"), oDms.getRootDocument());
      oDit.attribute("model").set("TWAIN");
      oDit.attribute("brand").set("TWAIN");
      oDit.save("");
      oSess.commit();
      oUsrsGrp.grantReadOnly(oDit);
      oOpersGrp.grantReadOnly(oDit);
      oSess.commit();
    }

    oLst = oDms.query("Endorsement$endorsement_id='01'");
    if (oLst.isEmpty()) {
      Configurations oCnf = null;
      try {
        oCnf = Configurations.top(oSess);
      } catch (ElementNotFoundException enfe) {
        Document oDnf = oDms.newDocument(oDms.getDocumentType("Configurations"), oDms.getRootDocument());
        oDnf.save("");
        oSess.commit();
        oCnf = new Configurations(oDnf);
        oUsrsGrp.grantReadOnly(oDnf);
        oOpersGrp.grantReadOnly(oDnf);
      }
      Document oEns = oDms.newDocument(oDms.getDocumentType("Endorsements"), oCnf.getDocument());
      oEns.save("");
      oSess.commit();
      Document oEnd = oDms.newDocument(oDms.getDocumentType("Endorsement"), oEns);
      oEnd.attribute("endorsement_id").set("01");
      oEnd.attribute("endorsement_mask").set("JJJUUUSSS%03d");
      oEnd.attribute("endorsement_text").set("Ipsa [date_dd/MM/yyyy] [Endorsement.endorsement_mask]");
      oEnd.save("");
      oSess.commit();
    }
   
    try {
      oZespedDoc = Zesped.top(oSess).getDocument();
    } catch (ElementNotFoundException enfe) {
      oZespedDoc = createDocumentOfType(oIdx, oDms, "Zesped", oDms.getRootDocument());   
      oOpersGrp.grantAll(oZespedDoc);
    }
    try {
      Users.top(oSess);
    } catch (ElementNotFoundException enfe) {
      createDocumentOfType(oIdx, oDms, "Users", oZespedDoc);
    }
    try {
      Products.top(oSess);
    } catch (ElementNotFoundException enfe) {
      Document oProds = createDocumentOfType(oIdx, oDms, "Products", oZespedDoc);
      oUsrsGrp.grantReadOnly(oProds);
    }
    try {
      Countries.top(oSess);
    } catch (ElementNotFoundException enfe) {
      Document oCountries = createDocumentOfType(oIdx, oDms, "Countries", oZespedDoc);
      oUsrsGrp.grantReadOnly(oCountries);
    }
    try {
      AccountingAccountsDefaults.top(oSess);
    } catch (ElementNotFoundException enfe) {
      Document oAAccsDefs = createDocumentOfType(oIdx, oDms, "AccountingAccountsDefaults", oZespedDoc);
      oUsrsGrp.grantReadOnly(oAAccsDefs);
    }
    try {
      VatPercents.top(oSess);
    } catch (ElementNotFoundException enfe) {
      Document oVatPcts = createDocumentOfType(oIdx, oDms, "VatPercents", oZespedDoc);
      oUsrsGrp.grantReadOnly(oVatPcts);
    }
     
      oSess.commit();
      oSess.disconnect();
View Full Code Here


    InputStreamReader oRdrEs = new InputStreamReader(oIoEs, "ISO8859_1");
    LineNumberReader oLnEs = new LineNumberReader(oRdrEs);
    String sEs;
    Country oCntr = Countries.top(oSes).getCountry(oSes, sCountryCode);
    States oStts = oCntr.states(oSes);
    Document oCtts;
    do {
      sEs = oLnEs.readLine();
      if (sEs!=null) {
        String[] aEs = sEs.split("\t");
        if (oCitiesCache.containsKey(aEs[0])) {
View Full Code Here

    CaptureTypes oCts = null;
   
    try {
      oCts = CaptureTypes.top(oSes);
    } catch(ElementNotFoundException enfe)   {
      Document dCts = oDms.newDocument(oDms.getDocumentType("CaptureTypes"), oDms.getRootDocument());
      dCts.save("");
      oUsrsGrp.grantReadOnly(dCts);
      oOpersGrp.grantReadOnly(dCts);
      oSes.commit();
      VolumeManager oVolm = oDms.getVolumeManager();
      Volume oVol = DAO.defaultVolume(oVolm);
      oVol.addDocument(dCts);
      oVol.save();
      oSes.commit();
      oCts = new CaptureTypes(dCts);
    }
   
    Document oDoc;
    for (int c=0; c<nCaptureModes; c++) {
      for (int s=0; s<nScanModes; s++) {
        String sCaptureType = aCaptureModes[c]+aScanModes[s];
        oDoc = oCpt.exists(oSes, "name", sCaptureType);
        if (oDoc==null) {
View Full Code Here

        if (sTxpr.length()>0) {
          Dms oDms = getSession().getDms();
            TaxPayer oTxp = new TaxPayer(oDms, sTxpr);
          Employees oEms = oTxp.employees(getSession());
          Employee oEmp = new Employee();
          Document e = oEmp.exists(getSession(), "employee_uuid", oUsr.getNickName());
            if (e!=null) {
            Log.out.debug("Employee already exists");
              oEmp.load(getSession(), e.id());
              if (!oEmp.parentId().equals(oEms.id()))
                oEmp.getDocument().parents().replace(oDms.getDocument(oEmp.parentId()), oDms.getDocument(oEms.id()));
            } else {
            Log.out.debug("Employee does not exist");
              oEmp = new Employee(getSession(), oEms);
View Full Code Here

  public static void reindexAll() throws AuthenticationException, SecuritySystemException, SQLException {
    if (!bInitOK) throw new IllegalStateException("DAO was not properly initialized");
   
    AtrilSession oSess = getSession("reindexAll", oAtrilProperties.getProperty("atril.user"), oAtrilProperties.getProperty("atril.password"));
    Dms oDms = oSess.getDms();
    Document oRoot = oDms.getRootDocument();
    NodeList<Document> oChilds = oRoot.children();
    for (Document c : oChilds) {
      if (c.type().name().equals("Zesped")) {
        reindexDocument(oSess, c);
        break;
      }
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.