I wrote this function to retrieve nodes of a custom type I created :
public static List<CmisObject> getQueryResults(String queryString) {
Session session = getSession();
List<CmisObject> objList = new ArrayList<CmisObject>();
CmisObject obj = session.getObjectByPath("/CustomContent/");
Folder f = (Folder) obj;
ItemIterable<CmisObject> items = f.getChildren();
for (CmisObject o : items) {
System.out.println(o.getName() + " which is of type " + o.getType().getDisplayName());
objList.add(o);
}
return objList;
}
how can I get the properties of each node of the cutom type I created ?
When I checked the type of the node, I found it unknown.
Can this code help you?
List<Property<?>> prop = f.getProperties();
for(int i = 0; i < prop.size(); i++) {
if (prop.get(i).getId().equalsIgnoreCase("cm:description") == true) {
if (prop.get(i).getFirstValue() == null) {
break;
}
else if (((String) prop.get(i).getFirstValue()).equalsIgnoreCase("") == false) {
propRoot = propRoot + prop.get(i).getFirstValue().toString() + " & ";
break;
}
}
}
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.