Package org.openntf.domino

Examples of org.openntf.domino.DateTime


    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 + " ("
        + secondDoc.getUniversalID() + ")...");
    if (firstDate.equalsIgnoreDate(secondDate)) {
      sb.append("first is the same time as second");
    } else {
View Full Code Here


    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 + " ("
        + secondDoc.getUniversalID() + ")...");
    if (firstDate.equalsIgnoreTime(secondDate)) {
      sb.append("first is the same date as second");
    } else {
View Full Code Here

    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

      } else if (checkType == Long.TYPE || checkType.equals(Long.class)) {
        defaultValue = 0;
      } else if (checkType.equals(String.class)) {
        defaultValue = "";
      } else if (checkType.equals(DateTime.class)) {
        DateTime dt = doc.getAncestorSession().createDateTime(new Date());
        dt.setAnyDate();
        dt.setAnyTime();
        defaultValue = dt;
      } else {
        defaultValue = null;
      }
    }
View Full Code Here

   */
  @Override
  public DateTime getCreated() {
    try {
      lotus.domino.DateTime dt = getDelegate().getCreated();
      DateTime ret = fromLotus(dt, DateTime.SCHEMA, getAncestorSession());
      s_recycle(dt);
      return ret;
    } catch (NotesException e) {
      DominoUtils.handleException(e, this);
      return null;
View Full Code Here

      } else if (v0 instanceof Date && v1 instanceof Date) {
        Date d0 = (Date) v0;
        Date d1 = (Date) v1;
        result = d0.compareTo(d1);
      } else if (v0 instanceof DateTime && v1 instanceof DateTime) {
        DateTime d0 = (DateTime) v0;
        DateTime d1 = (DateTime) v1;
        result = d0.compareTo(d1);
      } else if (v0 != null && v1 != null) {
        if (v1.getClass() == v0.getClass() && Comparable.class.isAssignableFrom(v0.getClass())) {
          result = ((Comparable) v0).compareTo(v1);
        }
View Full Code Here

      } else if (v0 instanceof Date && v1 instanceof Date) {
        Date d0 = (Date) v0;
        Date d1 = (Date) v1;
        result = d0.compareTo(d1);
      } else if (v0 instanceof DateTime && v1 instanceof DateTime) {
        DateTime d0 = (DateTime) v0;
        DateTime d1 = (DateTime) v1;
        result = d0.compareTo(d1);
      } else if (v0 != null && v1 != null) {
        if (v0 instanceof Comparable && v1 instanceof Comparable) {
          result = ((Comparable) v0).compareTo(v1);
        }
View Full Code Here

   * @param sinceDate
   *            Date since when documents should have been modified
   * @since org.openntf.domino 1.0.0
   */
  public void processSince(final Database sourceDb, final Date sinceDate) {
    DateTime dt = sourceDb.getAncestorSession().createDateTime(sinceDate);
    DocumentCollection sourceCollection = sourceDb.getModifiedDocuments(dt, ModifiedDocClass.DATA);
    process(sourceCollection);
  }
View Full Code Here

   * @param formName
   *            String form name to restrict DocumentCollection to
   * @since org.openntf.domino 1.0.0
   */
  public void processSince(final Database sourceDb, final Date sinceDate, final String formName) {
    DateTime dt = sourceDb.getAncestorSession().createDateTime(sinceDate);
    DocumentCollection sourceCollection = sourceDb.getModifiedDocuments(dt, ModifiedDocClass.DATA);
    sourceCollection.FTSearch("[Form] = \"" + formName + "\"");
    process(sourceCollection);
  }
View Full Code Here

    }
    for (Document source : coll) {
      if (getTransactionRule() == TransactionRule.COMMIT_EVERY_SOURCE) {
        txn = targetDb.startTransaction();
      }
      DateTime sourceLastMod = source.getLastModified();
      // Object lookupKey = Factory.wrappedEvaluate(session, getSourceKeyFormula(), source);
      Object lookupKey = getSourceKeyFormula().getValue(source);
      DocumentCollection targetColl = targetView.getAllDocumentsByKey(lookupKey, true);
      for (Document target : targetColl) {
        // boolean targetDirty = false;
        for (Map.Entry<Formula, String> entry : getSyncMap().entrySet()) {
          String targetItemName = entry.getValue();
          java.util.Vector<?> sourceValue = entry.getKey().getValue(source);
          // Factory.wrappedEvaluate(session, entry.getKey(), source);
          if (strategy == Strategy.CREATE_AND_REPLACE) {
            target.replaceItemValue(targetItemName, sourceValue);
            // targetDirty = true;
          } else {
            Item targetItem = target.getFirstItem(targetItemName);
            if (strategy == Strategy.REPLACE_IF_NEWER) {
              DateTime itemLastMod = targetItem.getLastModified();
              if (sourceLastMod.isAfter(itemLastMod)) {
                targetItem.setValues(sourceValue);
                // targetDirty = true;
              }
            } else if (strategy == Strategy.REPLACE_ONLY) {
View Full Code Here

TOP

Related Classes of org.openntf.domino.DateTime

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.