Instead of using Alfresco API, using Chemistry seems to be a bit more
difficult to get "title" and "description" of the document

for (org.apache.chemistry.opencmis.commons.data.CmisExtensionElement e :
document.getExtensions(org.apache.chemistry.opencmis.commons.enums.ExtensionLevel.PROPERTIES))
{
            for
(org.apache.chemistry.opencmis.commons.data.CmisExtensionElement o :
e.getChildren()) {
                for
(org.apache.chemistry.opencmis.commons.data.CmisExtensionElement e2 :
o.getChildren()) {
                  if ("propertyString".equals(e2.getName())) {
                      if
(e2.getAttributes().get("propertyDefinitionId").equals("cm:title")) {
                            for
(org.apache.chemistry.opencmis.commons.data.CmisExtensionElement e3 :
e2.getChildren()) {
                                if ("value".equals(e3.getName())) {
                                    title = e3.getValue();
                                }
                            }
                        }
                  }
                }
            }
        }

Using Alfresco API, it seems that it's simpler

Node entry1 =
rootNode.getNode("app:company_home/wiki:encyclopedia/wiki:entry1");
String title = entry1.getProperty("cm:title").getString();

Can anybody suggest a less painful way to do this?

Reply via email to