How to filter content for given profiling attribute

manojdcoder
Posts: 63
Joined: Thu Oct 29, 2020 12:01 am

How to filter content for given profiling attribute

Post by manojdcoder » Wed Jan 06, 2021 7:07 pm

Is it possible to filter document content by one or more profiling attributes?

For example if I have content for two different country, I would like to allow user to filter content for one country, so the other one is hidden.

cristi_talau
Posts: 329
Joined: Thu Sep 04, 2014 4:22 pm

Re: How to filter content for given profiling attribute

Post by cristi_talau » Wed Jan 06, 2021 8:01 pm

Hello,

You can filter the content by specifying a DITAVAL file as an URL parameter, or by using the JS API [1].

The default behavior is to render the excluded content with low opacity. You can add a custom CSS in the Web Author UI [2] to specify a different style for elements with "oxy-filtered" class, for example to hide them. Note however that this CSS class is not API and is possible to change in a future version. However, at some point we will also offer the option to hide excluded content, so you will not have to use this class anymore.

Best,
Cristian

[1] https://www.oxygenxml.com/doc/versions/ ... e-cms.html
[2] https://www.oxygenxml.com/doc/versions/ ... 3j_p1x_3bb

manojdcoder
Posts: 63
Joined: Thu Oct 29, 2020 12:01 am

Re: How to filter content for given profiling attribute

Post by manojdcoder » Thu Jan 07, 2021 1:46 am

Lets say we have an editor action in the toolbar using which user can pick the attributes he wants to show / hide.
Is it possible to pass the DITAVAL content as parameters instead of file url? Would you suggest implementing a servlet that would return the DITAVAL content?

mihaela
Posts: 251
Joined: Wed May 20, 2009 2:40 pm

Re: How to filter content for given profiling attribute

Post by mihaela » Thu Jan 07, 2021 3:50 pm

Hello,

There is no parameter available to provide the DITAVAL content, you can only provide the URL of a DITAVAL file. The solution you suggested seems right.

Best regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com

manojdcoder
Posts: 63
Joined: Thu Oct 29, 2020 12:01 am

Re: How to filter content for given profiling attribute

Post by manojdcoder » Thu Jan 07, 2021 6:02 pm

Thank you mihael.

Does Oxygen have something similar for DocBook, filter by profile attributes?

mihaela
Posts: 251
Joined: Wed May 20, 2009 2:40 pm

Re: How to filter content for given profiling attribute

Post by mihaela » Fri Jan 08, 2021 3:24 pm

Hi,

There is no URL parameter similar with ditaval for DocBook, but you can implement that functionality using the current API: you can set a pseudo pseudo-class on the root XML element describing which are the attribute values to be searched to show or hide elements using CSS. Here is a forum post that explain how you can do this (the post contains a DITA sample, but it is similar for DocBook):
topic14410.html#p42512
This approach is suitable for the case when you want to dynamically change the profiling information.

If you need to impose the initial profiling conditions you can use the following API added on 23.0 that alloows you to set various pseudo classes to elements before the content is presented visually:
https://www.oxygenxml.com/InstData/Edit ... essor.html

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com

Post Reply