Restricting Context Menus

Oxygen general issues.
ajmott
Posts: 4
Joined: Thu Oct 06, 2011 8:29 pm

Restricting Context Menus

Post by ajmott »

Hi,

I've been dabbling in the API and am wondering if there is a way to accomplish what I need. Essentially, we have a specialized DITA schema we are using. Some of our authors have no need to be as well versed in DITA as other authors, and we'd like to "hide" some of the schema options from them (for example, not giving them the option for inserting a <boolean> element inside of <p>).

I found the following post: http://www.oxygenxml.com/forum/topic6228.html which talked of a way of disabling certain menu items based on context. However, in messing with the code snippet provided, it doesn't quite get at what I'm trying to do (limit even the options in the context sensitive assistant window). Is there a configuration option where I can disallow some elements globally (without tweaking the schema - I don't want to have to maintain 2 schemas), or do I have to determine all possible contexts for a given element and declare each of them in a listener that would disallow them?

Any pointers would be helpful. Thanks!

-Anthony
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Restricting Context Menus

Post by george »

Hi Anthony,

That post is about something different.
For restricting the proposals oXygen shows to the user you have two options, one is just a configuration setting and another one is implementing an extension.

In Options->Preferences -- Document Type Association you can select the DITA framework and use the Edit button to bring the Document Type dialog. In that please select the Author tab and then the Content Completion sub-tab. You can find there a list labeled "Filter - Remove content completion items". You can add to that list elements that will be excluded when oXygen presents proposals to the user. When you add an element you can also choose where you want that to be excluded: the content completion popup, the contextual menus and the elements view - you should check all of these.

The other option is to implement an extension. Again in Options->Preferences -- Document Type Association, select DITA, Edit the framework and select again the Author tab. Now select the Extensions sub tab and there you find an entry for "Content completion handler". This allows you to set a class that will receive a callback just before oXygen is about to use a set of proposals and you get the chance to modify that list as you need. This allows you to change not only elements but also attribute and value proposals. Please look in the SDK documentation for this content completion handler extension and if you encounter difficulties let us know.

Best Regards,
George
George Cristian Bina
Post Reply