Package org.openntf.domino

Examples of org.openntf.domino.NoteCollection


   *
   * @see org.openntf.domino.types.Design#getUniversalID()
   */
  @Override
  public String getUniversalID() {
    NoteCollection notes = this.getParent().createNoteCollection(false);
    notes.add(this);
    return notes.getUNID(notes.getFirstNoteID());
  }
View Full Code Here


   */
  @Override
  public int getModifiedNoteCount(final Date since) {
    if (since.after(getAncestorDatabase().getLastModified().toJavaDate()))
      return 0;
    NoteCollection nc = getAncestorDatabase().createNoteCollection(false);
    nc.setSinceTime(since);
    Set<SelectOption> noteClass = new java.util.HashSet<SelectOption>();
    noteClass.add(SelectOption.DOCUMENTS);
    nc.setSelectOptions(noteClass);
    String selectionFormula = getSelectionFormula();
    nc.setSelectionFormula(selectionFormula);
    nc.buildCollection();
    return nc.getCount();
  }
View Full Code Here

   */
  @Override
  public int getModifiedNoteCount(final java.util.Date since, final Set<SelectOption> noteClass) {
    if (since.after(this.getLastModified().toJavaDate()))
      return 0;
    NoteCollection nc = createNoteCollection(false);
    nc.setSinceTime(since);
    nc.setSelectOptions(noteClass);
    nc.buildCollection();
    return nc.getCount();
  }
View Full Code Here

        Documents.saveState(unids, this, itemName, true, headers);

      } else if (value instanceof NoteCollection) {
        // Maybe it'd be faster to use .getNoteIDs - I'm not sure how the performance compares
        // NTF .getNoteIDs() *IS* faster. By about an order of magnitude.
        NoteCollection notes = (NoteCollection) value;
        String[] unids = new String[notes.getCount()];
        String noteid = notes.getFirstNoteID();
        int index = 0;
        while (noteid != null && !noteid.isEmpty()) {
          unids[index++] = notes.getUNID(noteid);
          noteid = notes.getNextNoteID(noteid);
        }
        Map<String, String> headers = new HashMap<String, String>(1);
        headers.put("X-Original-Java-Class", "org.openntf.domino.NoteCollection");
        Documents.saveState(unids, this, itemName, true, headers);

View Full Code Here

  /* (non-Javadoc)
   * @see org.openntf.domino.types.Design#getNoteID()
   */
  @Override
  public String getNoteID() {
    NoteCollection notes = this.getParentDatabase().createNoteCollection(false);
    notes.setSelectOutlines(true);
    notes.setSelectionFormula("$TITLE=\"" + this.getName().replace("\"", "\\\"") + "\"");
    notes.buildCollection();
    return notes.getFirstNoteID();
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.openntf.domino.types.Design#getUniversalID()
   */
  @Override
  public String getUniversalID() {
    NoteCollection notes = this.getParentDatabase().createNoteCollection(false);
    notes.setSelectOutlines(true);
    notes.setSelectionFormula("$TITLE=\"" + this.getName().replace("\"", "\\\"") + "\"");
    notes.buildCollection();
    return notes.getUNID(notes.getFirstNoteID());
  }
View Full Code Here

   *
   * @see org.openntf.domino.types.Design#getNoteID()
   */
  @Override
  public String getNoteID() {
    NoteCollection notes = this.getParent().createNoteCollection(false);
    notes.add(this);
    return notes.getFirstNoteID();
  }
View Full Code Here

   *
   * @see org.openntf.domino.types.Design#getUniversalID()
   */
  @Override
  public String getUniversalID() {
    NoteCollection notes = this.getParent().createNoteCollection(false);
    notes.add(this);
    return notes.getUNID(notes.getFirstNoteID());
  }
View Full Code Here

    }

    String binaryName = DominoUtils.escapeForFormulaString(DominoUtils.javaBinaryNameToFilePath(name, "/"));

    // Check for appropriate design elements in the DB
    NoteCollection notes = design_.getNoteCollection(String.format(
        " @Contains($Flags; 'g') & (@Contains($Flags; '[') | @Contains($Flags; 'K')) & $ClassIndexItem='WEB-INF/classes/%s' ",
        binaryName), EnumSet.of(SelectOption.MISC_FORMAT));
    String noteId = notes.getFirstNoteID();
    if (!noteId.isEmpty()) {
      Document doc = design_.getAncestorDatabase().getDocumentByID(noteId);
      JavaResource res = new JavaResource(doc);
      // Load up our class queue with the data
      unloadedClasses_.putAll(res.getClassData());
      // Now attempt to load the named class
      byte[] classData = unloadedClasses_.remove(name);
      if (classData != null) {
        // It's possible that an old name of the Java class is still lingering in the NSF
        // In that case, we'd reach this point, but not have an actual class available to load
        return defineClass(name, classData, 0, classData.length);
      }
    }

    // It's also possible that it's stored only as a .class file (e.g. secondary, non-inner classes in a .java)
    notes = design_.getNoteCollection(
        String.format(" @Contains($Flags; 'g') & @Contains($Flags; 'C') & $FileNames='WEB-INF/classes/%s' ", binaryName),
        EnumSet.of(SelectOption.MISC_FORMAT));
    noteId = notes.getFirstNoteID();
    if (!noteId.isEmpty()) {
      Document doc = design_.getAncestorDatabase().getDocumentByID(noteId);
      FileResource res = new FileResource(doc);
      byte[] classData = res.getFileData();
      return defineClass(name, classData, 0, classData.length);
View Full Code Here

  /* (non-Javadoc)
   * @see org.openntf.domino.design.DatabaseDesign#getFacesConfig()
   */
  @Override
  public FacesConfig getFacesConfig() {
    NoteCollection notes = getNoteCollection(" @Contains($Flags; 'g') & @Explode($TITLE; '|')='WEB-INF/faces-config.xml'",
        EnumSet.of(SelectOption.MISC_FORMAT));
    String noteId = notes.getFirstNoteID();
    if (!noteId.isEmpty()) {
      Document doc = database_.getDocumentByID(noteId);
      return new FacesConfig(doc);
    }
    return null;
View Full Code Here

TOP

Related Classes of org.openntf.domino.NoteCollection

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.