Package lotus.domino

Examples of lotus.domino.Item


    }
  }

  public boolean isEmpty(DominoDocument doc, String fieldName) throws Exception {
    if(doc!=null) {
      Item item = doc.getDocument().getFirstItem(fieldName);
      if(item!=null) {
        String content;
        MIMEEntity e = item.getMIMEEntity();
        if(e!=null) {
          content = e.getContentAsText();
        } else {
          content = item.getText();
        }
        if(!StringUtil.isSpace(content)) {
          // Should handle empty json objects/arrays as well
          content = content.trim();
          return content.equals("[]") || content.equals("{}");
View Full Code Here


          flags = StringUtil.splitString(s, ',');
        }
      }
      // Then convert the field
      Object v = toNotesObject(session,e.getValue(),flags);
      Item item = doc.replaceItemValue(k, v);
      if(getItemFilter()!=null && !getItemFilter().accept(item)) {
        item.remove();
      } else {
        processItem(session, doc, item, flags);
      }
    }
  }
View Full Code Here

      return;
    }
    target.startDocument(doc);
    Vector<?> items = doc.getItems();
    for(int i=0; i<items.size(); i++) {
      Item item = (Item)items.get(i);
      exportItem(item);
    }
    target.endDocument();
  }
View Full Code Here

  /** {@inheritDoc} */
  @Override
  public NotesItem getFirstItem(String name)
      throws NotesConnectorExceptionImpl {
    try {
      Item item = getNotesObject().getFirstItem(name);
      if (item == null) {
        return null;
      }
      return new NotesItemImpl(item);
    } catch (NotesException e) {
View Full Code Here

  /** {@inheritDoc} */
  @Override
  public NotesItem replaceItemValue(String name, Object value)
      throws NotesConnectorExceptionImpl {
    try {
      Item item = getNotesObject().replaceItemValue(name,
          TypeConverter.toNotesItemValue(value));
      if (item == null) { // It's not clear if this can happen.
        return null;
      }
      return new NotesItemImpl(item);
View Full Code Here

  /** {@inheritDoc} */
  @Override
  public NotesItem appendItemValue(String name, Object value)
      throws NotesConnectorExceptionImpl {
    try {
      Item item = getNotesObject().appendItemValue(name,
          TypeConverter.toNotesItemValue(value));
      if (item == null) { // It's not clear if this can happen.
        return null;
      }
      return new NotesItemImpl(item);
View Full Code Here

          getLotusId(end);
          DateRange dr = session.createDateRange(dt, end);
          getLotusId(dr);
          Document doc = db.createDocument();
          getLotusId(doc);
          Item i1 = doc.replaceItemValue("Foo", dr);
          getLotusId(i1);
          Item i2 = doc.replaceItemValue("Bar", dr.getText());
          getLotusId(i2);
          Item i3 = doc.replaceItemValue("Blah", dr.getStartDateTime().getLocalTime());
          getLotusId(i3);
          lotus.domino.ColorObject color = session.createColorObject();
          getLotusId(color);
          color.setRGB(128, 128, 128);
          Item i4 = doc.replaceItemValue("color", color.getNotesColor());
          getLotusId(i4);
          i1.recycle();
          i2.recycle();
          i3.recycle();
          i4.recycle();
          DateTime create = doc.getCreated();
          getLotusId(create);
          String lc = create.getLocalTime();
          if (i % 10000 == 0) {
            System.out.println(Thread.currentThread().getName() + " Name " + i + " is " + name.getCommon() + " "
View Full Code Here

      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()));

    } catch (NotesException e) {
      //handle Exception
    }
  }
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

        getLotusId(end);
        DateRange dr = session.createDateRange(dt, end);
        getLotusId(dr);
        Document doc = db.createDocument();
        getLotusId(doc);
        Item i1 = doc.replaceItemValue("Foo", dr);
        getLotusId(i1);
        Item i2 = doc.replaceItemValue("Bar", dr.getText());
        getLotusId(i2);
        Item i3 = doc.replaceItemValue("Blah", dr.getStartDateTime().getLocalTime());
        getLotusId(i3);
        lotus.domino.ColorObject color = session.createColorObject();
        getLotusId(color);
        color.setRGB(128, 128, 128);
        Item i4 = doc.replaceItemValue("color", color.getNotesColor());
        getLotusId(i4);
        i1.recycle();
        i2.recycle();
        i3.recycle();
        i4.recycle();
        DateTime create = doc.getCreated();
        getLotusId(create);
        @SuppressWarnings("unused")
        String lc = create.getLocalTime();
        //          if (i % 10000 == 0) {
View Full Code Here

TOP

Related Classes of lotus.domino.Item

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.