AnsweredAssumed Answered

How to return files from folder with secondary type "P:cm:emailed" property only?

Question asked by elcamino on Sep 7, 2018
Latest reply on Sep 7, 2018 by jpotts

Hello

 

There are 300 files inside the folder, 100 files have the P:cm:emailed secondary type property.

Following code takes 30 seconds to run, because Im getting all 300 items, asking each item if you have the P:cm:emailed secondary type property or not.

Would it be possible to return only items with P:cm:emailed secondary type property?

 

OperationContext folderOpCtx = cmisSession.createOperationContext();
folderOpCtx.setFilterString("cmis:secondaryObjectTypeIds");
folderOpCtx.setRenditionFilterString("P:cm:emailed");

Folder folder = (Folder) cmisSession.getObjectByPath(emailFolderPath, folderOpCtx);

for (CmisObject child : children) {
System.out.println(i + " " + child.getName() + " emailed: " +
child.getProperty("cmis:secondaryObjectTypeIds").getValues().contains("P:cm:emailed"));
i++;
}

Outcomes