[oXygen-user] recursive author actions

Andreas Wagner Andreas.Wagner at em.uni-frankfurt.de
Mon Mar 31 03:44:47 CDT 2014


Dear all,

I have an author mode action which I want to behave recursively, but 
this does not seem to work. Can I do something about it?

Here is my action/use case: I want to edit TEI xml documents and add 
expansions to abbreviations. When I select a text and trigger my action, 
it surrounds the selected text with an <abbr/> element, adds an <expan/> 
element the content of which is queried in a dialogue box, and surrounds 
both of these elements with a <choice/> element. Now, when someone has 
edited the document before and has marked something as being an 
abbreviation, but has not noted its expansion, the selected text already 
is an <abbr/> element. Using a second action mode and the 
ExecuteMultipleActionsOperation, I want to catch this, strip the <abbr/> 
and re-add it along with the whole rest of the construct.

I know that this is not how to handle such action definitions best, but 
rather than explaining what I have inserted in which dialogue field, I 
post what the action looks like in the framework file (well, somewhat - 
I have left out some parameters):

<action>
  <field name="id">
    <String>choice abbr+expan</String>
  </field>
  ...
  <field name="actionModes">
    <actionMode-array>
      <actionMode>
        <field name="xpathCondition">
          <String>*:abbr</String>
        </field>
        <field name="argValues">
          <map>
            <entry>
              <String>actionIDs</String>
              <String>abbr.dontask
                      choice abbr+expan</String>
              </entry>
          </map>
        </field>
        <field name="operationID">
          <String>ro.sync.ecss.extensions.commons.operations.ExecuteMultipleActionsOperation</String>
        </field>
      </actionMode>
      <actionMode>
        <field name="xpathCondition">
          <String></String>
        </field>
        <field name="argValues">
          <map>
            <entry>
              <String>fragment</String>
              <String>&lt;choice xmlns="http://www.tei-c.org/ns/1.0">&lt;abbr>&lt;/abbr>&lt;expan>${ask('Expansion?', generic)}&lt;/expan>&lt;/choice></String>
            </entry>
          </map>
        </field>
        <field name="operationID">
          <String>ro.sync.ecss.extensions.commons.operations.SurroundWithFragmentOperation</String>
        </field>
      </actionMode>
    </actionMode-array>
  </field>
</action>

(The abbr.dontask action toggles (i.e. removes in this case) the 
surrounding abbr element; and when I use another action in the 
MultipleActions above (say, choice orig+reg), it works fine. It only 
fails to call itself, it seems.)

Thank you for any hint. Best,

Andreas


-- 
Dr. Andreas Wagner
Project "The School of Salamanca"
Academy of Sciences and Literature, Mainz
and Institute of Philosophy
Goethe University Frankfurt
http://salamanca.adwmainz.de

Grüneburgplatz 1 (Pf 116, R. 2.455)
60629 Frankfurt am Main
Tel. +49 (0)69/798-32774
Fax  +49 (0)69/798-32794


More information about the oXygen-user mailing list