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 -> (http://doc.nuxeo.com/display/public/NXDOC/CMIS+for+Nuxeo).

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

789 views

ANSWER

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"));

    @Override
    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.select, query.from, new WhereClause(predicate),
                query.groupBy, query.having, query.orderBy, query.limit, query.offset);
    }
}
07/23/2014



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

08/05/2014

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.
08/05/2014

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?

08/06/2014