Package org.openntf.domino

Examples of org.openntf.domino.View


  public void dateTimeEqualsIgnoreDateTest() {
    StringBuilder sb = new StringBuilder();
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View threads = currDb.getView("AllThreads");
    Random randomGenerator = new Random();
    int randomInt = randomGenerator.nextInt(100);
    Document firstDoc = threads.getNthDocument(randomInt);
    randomInt = randomGenerator.nextInt(100);
    Document secondDoc = threads.getNthDocument(randomInt);
    String firstDt = firstDoc.getFirstItem("Date").getText();
    String secondDt = secondDoc.getFirstItem("Date").getText();
    DateTime firstDate = s.createDateTime(firstDt);
    DateTime secondDate = s.createDateTime(secondDt);
    sb.append("Comparing " + firstDt + " (" + firstDoc.getUniversalID() + ") with " + secondDt + " ("
View Full Code Here


  public void dateTimeEqualsIgnoreTimeTest() {
    StringBuilder sb = new StringBuilder();
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View threads = currDb.getView("AllThreads");
    Random randomGenerator = new Random();
    int randomInt = randomGenerator.nextInt(100);
    Document firstDoc = threads.getNthDocument(randomInt);
    randomInt = randomGenerator.nextInt(100);
    Document secondDoc = threads.getNthDocument(randomInt);
    String firstDt = firstDoc.getFirstItem("Date").getText();
    String secondDt = secondDoc.getFirstItem("Date").getText();
    DateTime firstDate = s.createDateTime(firstDt);
    DateTime secondDate = s.createDateTime(secondDt);
    sb.append("Comparing " + firstDt + " (" + firstDoc.getUniversalID() + ") with " + secondDt + " ("
View Full Code Here

  public void getProcessedDate() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    Utils.addAllListeners(currDb);
    View threads = currDb.getView("AllContacts");
    Document doc = threads.getFirstDocument();
    DateTime dt = s.createDateTime(new Date());
    doc.put("testDate", dt);
    doc.save(true, false);
    ExtLibUtil.getViewScope().put("javaTest", doc.get("testDate").toString());
  }
View Full Code Here

    }
    return indexDb_;
  }

  protected void initIndexDb() {
    View indexView = getIndexDb().getView(TERM_VIEW_NAME);
    if (indexView == null) {
      indexView = getIndexDb().createView(TERM_VIEW_NAME, "Form=\"" + TERM_FORM_NAME + "\"");
      for (ViewColumn column : indexView.getColumns()) {
        column.setFormula(TERM_KEY_NAME);
        column.setTitle("Term");
        column.setSorted(true);
        column.setSortDescending(false);
      }
    }
    View dbView = getIndexDb().getView(DB_VIEW_NAME);
    if (dbView == null) {
      dbView = getIndexDb().createView(DB_VIEW_NAME, "Form=\"" + DB_FORM_NAME + "\"");
      for (ViewColumn column : dbView.getColumns()) {
        column.setFormula(DB_KEY_NAME);
        column.setTitle("ID");
        column.setSorted(true);
        column.setSortDescending(false);
      }
      ViewColumn titleColumn = dbView.createColumn();
      titleColumn.setFormula(DB_TITLE_NAME);
      titleColumn.setTitle("TITLE");

    }
  }
View Full Code Here

  public View getView(final String name) {
    try {
      if (!getDelegate().isOpen()) {
        getDelegate().open();
      }
      View result = fromLotus(getDelegate().getView(name), View.SCHEMA, this);
      if (result != null) {
        if (getAncestorSession().isFixEnabled(Fixes.VIEW_UPDATE_OFF)) {
          result.setAutoUpdate(false);
        }
      }
      return result;
    } catch (NotesException e) {
      DominoUtils.handleException(e, this);
View Full Code Here

  private int index_ = -1;

  @Override
  public int getIndex() {
    if (index_ == -1) {
      View view = getParent();
      Vector<org.openntf.domino.ViewColumn> columns = view.getColumns();
      for (int i = 0; i < columns.size(); i++) {
        if (this.equals(columns.get(i))) {
          index_ = i;
          break;
        }
View Full Code Here

   * <li>null as parameter is less problematic than a Vector that was forced in a String variable</li>
   * <li>Throwing an exception does not generate a return value that will be forced in a ViewEntry</li>
   * </ul>
   */
  private void verifyIGetEntryByKey() {
    @SuppressWarnings("deprecation")
    View dummyView = new org.openntf.domino.impl.View();
    try {
      BackendBridge.getViewEntryByKeyWithOptions(dummyView, null, 42);
    } catch (BackendBridgeSanityCheckException allGood) {
      System.out.println("Operation of BackendBridge.getViewEntryByKeyWithOptions verified");
View Full Code Here

        if (s == null || (iDB = s.getDatabase(iDBServer, iDBPath)) == null) {
          System.err.println("RawMessageProviderDBImpl: Can't open DB " + iDBServer + "!!" + iDBPath);
          return;
        }
      }
      View v = iDB.getView(iLookupView);
      if (v == null)
        return;
      v.setAutoUpdate(false);
      ViewNavigator nav = v.createViewNav();
      for (ViewEntry ve = nav.getFirst(); ve != null; ve = nav.getNext())
        oneDBMsgText(ve);
    } catch (Throwable t) {
      t.printStackTrace();
    } finally {
View Full Code Here

        session_ = Factory.fromLotus(parent.getParent(), Session.SCHEMA, null); // FIXME NTF - this is suboptimal,
        database_ = Factory.fromLotus(parent, Database.SCHEMA, session_);
        // but we still need to
        // sort out the parent/child pattern
      } else if (collection instanceof ViewEntryCollection) {
        View vw = ((ViewEntryCollection) collection).getParent();
        database_ = vw.getParent();
        session_ = Factory.getSession(database_);
      }
      if (database_ != null) {
        setDatabase(database_);
      }
View Full Code Here

        session_ = Factory.fromLotus(parent.getParent(), Session.SCHEMA, null); // FIXME NTF - this is suboptimal,
        database_ = Factory.fromLotus(parent, Database.SCHEMA, session_);
        // but we still need to
        // sort out the parent/child pattern
      } else if (collection instanceof ViewEntryCollection) {
        View vw = ((ViewEntryCollection) collection).getParent();
        database_ = vw.getParent();
        session_ = Factory.getSession(database_);
      }
      if (database_ != null) {
        setDatabase(database_);
      }
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.