cancel
Showing results for 
Search instead for 
Did you mean: 

HiddenInNavigation in nxql result

Ahmad_Ben_Maall
Star Contributor
Star Contributor

Hello, Is there a way to not list the documents with the facet "HiddenInNavigation" in the result of nxql.

Scenario:

1- Add the "HiddenInNavigation" facet dynamically (via a operation which calls the 'document.addfacet' method).

2- search via the search menu.

-> result: the document is not listed

3- search via an nxql request with mixinType! = 'HiddenInNavigation'

-> result: the document is listed.

Thank you.

1 ACCEPTED ANSWER

Rodri_
Star Contributor
Star Contributor

Hello,

I think there is not any way of doing that. From the documentation:

ecm:mixinType: a list of the document facets (DocumentModel.getFacets()) with some restrictions. 1. the facet Immutable is never seen. 2. the facets Folderish and HiddenInNavigation are never seen on document instances (only if they're on the type). 3. like for other list properties, it can be used only with operators =, <>, IN and NOT IN.

Link: https://doc.nuxeo.com/nxdoc/nxql/#special-nxql-properties

That's why using the "ecm:mixinType != 'HiddenInNavigation'" doesn't work, and the documents appear in the NXQL query.

A possible approach could be to define your own facet. Just read this for more information about creating facets: https://doc.nuxeo.com/studio/how-to-create-and-use-document-facets/

After creating the new facet (let's say, "CustomNXQLFacet"), you can add the "HiddenInNavigation" facet along with "CustomNXQLFacet" facet, and include it in the NXQL query: "... AND ecm:mixinType != 'CustomNXQLFacet'".

Regards.

View answer in original post

2 REPLIES 2

Rodri_
Star Contributor
Star Contributor

Hello,

I think there is not any way of doing that. From the documentation:

ecm:mixinType: a list of the document facets (DocumentModel.getFacets()) with some restrictions. 1. the facet Immutable is never seen. 2. the facets Folderish and HiddenInNavigation are never seen on document instances (only if they're on the type). 3. like for other list properties, it can be used only with operators =, <>, IN and NOT IN.

Link: https://doc.nuxeo.com/nxdoc/nxql/#special-nxql-properties

That's why using the "ecm:mixinType != 'HiddenInNavigation'" doesn't work, and the documents appear in the NXQL query.

A possible approach could be to define your own facet. Just read this for more information about creating facets: https://doc.nuxeo.com/studio/how-to-create-and-use-document-facets/

After creating the new facet (let's say, "CustomNXQLFacet"), you can add the "HiddenInNavigation" facet along with "CustomNXQLFacet" facet, and include it in the NXQL query: "... AND ecm:mixinType != 'CustomNXQLFacet'".

Regards.

many thanks

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.