Multi-operation in authorAction
Posted: Tue Aug 20, 2024 4:54 pm
Hi,
What I want to achieve in the Ixiasoft Web Author is:
1. Check if an element is selected.
2. The element must be "cmd"
3. If so, add an outputclass attribute with value "ABC"
4. Next, at the end of the "cmd" text remove the period (if any) and add text " or"
5. Add a new "info" element after the selected element
6. Add some text to this new "info" element
I am experimenting with these steps in our framework.
- The check on the cmd element works.
- Adding an outputclass works (no.3) OR
- Adding the <info> element works. (no.6)
My problem is, why doesn't it do both?
If I switch the order, then the first operation is handled fine.
What I want to achieve in the Ixiasoft Web Author is:
1. Check if an element is selected.
2. The element must be "cmd"
3. If so, add an outputclass attribute with value "ABC"
4. Next, at the end of the "cmd" text remove the period (if any) and add text " or"
5. Add a new "info" element after the selected element
6. Add some text to this new "info" element
I am experimenting with these steps in our framework.
- The check on the cmd element works.
- Adding an outputclass works (no.3) OR
- Adding the <info> element works. (no.6)
My problem is, why doesn't it do both?
If I switch the order, then the first operation is handled fine.
Code: Select all
<a:authorAction xmlns:a="http://www.oxygenxml.com/ns/author/external-action"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.oxygenxml.com/ns/author/external-action http://www.oxygenxml.com/ns/author/external-action/authorAction.xsd"
id="refactor.first.task.step">
<a:name>Refactor first task step</a:name>
<a:description>In the first task step, if you select the cmd element, do some fun stuff</a:description>
<a:operations>
<a:operation id="InsertFragmentOperation">
<a:xpathCondition>self::cmd</a:xpathCondition>
<a:arguments>
<a:argument name="fragment"><info>Hi there.</info></a:argument>
<a:argument name="insertLocation">..</a:argument>
<a:argument name="insertPosition">After</a:argument>
</a:arguments>
</a:operation>
<a:operation id="ChangeAttributeOperation">
<a:xpathCondition>self::cmd</a:xpathCondition>
<a:arguments>
<a:argument name="name">outputclass</a:argument>
<a:argument name="elementLocation">self::cmd</a:argument>
<a:argument name="value">original_nav</a:argument>
</a:arguments>
</a:operation>
</a:operations>
<a:accessKey/>
<a:accelerator>M1 M2 Y</a:accelerator>
<a:enabledInReadOnlyContext>false</a:enabledInReadOnlyContext>
</a:authorAction>