Author mode - run actions on insert of element

Are you missing a feature? Request its implementation here.
honyk
Posts: 176
Joined: Wed Apr 29, 2009 4:55 pm

Author mode - run actions on insert of element

Post by honyk »

Hello,

it would be nice to extend current functionality and to allow running of actions beside shortcut also on insert of specified element. If now there is inserted itemizedlist element into docbook document manually, you have to add also nested listitem and para elements. All these elements can be inserted automatically via action. I'd suggest adding extra column into Document Type Association|Author|Action table in Preferences dialog. In this column control elements would be specified. If such element would be inserted manually, action would be performed. As current action inserts also already inserted 'root' element, there would be necessary new set of actions inserting only child elements. In ideal case current action could be used and stripping of 'root' element would be performed automatically. Or it could be set via another extra column in above mentioned table, where would be settings 'strip root element' (true/false).

Jan
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Author mode - run actions on insert of element

Post by sorin_ristache »

Hello,

You can set the child elements that are inserted together with the element that you select in the content completion popup window in Author mode with an extension class of type Content completion handler. You can set the class name in the field Content completion handler on the Extensions tab of the dialog for editing a document type (this is the deprecated way) or you can integrate it with the extension bundle of that document type which is set on the same Extensions tab of the document type edit dialog.

In your content completion handler which is an implementation of ro.sync.contentcompletion.xml.SchemaManagerFilter (see the documentation in Author SDK) you have to modify the content of the CIElement object representing itemizedlist in the list of CIElement objects received by filterElements() so that the method getGuessElements() of that CIElement returns a new CIElement that represents listitem (the child element that you want to insert automatically in the Author document when itemizedlist is inserted using the popup window).


Regards,
Sorin
Post Reply