Customize Content Completion

Post here questions and problems related to oXygen frameworks/document types.
Denis
Posts: 47
Joined: Thu Jun 19, 2014 3:55 pm

Re: Customize Content Completion

Post by Denis »

Hi,

we are using the Eclipse Oxygen Author in Version 15.2.

What would be the best approach, if I want to extend the content completion. The use case:
I want to create this structure:

Code: Select all

<h1> <p></p></h1>
So everytime, if the author choose a <h1> element, the content completion has to add a <p>-element. The problem is the <p>-elemnt is not required. Also I do not want to make it optional.

Best regards
Denis
Denis Zygann
KGU Consulting GmbH
http://www.kgu-consulting.com
alex_jitianu
Posts: 1016
Joined: Wed Nov 16, 2005 11:11 am

Re: Customize Content Completion

Post by alex_jitianu »

Hello Denis,

The easiest way would be to replace the default entries with author actions. If we were to take your sample as a starting point:
1. you must create an author action. THe action must use the operation ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation and the fragment to insert must be <h1> <p></p></h1>.
2. On the Content Completion page you must add the previously created action in the content completion (select the action in the Available Actions and put it in the Current Actions)
3. In the same Content completion page, remove the default action that adds a h1 element (the one that comes from the schema). To do that you must add an entry in the table Filter - Remove content completion items.
Best regards,
Alex
Post Reply