Getting the currently applied profiling configuration programatically for use in Author Actions
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 25
- Joined: Thu Aug 07, 2014 3:40 pm
Getting the currently applied profiling configuration programatically for use in Author Actions
Post by Bruno.Ballarin »
Hi,
when executing some Dita custom Author actions on a currently opened dita topic, is there a way to retrieve programmatically the profiling scheme that is currently applied on the opened Dita topic?
The rationale:
When selecting a pool of elements with an xpath to perform a custom operation, it seems that all the selected elements are affected by the operation, even the ones that are excluded under the currently applied profiling scheme.
For instance lets assume I am selecting with an Xpath all the rows in a table in order to apply a custom action. In the example below, 3 rows are selected, 2 of them with profiling attribute "GENERIC_A" and 1 with profiling attribute "GENERIC_B":
Now lets assume I am applying a profiling scheme on this topic with the following ditaval:
It results in having the first 2 rows rendered and the 3rd row hidden.
Now if I execute a custom operation on all selected rows, the action affects all 3 rows even if the 3rd row is hidden under the current profiling scheme.
If I would like to only affect the visible rows, I could statically select only the rows with otherprops="GENERIC_A">.
But what if I would like my custom operation to automatically detect the currently applied profiling scheme?
when executing some Dita custom Author actions on a currently opened dita topic, is there a way to retrieve programmatically the profiling scheme that is currently applied on the opened Dita topic?
The rationale:
When selecting a pool of elements with an xpath to perform a custom operation, it seems that all the selected elements are affected by the operation, even the ones that are excluded under the currently applied profiling scheme.
For instance lets assume I am selecting with an Xpath all the rows in a table in order to apply a custom action. In the example below, 3 rows are selected, 2 of them with profiling attribute "GENERIC_A" and 1 with profiling attribute "GENERIC_B":
Code: Select all
<row otherprops="GENERIC_A">
<entry >cell_content</entry>
<entry >cell_content</entry>
</row>
<row otherprops="GENERIC_A">
<entry >cell_content</entry>
<entry >cell_content</entry>
</row>
<row otherprops="GENERIC_B">
<entry >cell_content</entry>
<entry >cell_content</entry>
</row>
Code: Select all
<prop att="otherprops" val="GENERIC_A" action="include"/>
<prop att="otherprops" val="GENERIC_B" action="exclude""/>
Now if I execute a custom operation on all selected rows, the action affects all 3 rows even if the 3rd row is hidden under the current profiling scheme.
If I would like to only affect the visible rows, I could statically select only the rows with otherprops="GENERIC_A">.
But what if I would like my custom operation to automatically detect the currently applied profiling scheme?
- Is there a way to retrieve programmatically the "include" or "exclude" profiling configuration applied on an otherprops attribute for the currently opened topic?
- If not, is there a way to programmatically retrieve the profiling from the ditaval if both the ditaval and the topic are associated in the same map?
Re: Getting the currently applied profiling configuration programatically for use in Author Actions
Hi Bruno,
Maybe you could try to use something like this:
authorAccess.getEditorAccess().getStyles(node).isFilteredOut()
on each node that you want to process.
Regards,
Radu
Maybe you could try to use something like this:
authorAccess.getEditorAccess().getStyles(node).isFilteredOut()
on each node that you want to process.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 25
- Joined: Thu Aug 07, 2014 3:40 pm
Re: Getting the currently applied profiling configuration programatically for use in Author Actions
Post by Bruno.Ballarin »
Perfect, thank you.
Bruno
Code: Select all
InRow = authorAccess.getDocumentController().findNodesByXPath("/topic/abstract/table/tgroup/tbody/row", true, true, true);
for(i = 0; i < InRow.length; i++){
if (!authorAccess.getEditorAccess().getStyles(InRow[i]).isFilteredOut()) {
// my processing here (applied to only the rows that are not excluded by my profiling configuration)
}
}
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service