Package org.openntf.domino

Examples of org.openntf.domino.Document


  public void getFormName() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Document doc = contacts.getFirstDocument();
    ExtLibUtil.getViewScope().put("javaTest", doc.getFormName());
  }
View Full Code Here


  public void getForm() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Document doc = contacts.getFirstDocument();
    ExtLibUtil.getViewScope().put("javaTest", doc.getForm().getNoteID());
  }
View Full Code Here

  public void replaceItemValueSummary() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Utils.addAllListeners(currDb);
    Document doc = contacts.getFirstDocument();
    StringBuilder sb = new StringBuilder();
    sb.append("Here is a value");
    Item itm = doc.replaceItemValue("summaryField", sb, true);
    doc.save(true, false);
    ExtLibUtil.getViewScope().put("javaTest", doc.get("summaryField") + " " + Boolean.toString(itm.isSummary()));
  }
View Full Code Here

  public void createNathan() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    Utils.addAllListeners(currDb);
    Document contact = currDb.createDocument("Form", "Contact", "FirstName", "Nathan", "LastName", "Freeman",
        "Email", "godOfAwesome@worldOfAweso.me", "City", "Washington", "State", "WA");
    contact.save();
    ExtLibUtil.getViewScope().put("javaTest", contact.getNoteID());
  }
View Full Code Here

    fieldsMap.put("FirstName", "Paul");
    fieldsMap.put("LastName", "Withers");
    fieldsMap.put("Email", "lordOfPrettyGood@worldOfAweso.me");
    fieldsMap.put("City", "Washington");
    fieldsMap.put("State", "WA");
    Document contact = currDb.createDocument(fieldsMap);
    contact.save();
    ExtLibUtil.getViewScope().put("javaTest", contact.getNoteID());
  }
View Full Code Here

              }
              if (rawReleaseDate.length() > 3 && !rawReleaseDate.startsWith("?")) {
                releaseYear = Integer.valueOf(rawReleaseDate.substring(0, 4).trim());
              }
              Document doc = db.getDocumentWithKey(entryKey, true);
              doc.replaceItemValue("StartDate", expectedFilmDate);
              doc.replaceItemValue("Title", expectedTitle);
              doc.replaceItemValue("Type", entryType);
              doc.replaceItemValue("EpisodeTitle", episodeTitle);
              doc.replaceItemValue("EpisodeNumber", episodeNumber);
              doc.replaceItemValue("SeasonNumber", seasonNumber);
              doc.replaceItemValue("ShowNumber", showNumber);
              doc.replaceItemValue("ReleaseYear", releaseYear);
              doc.save();
            } catch (Throwable t) {
              System.out.println("Exception processing line: " + curLine);
              t.printStackTrace();
            }
          }
View Full Code Here

  public void setDateField() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Utils.addAllListeners(currDb);
    Document doc = contacts.getFirstDocument();
    doc.put("javaDateField", new Date());
    doc.save(true, false);
    ExtLibUtil.getViewScope().put("javaTest", doc.get("javaDateField"));
  }
View Full Code Here

  public void setFormulaField() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Utils.addAllListeners(currDb);
    Document doc = contacts.getFirstDocument();
    Formula fm = new Formula("@DocumentUniqueID");
    doc.put("javaFormulaField", "Document UNID is " + fm.getValue(doc));
    doc.save(true, false);
    ExtLibUtil.getViewScope().put("javaTest", doc.get("javaFormulaField"));
  }
View Full Code Here

                System.out.println("Processing plot for " + movieCount + ": " + rawMovieTitle + " (" + lineCount
                    + " lines)");
              }
              if (!rawMovieTitle.equalsIgnoreCase(lastTitle)) {
                movieCount++;
                Document doc = db.getDocumentWithKey(rawMovieTitle, false);
                if (doc != null) {
                  doc.replaceItemValue("Genres", genres);
                  doc.save();
                } else {
                  exceptionCount++;
                }
                lastTitle = rawMovieTitle;
                genres = new ArrayList<String>();
View Full Code Here

                curPlot.append(" ");
              } else if (curLine.startsWith("BY:")) {
                String byLine = curLine.substring(3).trim();
                plots.put(byLine, curPlot.toString());
              } else if (curLine.startsWith("------")) {
                Document doc = db.getDocumentWithKey(expectedTitle, false);
                if (doc != null) {
                  int plotNumber = 0;
                  for (String author : plots.keySet()) {
                    plotNumber++;
                    doc.replaceItemValue("plot_" + plotNumber, plots.get(author));
                    doc.replaceItemValue("author_" + plotNumber, author);
                  }
                  doc.save();
                } else {
                  //                  System.out.println("Unable to find movie doc with key: " + expectedTitle);
                  exceptionCount++;
                }
                expectedTitle = null;
View Full Code Here

TOP

Related Classes of org.openntf.domino.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.