Package org.openntf.domino

Examples of org.openntf.domino.View


  // ===================================================================

  private static final boolean UNIQUE_USERS = true;

  void createUsers(Database db) throws IOException {
    View w = db.getView("AllContacts");
    w.getAllEntries().removeAll(true);

    String[] firstNames = SampleDataUtil.readFirstNames();
    String[] lastNames = SampleDataUtil.readLastNames();
    String[] cities = SampleDataUtil.readCities();
View Full Code Here


  // ===================================================================
  // US States
  // ===================================================================

  void createStates(Database db) throws IOException {
    View w = db.getView("AllStates");
    w.getAllEntries().removeAll(true);

    String[] states = SampleDataUtil.readStates();

    for (int i = 0; i < states.length; i++) {
      String[] s = StringUtil.splitString(states[i], ',');
View Full Code Here

    // Construct a list of authors
    // As we want the tag cloud to render differences between the authors, we give
    // as different weight to each author by adding it a random # of times in the list
    // We read the author names from the database
    ArrayList<String> users = new ArrayList<String>();
    View authorView = db.getView("AllContacts");
    authorView.refresh();
    int maxAuthors = 15;
    int nAuthor = 0;
    ViewEntryCollection ec = authorView.getAllEntries();
    for (ViewEntry e : ec) {
      Vector<?> values = e.getColumnValues();
      String name = (String) values.get(7);
      // Add it a random number of times to the list
      int n = ((int) (Math.random() * maxAuthors)) + 1;
      for (int jj = 0; jj < n; jj++) {
        users.add(name);
      }
      nAuthor++;
      if (nAuthor > maxAuthors) {
        break;
      }
    }
    if (users.size() == 0) {
      // Just in case they were not created...
      users.add("John Doe");
    }

    View w = db.getView("AllThreads");
    w.getAllEntries().removeAll(true);
    createDiscussionDocument(db, null, users, new int[] { 0 }, disc_rootDocs);
  }
View Full Code Here

  // ===================================================================
  // All Types
  // ===================================================================

  void createAllTypes(Database db) throws IOException {
    View w = db.getView("AllTypes");
    w.getAllEntries().removeAll(true);

    for (int i = 1; i < 25; i++) {
      createAllType(db, i);
    }
  }
View Full Code Here

      date = new Date();
      retVal += "<br/>Starting OpenNTF version..." + date.toString();
      Session currSess = Factory.getSession();
      Database currDb = currSess.getCurrentDatabase();
      Utils.addAllListeners(currDb);
      View contactsView = currDb.getView("AllContacts");
      for (ViewEntry ent : contactsView.getAllEntries()) {
        DateTime dt = currSess.createDateTime(new Date());
        Document doc = ent.getDocument();
        doc.replaceItemValue("testDate", dt);
        doc.save(true, false);
      }
View Full Code Here

    XspOpenLogUtil.logError(new Throwable("This is a test of XspOpenLogUtil"));
  }

  public static void openLogUtilTest() {
    Database db = Factory.getSession().getCurrentDatabase();
    View view = db.getView("allStates");
    Document doc = view.getFirstDocument();
    XspOpenLogUtil.getXspOpenLogItem().logEvent(null, "Test message", Level.FINE, doc);
  }
View Full Code Here

      if ("".equals(selVal)) {
        ExtLibUtil.getViewScope().put("javaTest", "First select a value");
        return;
      }
      sb.append("Starting update with " + selVal);
      View view = db.getView("allStates");
      Document state = view.getFirstDocumentByKey(selVal, true);
      state.replaceItemValue("txnTest", new Date());
      sb.append("...Updated State pending committal, value is " + state.get("txnTest").toString());
      View contacts = db.getView("AllContactsByState");
      DocumentCollection dc = contacts.getAllDocumentsByKey(selVal, true);
      for (Document doc : dc) {
        if (toggle) {
          doc.replaceItemValue("txnTest", new Date());
          count += 1;
        }
View Full Code Here

  public static void contactScannerMap() {
    DocumentScanner scanner = new DocumentScanner();
    scanner.setIgnoreDollar(true);

    Database db = Factory.getSession().getCurrentDatabase();
    View contacts = db.getView("AllContacts");
    for (ViewEntry ent : contacts.getAllEntries()) {
      scanner.processDocument(ent.getDocument());
    }

    ExtLibUtil.getViewScope().put("scannerFieldTokenMap", scanner.getFieldTokenMap());
    ExtLibUtil.getViewScope().put("scannerFieldValueMap", scanner.getFieldValueMap());
View Full Code Here

      NoteCollection nc = db.createNoteCollection(false);
      nc.buildCollection();
      iterateSecondReferences(secondReference);
      iterateThirdReferences();

      View view = db.getView("NameMessageEventMessages");
      List<String> keys = new ArrayList<String>();
      keys.add("Mail");
      keys.add("2");
      DocumentCollection dc = view.getAllDocumentsByKey(keys, false);
      System.out.println("dc: " + dc.getCount());
      StringBuilder sbc = new StringBuilder();
      for (Document doc : dc) {
        sbc.append(doc.getNoteID());
      }

      //      System.out.println("nids: " + sbc.toString());

      DocumentCollection allViewDocs = view.getAllDocuments();
      System.out.println("all view docs: " + allViewDocs.getCount());

      long elapsed = System.nanoTime() - start;
      StringBuilder sb = new StringBuilder();
      sb.append("Thread " + Thread.currentThread().getName());
View Full Code Here

    @Override
    public void run() {

      Session s = Factory.getSession();
      Database source = s.getDatabase("", TARGET, true);
      View view = source.getView(VIEW);
      System.out.println("-- START --");
      long start = System.nanoTime();

      if (null != view) {
        view.setAutoUpdate(false);

        System.out.println(view.getEntryCount());

        ViewNavigator nav = view.createViewNav();
        // nav.setCacheSize(400);
        nav.skip(1000000);

        System.out.println("CacheSize: " + nav.getCacheSize());

        view.setAutoUpdate(true);
        ViewEntry entry = null;
        entry = nav.getFirst();
        while (null != entry) {
          entry = nav.getNext(entry);
        }
View Full Code Here

TOP

Related Classes of org.openntf.domino.View

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.