Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleReading a Single Property
ObjectId id = this.session.createObjectId("4711");
Document document = (Document) this.session.getObject(id);
Property<String> p = document.getProperty(CmisProperties.OBJECT_ID.value());

String s = p.getValue();

...

Code Block
titleReading all Properties
ObjectId id = this.session.createObjectId("4711");
Document document = (Document) this.session.getObject(id);
List<Property<?>> l = document.getProperties();
Iterator<Property<?>> i = l.iterator();
while (i.hasNext()) {
  Property<?> p = i.next();
  Object value = p.getValue();
  PropertyType t = p.getType();

  switch (t) {
    case INTEGER:
      Integer n = (Integer) value;
      System.out.println(p.getName() + " = " + n);
      break;
    case STRING:
    [...]
}