CMIS Plugin

I'm trying to create a custom query to return the related documents (Joins) in my worklist, so I need to use the “CMIS” standard to ride my Query. I am using the version (Nuxeo 5.8) there is already an plugin by default -> (

I wonder where I need implement this code, as it will be called? It has to do with SecurityPolicy?

Thank you for your attention

0 votes

1 answers



I'm trying to use the SecurityPolicy class override the transform () method, but I need to run my query only for a Document of type (X). Is there another way to solve this?

public static class NoFileTransformer implements SQLQuery.Transformer {

    private static final long serialVersionUID = 1L;
    /** {@code ecm:primaryType <> 'File'} */
    public static final Predicate NO_FILE = new Predicate(
            new Reference(NXQL.ECM_PRIMARYTYPE), Operator.NOTEQ, new StringLiteral("TaskDoc"));

    public SQLQuery transform(Principal principal, SQLQuery query) {
        WhereClause where = query.where;
        Predicate predicate;
        if (where == null || where.predicate == null) {
            predicate = NO_FILE;
        } else {
            // adds an AND ecm:primaryType <> 'File' to the WHERE clause
            predicate = new Predicate(NO_FILE, Operator.AND, where.predicate);
        // return query with updated WHERE clause
        return new SQLQuery(, query.from, new WhereClause(predicate),
                query.groupBy, query.having, query.orderBy, query.limit, query.offset);

You can do CMISQL queries from Java code, see How to make CMISQL queries from Nuxeo.

0 votes

Thanks for the support

Could you tell me how I would call it class with the method by clicking in the document tree?

alt text


I don't understand what you're asking, and if it's unrelated to the original question about doing CMISQL queries then you should ask a new question.

Thanks for the support

Yes, is related to my first question. I want to execute my CMISQL by clicking on the tree above. I wonder how to call this method with my query to list the related documents? I need to execute a listener?