Page 1 of 1

How can I hide elements that are not used often?

Posted: Fri Aug 27, 2010 1:28 am
by anderszvensson
Hi,

I was wondering if it is possible (and if so how) to hide elements that are not used very often? I guess I could modify the dtds, but I was hoping there would be a simpler way directly in the editor, or some configuration file.

Thanks,

Anders

Re: How can I hide elements that are not used often?

Posted: Fri Aug 27, 2010 9:32 am
by Radu
Hi Anders,

I need more details.
Are you referring to the Text or Author page?
Are you referring to hiding parts of the XML file which gets opened or to elements which appear in the content completion window(or elements view)?

Regards,
Radu

Re: How can I hide elements that are not used often?

Posted: Fri Aug 27, 2010 11:23 pm
by anderszvensson
I'm referring to hiding elements in the content completion dropdown (like intellisense), and specifically for DITA. Our writers only use a subset of the elements so many of them are merely distracting.

/Anders

Re: How can I hide elements that are not used often?

Posted: Sat Aug 28, 2010 4:18 am
by dcramer
I agree with Anders. This feature exists in XMetaL and is useful. I would like to be able to specify somewhere on a DTD/schema-wide basis that certain elements should not be available in the Element view and certain attributes should not be available in the Attribute view even though they are in the schema and legal. For a schema like DocBook, it's very convenient to be able to remove unused stuff from the editor without messing with the schema.

Thanks,
David

Re: How can I hide elements that are not used often?

Posted: Mon Aug 30, 2010 8:58 am
by Radu
Hi guys,

Thanks for the clarifications.

We have some Java extensions which can be used to achieve just that, if you are interested I can provide more details.
But you are probably interested more in a GUI form in which to specify which tags are interesting in your project. Is this correct? We do not have this yet.

Regards,
Radu

Re: How can I hide elements that are not used often?

Posted: Mon Aug 30, 2010 2:31 pm
by dcramer
The Java extensions are fine. The idea is that I would customize the editor to omit certain deprecated elements and attributes to reduce the amount of noise in the GUI for the writers. In some cases, it's preferable to do this in the GUI rather than removing the elements from the schema.

Thanks,
David

Re: How can I hide elements that are not used often?

Posted: Mon Aug 30, 2010 2:51 pm
by Radu
Hi,

You can download the Author SDK project from:
http://www.oxygenxml.com/InstData/Edito ... horSDK.zip

What you are interested in is adding an implementation of:
ro.sync.contentcompletion.xml.SchemaManagerFilter
which can be used to filter out unwanted elements and attributes when performing content completion and in the elements/attributes views.
Compile this implementation using the libraries in the Author SDK and add it implementation to a jar file next to the OXYGEN_INSTALL_DIR/frameworks/dita/dita.jar library.

In order to make modifications to the Oxygen frameworks you will need full write access to the Oxygen instalation.

In the Oxygen Preferences->Document Type Association page you can switch the user role to Developer, edit the DITA document type, in the Classpath tab add your additional jar library and in the Extensions tab select your implementation class. Then save the Oxygen Preferences page.

To share your work with others you will have to either zip the entire OXYGEN_INSTALL_DIR/frameworks/dita folder and share it or from that folder share the additional jar library and the configuration OXYGEN_INSTALL_DIR/frameworks/dita/dita.framework file.

Regards,
Radu

Re: How can I hide elements that are not used often?

Posted: Tue Aug 31, 2010 5:09 pm
by dcramer
Thanks Radu,
I'm using the DocBook framework, but everything you said applies mutatis mutandis.

So would it also be possible to add pseudo-elements to the element suggestion list, e.g. add a <checklist> element (if <itemizedlist> is legal in the current context) and have it insert <itemizedlist class="checklist"> when checklist is selected.

This is like the previous case where you're manipulating the list of elements that can go here, but you also have to handle what the editor does when the user selects the pseudo-element.

If that kind of customization is possible, which api would I use?

Thanks,
David

Re: How can I hide elements that are not used often?

Posted: Wed Sep 01, 2010 6:43 am
by anderszvensson
Ok. I can look into the Java extensions too. But I suspect it would almost be easier then to override (specialize) the dtd. Just to make sure though, if I do specialize the dtd (either by removing some elements or adding new ones by inheriting and overriding existing ones), will that work in code completion, or do I still have to go into the Java extensions? I.e. does the author view recognize new elements, just like the text view would or not?

BTW, a GUI mechanism for doing this sort of thing is starting to sound like a feature request anyhow :-)

Thanks!

/Anders

Re: How can I hide elements that are not used often?

Posted: Wed Sep 01, 2010 9:37 am
by Radu
Answer for David:

No, the API does not allow customizing the content completion and Elements views for allowing additional items which when invoked perform custom actions. But, we already have this logged to our internal issues list and maybe it will get done in a minor version of Oxygen 12.x.

What Oxygen 12 (which will appear in a few weeks) will have as a useful enhancement will be the ability to use the defined code templates (from the Oxygen Preferences) also in the Author Content Completion window so you will be able to define code templates for those extra XML fragments you want inserted.

Regards,
Radu

Re: How can I hide elements that are not used often?

Posted: Wed Sep 01, 2010 9:39 am
by Radu
Answer for Anders:

Content completion in Oxygen is not hard coded, it looks at the referenced DTD's and schemas (no matter what page you are editing in).
So modifications in the associated grammars will reflect in the content completion window, elements, attributes and model views.

I logged as an improvement request the possibility to have a GUI for filtering this kind of proposals.

Rgards,
Radu

Re: How can I hide elements that are not used often?

Posted: Wed Sep 01, 2010 5:37 pm
by anderszvensson
Thanks, sounds good.

/Anders

Re: How can I hide elements that are not used often?

Posted: Fri Dec 10, 2010 11:27 am
by Radu
Hi,

Oxygen 12.1 which will be released in a couple of weeks will have support for adding your own custom Author actions to the Content Completion window, Elements view and Contextual Insert (Outline/Breadcrumb) menus.
You will also be able to remove specified elements from appearing in the places specified above.
This control will be able in the Oxygen Preferences->Document Type Association page when editing a document type:
In the Author tab there is a new Content Completion tab which controls the features mentioned above.

Regards,
Radu

Re: How can I hide elements that are not used often?

Posted: Tue May 15, 2018 10:41 am
by Sangeeta
Hi Radu,

Can we now hide certain elements, so that the writers are not distracted by seeing a big list of elements? We use a set of elements that we have standarized. Can we customize the elements list from the UI?

For example, say we do use msg* elements. Can we remove this from appearing in the tags list?

Best regards,
Sangeeta

Re: How can I hide elements that are not used often?

Posted: Tue May 15, 2018 11:41 am
by Radu
Hi Sangeeta,

Sure, either using a special XML configuration file:

https://www.oxygenxml.com/doc/versions/ ... ually.html

or as this forum thread discusses editing your framework customization and removing items from the content completion list:

https://www.oxygenxml.com/doc/versions/ ... letion-tab

Regards,
Radu