Neither the spec nor OpenCMIS has a "get only custom properties" option.
So, you can either:
- Filter at the CMIS provider specifying a list of custom properties in
the filter input to a service. Note that a provider may return a few
cmis:* properties even if not specified in the filter, or
- Filter on the client side by iterating through the returned properties
ignoring those starting with "cmis:".
Examples of getting some custom properties:
1. Pass a filter to the service, e.g., filter="custom1, custom2":
OperationContext opCtx = session.createOperationContext();
Set<String> filter = new HashSet<String>();
filter.add("custom1");
filter.add("custom2");
opCtx.setFilter(filter);
CmisObject obj = session.getObject(objectId, opCtx);
2. query: "select custom1, custom2 from ..."
3. Filter on the client:
for (Property<?> p : props) {
if (!p.getId().startsWith("cmis")) ...
On Thu, May 3, 2012 at 5:47 AM, learning coding <[email protected]
> wrote:
> Hi ,
>
> i have a issue in CMIS.
> Plz help.
>
> List<Property<?>> props = doc.getProperties();
>
> *for*(Property<?> p : props){
>
> System.*out*.println(p.getDefinition().getDisplayName() + " = " +
> p.getValueAsString());
>
> }
>
> I get all the Custom properties and system properties of the document with
> the above code.
>
> I need only the custom property of the document.
>
> How to do it.
> Plz Help.
>
> Thanks.
>