How to filter content for given profiling attribute

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
manojdcoder
Posts: 67
Joined: Thu Oct 29, 2020 12:01 am

How to filter content for given profiling attribute

Post by manojdcoder »

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: 496
Joined: Thu Sep 04, 2014 4:22 pm

Re: How to filter content for given profiling attribute

Post by cristi_talau »

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: 67
Joined: Thu Oct 29, 2020 12:01 am

Re: How to filter content for given profiling attribute

Post by manojdcoder »

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: 490
Joined: Wed May 20, 2009 2:40 pm

Re: How to filter content for given profiling attribute

Post by mihaela »

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: 67
Joined: Thu Oct 29, 2020 12:01 am

Re: How to filter content for given profiling attribute

Post by manojdcoder »

Thank you mihael.

Does Oxygen have something similar for DocBook, filter by profile attributes?
mihaela
Posts: 490
Joined: Wed May 20, 2009 2:40 pm

Re: How to filter content for given profiling attribute

Post by mihaela »

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