How can I hide elements that are not used often?

<oXygen/> general issues.
anderszvensson
Posts: 71

How can I hide elements that are not used often?

Fri Aug 27, 2010 1:28 am

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
Radu
Posts: 5749

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

Fri Aug 27, 2010 9:32 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
anderszvensson
Posts: 71

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

Fri Aug 27, 2010 11:23 pm

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
dcramer
Posts: 148

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

Sat Aug 28, 2010 4:18 am

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
Radu
Posts: 5749

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

Mon Aug 30, 2010 8:58 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
dcramer
Posts: 148

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

Mon Aug 30, 2010 2:31 pm

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
Radu
Posts: 5749

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

Mon Aug 30, 2010 2:51 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
dcramer
Posts: 148

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

Tue Aug 31, 2010 5:09 pm

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
anderszvensson
Posts: 71

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

Wed Sep 01, 2010 6:43 am

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
Radu
Posts: 5749

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

Wed Sep 01, 2010 9:37 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 5749

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

Wed Sep 01, 2010 9:39 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
anderszvensson
Posts: 71

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

Wed Sep 01, 2010 5:37 pm

Thanks, sounds good.

/Anders
Radu
Posts: 5749

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

Fri Dec 10, 2010 11:27 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Sangeeta
Posts: 14

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

Tue May 15, 2018 10:41 am

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
Radu
Posts: 5749

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

Tue May 15, 2018 11:41 am

Hi Sangeeta,

Sure, either using a special XML configuration file:

https://www.oxygenxml.com/doc/versions/20.0/ug-editor/topics/configure-elements-attr-cc-individually.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/20.0/ug-editor/topics/the-content-completion-tab.html#the-content-completion-tab

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 1 guest