Opening *.ditamap files renders XML Editor unusable

Oxygen general issues.
Erlend L
Posts: 13
Joined: Mon Mar 14, 2011 3:15 am

Opening *.ditamap files renders XML Editor unusable

Post by Erlend L »

I have used XML Editor for a couple of years, as an Eclipse plugin. I have always had the following problem, but with the latest versions it has worsened and renders my setup practically unusable.

If I dclick a *.ditamap file, it opens in the editor in Author mode (=one of the three modes Text, Grid, Author). This always took a long time, but I found that if I switched to Text mode, closed the map and opened it again, it would come up in Text mode (and not Author mode) with no performance penalty. My way of handling this is then for each map to open it, wait-wait-wait (and here Eclipse frequently goes into Not Responding mode) until it comes up in Author mode, switch to Text mode, close it and then it will always later come up in Text mode.

In some cases, Eclipse will hang forever trying to open the map, in those cases I'm in deep trouble, because even if I kill Eclipse, it will try to re-open the same files the next time I start it, with very much the same result. I therefore have to be very careful when working with maps - in fact, it is has come to the point that I just don't edit maps in Eclipse (I use Notepad++ or some other editor instead) - it is too dangerous. This problem has become worse over the years, either because our maps have become more complex or that the software simply doesn't handle this well.

If I open the map in DITA Maps Manager, there are no problems - it is fairly snappy and will not hang. However, if I select the Open Map in Editor button in Maps Manager and the map hasn't been open in th editor before, I get into the exact same situation as described above.

It seems as the Author mode is the problem; if I could avoid it for *.ditamap files, then I could work around this problem. I don't need Author mode for maps, I just want to edit the map as a simple text file. Is this possible?

Technical information:
- Fujitsu Siemens Siemens Lifebook S782, Intel Core i7 @2.2GHz, 16GB RAM, Windows 7 64bit
- Eclipse Juno v4.2
- oXygen XML Author v14.1.0

Example map:
I cannot include the complete source, but here is an example of a map that takes a long to open in Author mode.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map id="gen075-install" outputclass="topic-numbering draft">
<title>Installation Documentation for <keyword keyref="relname"/> <keyword keyref="relversion"/></title>

<!-- generic topics -->
<topicref href="release/concept/introduction.dita">
<topicref href="release/concept/welcome-install.dita" type="topic"/>
<topicref href="release/concept/release-notes-install.dita" type="topic"/>
<topicref href="release/concept/usage-install.dita" type="topic"/>
<!-- topicref href="release/concept/install-doc.dita">
<topicref href="release/task/install-doc.dita" type="task"/>
<topicref href="tech/solaris/sw/task/apache-restart.dita" type="task"/>
<topicref href="tech/solaris/sw/task/tomcat-restart.dita" type="task"/>
<topicref href="release/task/access-doc.dita" type="task"/>
</topicref -->
</topicref>

<!-- release specific topics -->
<topicref href="release/concept/release-installation.dita">
<topicref href="release/task/necccis-unpack.dita"/>
<topicref href="release/task/necccis-install-nisi.dita"/>
<topicref href="release/concept/installation-completed.dita"/>
</topicref>

<!-- generic topics -->
<topicref href="poc/concept/poc-ssc-main.dita"/>

<!-- conref resources -->
<keydef href="resource/windows.dita" keys="windows" type="topic"/>
<keydef href="resource/necccis.dita" keys="necccis" type="topic"/>
<keydef href="resource/virt.dita" keys="virt" type="concept"/>
<keydef href="release/gen075/resource/release-conrefsrc.dita" keys="release" type="topic"/>
<keydef href="release/gen075/resource/release-conrefsrc.g.dita" keys="release.g" type="topic"/>

<!-- keydef resources -->
<topicref href="release/gen075/resource/release-keydefsrc.g.ditamap" format="ditamap"/>
<topicref href="release/gen075/resource/ecp-keydefsrc.g.ditamap" format="ditamap"/>
<topicref href="release/gen075/resource/opmu-keydefsrc.g.ditamap" format="ditamap"/>
</map>
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Opening *.ditamap files renders XML Editor unusable

Post by Radu »

Hi Erlend,
If I dclick a *.ditamap file, it opens in the editor in Author mode (=one of the three modes Text, Grid, Author).
Yes, it is the default page for editing DITA Maps in the main editor.
You can go to the Preferences->Oxygen->"Document Type Association" page and edit the "DITA Map" document type. There you can change the "Initial edit mode" to Text.
If I open the map in DITA Maps Manager, there are no problems - it is fairly snappy and will not hang.
Both when opened in the Author page or in the DITA Maps Manager, a DITA Map will try to resolve references to other DITA Maps (in order to present those references as expanded) and this will take longer than when opened in the Text page.
But the open times in the DITA Maps Manager and in the Author page should be about the same.

Does your DITA Map reference very large maps?
If you can provide us with some samples (by dropping an email to support@oxygenxml.com) I could try to look into the problem further, maybe we can try and minimize the loading time in the Author page.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Erlend L
Posts: 13
Joined: Mon Mar 14, 2011 3:15 am

Re: Opening *.ditamap files renders XML Editor unusable

Post by Erlend L »

Radu wrote:You can go to the Preferences->Oxygen->"Document Type Association" page and edit the "DITA Map" document type. There you can change the "Initial edit mode" to Text.
Excellent, I was looking for something like this - here it is and it works perfectly; this setting will be the standard across our oXygen Author installations for sure...
Radu wrote:Both when opened in the Author page or in the DITA Maps Manager, a DITA Map will try to resolve references to other DITA Maps (in order to present those references as expanded) and this will take longer than when opened in the Text page. But the open times in the DITA Maps Manager and in the Author page should be about the same.
I made up an example which demonstrates the extensive time it takes to switch to Author mode, see below (also sent to you on email). I did a quick count in our maps, they usually reference about 4000 keydefs, which is 4x more than in this example.

Fixing Author mode is not a high priority with us, now that we can avoid Author mode in the editor and as long as the Maps Manager is snappy.

- Erlend

Code: Select all

Erlend@LIFEBOOK-S782 /c/u1/export/ncd/src/doc/demo (master)
$ cat demo-slow-author-mode.ditamap
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map id="demo-slow-author-mode" title="Slow Author mode">
<topicref href="demo-slow-author-mode-keydef.ditamap" format="ditamap"/>
</map>

Erlend@LIFEBOOK-S782 /c/u1/export/ncd/src/doc/demo (master)
$ head demo-slow-author-mode-keydef.ditamap
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map id="slow-author-mode-keydef" title="Slow Author mode keydefs">
<keydef keys="id-0"><topicmeta><keywords><keyword>Value for id 0</keyword></keywords></topicmeta></keydef>
<keydef keys="id-1"><topicmeta><keywords><keyword>Value for id 1</keyword></keywords></topicmeta></keydef>
<keydef keys="id-2"><topicmeta><keywords><keyword>Value for id 2</keyword></keywords></topicmeta></keydef>
<keydef keys="id-3"><topicmeta><keywords><keyword>Value for id 3</keyword></keywords></topicmeta></keydef>
<keydef keys="id-4"><topicmeta><keywords><keyword>Value for id 4</keyword></keywords></topicmeta></keydef>
<keydef keys="id-5"><topicmeta><keywords><keyword>Value for id 5</keyword></keywords></topicmeta></keydef>
<keydef keys="id-6"><topicmeta><keywords><keyword>Value for id 6</keyword></keywords></topicmeta></keydef>

Erlend@LIFEBOOK-S782 /c/u1/export/ncd/src/doc/demo (master)
$ tail demo-slow-author-mode-keydef.ditamap
<keydef keys="id-991"><topicmeta><keywords><keyword>Value for id 991</keyword></keywords></topicmeta></keydef>
<keydef keys="id-992"><topicmeta><keywords><keyword>Value for id 992</keyword></keywords></topicmeta></keydef>
<keydef keys="id-993"><topicmeta><keywords><keyword>Value for id 993</keyword></keywords></topicmeta></keydef>
<keydef keys="id-994"><topicmeta><keywords><keyword>Value for id 994</keyword></keywords></topicmeta></keydef>
<keydef keys="id-995"><topicmeta><keywords><keyword>Value for id 995</keyword></keywords></topicmeta></keydef>
<keydef keys="id-996"><topicmeta><keywords><keyword>Value for id 996</keyword></keywords></topicmeta></keydef>
<keydef keys="id-997"><topicmeta><keywords><keyword>Value for id 997</keyword></keywords></topicmeta></keydef>
<keydef keys="id-998"><topicmeta><keywords><keyword>Value for id 998</keyword></keywords></topicmeta></keydef>
<keydef keys="id-999"><topicmeta><keywords><keyword>Value for id 999</keyword></keywords></topicmeta></keydef>
</map>
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Opening *.ditamap files renders XML Editor unusable

Post by Radu »

Hi Erlend,

Thanks for the samples.
In Oxygen 14.1 we added in the CSS which renders a DITA Map in the Author page a selector which adds a text field for each <keydef> (for editing the key more easily). That text field which appears for each <keydef> seems to slow down the opening process.
In the CSS:

OXYGEN_PLUGIN_DIR/frameworks/dita/css_classed/map_ext.css

you can comment out or remove the CSS selector:

Code: Select all

*[class~="mapgroup-d/keydef"]{
......
}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Erlend L
Posts: 13
Joined: Mon Mar 14, 2011 3:15 am

Re: Opening *.ditamap files renders XML Editor unusable

Post by Erlend L »

Thank you, that helped. When I switch to Author mode for my maps now, it takes 9-10 seconds for it to render, not minutes (or indefinitely) as before. And with the trick to set Text as default editor mode for maps, I suddenly have a much more usable setup; I should have complained before, hehe...

Thanks,
Erlend
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Opening *.ditamap files renders XML Editor unusable

Post by Radu »

Hi Erlend,

Oxygen 15.0 which we've just released should have a fix for this out of the box.
You will get a notification email about the new release probably in a couple of days.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Erlend L
Posts: 13
Joined: Mon Mar 14, 2011 3:15 am

Re: Opening *.ditamap files renders XML Editor unusable

Post by Erlend L »

Great Radu, I look forward to testing this.

- Erlend
Post Reply