chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Cheng <christopher.sw.ch...@gmail.com>
Subject getting title and description from document
Date Sun, 31 Jul 2011 10:12:43 GMT
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?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message