Package org.openntf.domino

Examples of org.openntf.domino.Database$Schema


   *
   * @see org.openntf.domino.View#getAllDocuments()
   */
  @Override
  public DocumentCollection getAllDocuments() {
    Database db = getAncestorDatabase();
    DocumentCollection result = db.createDocumentCollection();

    // When it's a folder, there's no selection formula, so do it the "dumb" way for now
    if (isFolder()) {
      // TODO See if there's a better way
      for (ViewEntry entry : getAllEntries()) {
        if (entry.isDocument()) {
          result.add(entry.getDocument());
        }
      }
    } else {
      // According to Tommy Valand's research, the fastest method is to build a NoteCollection with a matching selection formula
      // http://dontpanic82.blogspot.com/2013/06/benchmark-fetching-noteids-and.html
      NoteCollection nc = getNoteCollection();

      int[] nids = nc.getNoteIDs();

      // Arrays.sort(nids);
      // for (org.openntf.domino.Document doc : result) {
      // int nid = Integer.valueOf(doc.getNoteID(), 16);
      // if (!(Arrays.binarySearch(nids, nid) >= 0)) {
      // result.subtract(nid);
      // }
      // }

      // for (int nid : nids) {
      // result.intersect(nid);
      // }

      // TODO due to a bug in 9.0, this is being reverted to highly inefficient behavior...
      for (int nid : nids) {
        Document doc = db.getDocumentByID(Integer.toHexString(nid));
        result.add(doc);
      }
    }
    return result;
  }
View Full Code Here


   *
   * @see org.openntf.domino.View#getDocument()
   */
  @Override
  public Document getDocument() {
    Database parent = this.getParent();
    return parent.getDocumentByUNID(this.getUniversalID());
  }
View Full Code Here

    }
    return super.getDelegate();
  }

  public void resurrect() { // should only happen if the delegate has been destroyed somehow.
    Database db = getAncestorDatabase();
    try {
      lotus.domino.Database d = toLotus(db);
      lotus.domino.View view = d.getView(name_);
      setDelegate(view, 0);
      Factory.recacheLotus(d, this, parent_);
View Full Code Here

  /* (non-Javadoc)
   * @see org.openntf.domino.ext.RichTextDoclink#getDatabase()
   */
  public Database getDatabase() {
    Session session = getAncestorSession();
    Database database = session.getDatabase("", "");
    database.openByReplicaID(getServerHint(), getDBReplicaID());
    return database;
  }
View Full Code Here

   * @see org.openntf.domino.ext.RichTextDoclink#getDocument()
   */
  public org.openntf.domino.Document getDocument() {
    String documentId = getDocUnID();
    if (documentId != null && !documentId.isEmpty()) {
      Database database = getDatabase();
      return database.getDocumentByUNID(documentId);
    }
    return null;
  }
View Full Code Here

   */
  public View getView() {
    String viewId = getViewUnID();
    if (viewId != null && !viewId.isEmpty()) {
      // Use session.resolve to not run afoul of same-named views
      Database database = getDatabase();
      Session session = getAncestorSession();
      String databaseUrl = database.getURL();
      String url = databaseUrl.substring(0, databaseUrl.length() - "?OpenDatabase".length()) + "/" + viewId + "?OpenView";
      return (View) session.resolve(url);

    }
    return null;
View Full Code Here

   * @see org.openntf.domino.Session#getCalendar(lotus.domino.Database)
   */
  @Override
  public NotesCalendar getCalendar(final lotus.domino.Database db) {
    try {
      Database parentDb = null;
      if (db instanceof Database) {
        parentDb = (Database) db;
      } else {
        parentDb = fromLotus(db, Database.SCHEMA, this);
      }
View Full Code Here

   *
   * @see org.openntf.domino.Session#getCurrentDatabase()
   */
  @Override
  public Database getCurrentDatabase() {
    Database result = null;
    try {
      if (currentDatabase_ == null) {
        result = fromLotus(getDelegate().getCurrentDatabase(), Database.SCHEMA, this);
        if (result == null)
          return null;
        String key = result.getFilePath();
        if (result.getServer().length() > 1) {
          key = result.getServer() + "!!" + result.getFilePath();
        }
        databases_.put(key, result);
        currentDatabase_ = result;
      } else {
        result = currentDatabase_;
View Full Code Here

   */
  @Override
  public Document getUserPolicySettings(final String server, final String name, final int type, final String explicitPolicy) {
    try {
      lotus.domino.Document doc = getDelegate().getUserPolicySettings(server, name, type, explicitPolicy);
      Database db = fromLotus(doc.getParentDatabase(), Database.SCHEMA, this);
      return fromLotus(doc, Document.SCHEMA, db);
    } catch (NotesException e) {
      DominoUtils.handleException(e, this);
      return null;

View Full Code Here

   */
  @Override
  public Document getUserPolicySettings(final String server, final String name, final int type) {
    try {
      lotus.domino.Document doc = getDelegate().getUserPolicySettings(server, name, type);
      Database db = fromLotus(doc.getParentDatabase(), Database.SCHEMA, this);
      return fromLotus(doc, Document.SCHEMA, db);
    } catch (NotesException e) {
      DominoUtils.handleException(e, this);
      return null;

View Full Code Here

TOP

Related Classes of org.openntf.domino.Database$Schema

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.