Package lotus.domino

Examples of lotus.domino.View


  }

  public void getCreated() {
    try {
      Database currDb = ExtLibUtil.getCurrentDatabase();
      View contacts = currDb.getView("AllContacts");
      Document doc = contacts.getFirstDocument();
      SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy hh:mm");
      String formatted = format.format(doc.getCreated().toJavaDate());
      ExtLibUtil.getViewScope().put("oldJavaTest", formatted);
    } catch (NotesException e) {
      //doSomething
View Full Code Here


  }

  public void getCreatedOld() {
    try {
      Database currDb = ExtLibUtil.getCurrentDatabase();
      View contacts = currDb.getView("AllContacts");
      Document doc = contacts.getFirstDocument();
      SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy hh:mm");
      String formatted = format.format(doc.getCreated().toJavaDate());
      ExtLibUtil.getViewScope().put("oldJavaTest", formatted);
    } catch (NotesException e) {
      //doSomething
View Full Code Here

  }

  public void getOtherDates() {
    try {
      Database currDb = ExtLibUtil.getCurrentDatabase();
      View contacts = currDb.getView("AllContacts");
      Document doc = contacts.getFirstDocument();
      StringBuilder sb = new StringBuilder();
      SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy hh:mm");
      sb.append("Created: " + format.format(doc.getCreated().toJavaDate()));
      sb.append("....");
      String mod = new String();
View Full Code Here

  }

  public void getFormName() {
    try {
      Database currDb = ExtLibUtil.getCurrentDatabase();
      View contacts = currDb.getView("AllContacts");
      Document doc = contacts.getFirstDocument();
      if (doc.hasItem("Form")) {
        ExtLibUtil.getViewScope().put("oldJavaTest", doc.getItemValueString("Form"));
      }
    } catch (NotesException e) {
      //handle Exception
View Full Code Here

  }

  public void getForm() {
    try {
      Database currDb = ExtLibUtil.getCurrentDatabase();
      View contacts = currDb.getView("AllContacts");
      Document doc = contacts.getFirstDocument();
      if (doc.hasItem("Form")) {
        String formName = doc.getItemValueString("Form");
        Form fm = currDb.getForm(formName);
        NoteCollection notes = currDb.createNoteCollection(false);
        notes.add(fm);
View Full Code Here

  }

  public void replaceItemValueSummary() {
    try {
      Database currDb = ExtLibUtil.getCurrentDatabase();
      View contacts = currDb.getView("AllContacts");
      Document doc = contacts.getFirstDocument();
      StringBuilder sb = new StringBuilder();
      sb.append("Here is a value");
      Item itm = doc.replaceItemValue("oldSummaryField", sb.toString());
      ExtLibUtil.getViewScope().put("oldJavaTest",
          doc.getItemValueString("oldSummaryField") + " " + Boolean.toString(itm.isSummary()));
View Full Code Here

  }

  public void breakNames() {
    Database currDb = ExtLibUtil.getCurrentDatabase();
    try {
      View contacts = currDb.getView("AllContacts");
      Document doc = contacts.getFirstDocument();
      Item testItem = doc.replaceItemValue("oldMuppetField", 1);
      testItem.setNames(true);
      doc.save(true, false);
      ExtLibUtil.getViewScope().put("javaTest", testItem.getType());
    } catch (Throwable t) {
View Full Code Here

  }

  public void dateTimeIsBeforeTest() {
    StringBuilder sb = new StringBuilder();
    View threadsByDate = null;
    Document firstDoc = null;
    Document secondDoc = null;
    DateTime firstDate = null;
    DateTime secondDate = null;
    try {
      Session s = ExtLibUtil.getCurrentSession();
      Database currDb = s.getCurrentDatabase();
      threadsByDate = currDb.getView("AllThreadsByDate");
      threadsByDate.setAutoUpdate(false);
      ViewNavigator vNav = threadsByDate.createViewNav();
      vNav.setEntryOptions(lotus.domino.ViewNavigator.VN_ENTRYOPT_NOCOLUMNVALUES);
      Random randomGenerator = new Random();
      int randomInt = randomGenerator.nextInt(20);
      ViewEntry firstEnt = vNav.getNth(randomInt);
      while (!firstEnt.isDocument()) {
        ViewEntry tmpEnt = vNav.getNext();
        firstEnt.recycle();
        firstEnt = tmpEnt;
      }
      randomInt = randomGenerator.nextInt(20);
      ViewEntry secondEnt = vNav.getNth(randomInt);
      while (!secondEnt.isDocument()) {
        ViewEntry tmpEnt = vNav.getNext();
        secondEnt.recycle();
        secondEnt = tmpEnt;
      }
      firstDoc = firstEnt.getDocument();
      secondDoc = secondEnt.getDocument();
      String firstDt = firstDoc.getFirstItem("Date").getText();
      String secondDt = secondDoc.getFirstItem("Date").getText();
      firstDate = s.createDateTime(firstDt);
      secondDate = s.createDateTime(secondDt);
      Date firstDateJ = firstDate.toJavaDate();
      Date secondDateJ = secondDate.toJavaDate();
      sb.append("Comparing " + firstDt + " (" + firstDoc.getUniversalID() + ") with " + secondDt + " ("
          + secondDoc.getUniversalID() + ")...");
      if (firstDateJ.before(secondDateJ)) {
        sb.append("first before second");
      } else {
        sb.append("first NOT before second");
      }
      sb.append("..........................................................................................");
      sb.append("Comparing " + secondDt + " (" + secondDoc.getUniversalID() + ") with " + firstDt + " ("
          + firstDoc.getUniversalID() + ")...");
      if (secondDateJ.before(firstDateJ)) {
        sb.append("second before first");
      } else {
        sb.append("second NOT before first");
      }
    } catch (NotesException e) {
      // doSomething
    } finally {
      try {
        threadsByDate.recycle();
        firstDoc.recycle();
        secondDoc.recycle();
        firstDate.recycle();
        secondDate.recycle();
      } catch (NotesException e) {
View Full Code Here

    ExtLibUtil.getViewScope().put("oldJavaTest", sb.toString());
  }

  public void dateTimeIsAfterTest() {
    StringBuilder sb = new StringBuilder();
    View threadsByDate = null;
    Document firstDoc = null;
    Document secondDoc = null;
    DateTime firstDate = null;
    DateTime secondDate = null;
    try {
      Session s = ExtLibUtil.getCurrentSession();
      Database currDb = s.getCurrentDatabase();
      threadsByDate = currDb.getView("AllThreadsByDate");
      threadsByDate.setAutoUpdate(false);
      ViewNavigator vNav = threadsByDate.createViewNav();
      vNav.setEntryOptions(lotus.domino.ViewNavigator.VN_ENTRYOPT_NOCOLUMNVALUES);
      Random randomGenerator = new Random();
      int randomInt = randomGenerator.nextInt(20);
      ViewEntry firstEnt = vNav.getNth(randomInt);
      while (!firstEnt.isDocument()) {
        ViewEntry tmpEnt = vNav.getNext();
        firstEnt.recycle();
        firstEnt = tmpEnt;
      }
      randomInt = randomGenerator.nextInt(20);
      ViewEntry secondEnt = vNav.getNth(randomInt);
      while (!secondEnt.isDocument()) {
        ViewEntry tmpEnt = vNav.getNext();
        secondEnt.recycle();
        secondEnt = tmpEnt;
      }
      firstDoc = firstEnt.getDocument();
      secondDoc = secondEnt.getDocument();
      String firstDt = firstDoc.getFirstItem("Date").getText();
      String secondDt = secondDoc.getFirstItem("Date").getText();
      firstDate = s.createDateTime(firstDt);
      secondDate = s.createDateTime(secondDt);
      Date firstDateJ = firstDate.toJavaDate();
      Date secondDateJ = secondDate.toJavaDate();
      sb.append("Comparing " + firstDt + " (" + firstDoc.getUniversalID() + ") with " + secondDt + " ("
          + secondDoc.getUniversalID() + ")...");
      if (firstDateJ.after(secondDateJ)) {
        sb.append("first after second");
      } else {
        sb.append("first NOT after second");
      }
      sb.append("..........................................................................................");
      sb.append("Comparing " + secondDt + " (" + secondDoc.getUniversalID() + ") with " + firstDt + " ("
          + firstDoc.getUniversalID() + ")...");
      if (secondDateJ.after(firstDateJ)) {
        sb.append("second after first");
      } else {
        sb.append("second NOT after first");
      }
    } catch (NotesException e) {
      // doSomething
    } finally {
      try {
        threadsByDate.recycle();
        firstDoc.recycle();
        secondDoc.recycle();
        firstDate.recycle();
        secondDate.recycle();
      } catch (NotesException e) {
View Full Code Here

    ExtLibUtil.getViewScope().put("oldJavaTest", sb.toString());
  }

  public void dateTimeEqualsTest() {
    StringBuilder sb = new StringBuilder();
    View threads = null;
    Document firstDoc = null;
    Document secondDoc = null;
    DateTime firstDate = null;
    DateTime secondDate = null;
    try {
      Session s = ExtLibUtil.getCurrentSession();
      Database currDb = s.getCurrentDatabase();
      threads = currDb.getView("AllThreads");
      Random randomGenerator = new Random();
      int randomInt = randomGenerator.nextInt(100);
      firstDoc = threads.getNthDocument(randomInt);
      randomInt = randomGenerator.nextInt(100);
      secondDoc = threads.getNthDocument(randomInt);
      String firstDt = firstDoc.getFirstItem("Date").getText();
      String secondDt = secondDoc.getFirstItem("Date").getText();
      firstDate = s.createDateTime(firstDt);
      secondDate = s.createDateTime(secondDt);
      Date firstDateJ = firstDate.toJavaDate();
      Date secondDateJ = secondDate.toJavaDate();
      sb.append("Comparing " + firstDt + " (" + firstDoc.getUniversalID() + ") with " + secondDt + " ("
          + secondDoc.getUniversalID() + ")...");
      if (firstDateJ.equals(secondDateJ)) {
        sb.append("first is the same date/time as second");
      } else {
        sb.append("first is NOT the same date/time as second");
      }
    } catch (NotesException e) {
      // doSomething
    } finally {
      try {
        threads.recycle();
        firstDoc.recycle();
        secondDoc.recycle();
        firstDate.recycle();
        secondDate.recycle();
      } catch (NotesException e) {
View Full Code Here

TOP

Related Classes of lotus.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.