[topicmapmail] RE: Can you help with XTMSerializer ??
Dicheva, Darina
dichevad at wssu.edu
Sat Nov 4 11:56:20 EST 2006
Lars,
> > It doesn't :-) I got TM4L running under TMAPI /not fully
> > tested yet, but in general it runs!/.
>
> Congrats! :)
Thanks - you can add it to your list of TMAPI-based apps :-)
> I'd be interested to hear how hard the translation from TM4J API to
> TMAPI was.
In fact it wasn't hard but it took some time - I had to change in an
appropriate way the use of 'Member' everywhere in my utilities with
'AssociationRole', and also to change the use of indexes. I only had 2
difficulties that I would like to mention for those that might go the
same way:
1/ I got the following exception
Exception in thread "AWT-EventQueue-0" java.lang.AbstractMethodError:
org.tm4j.tmapi.core.TMAPITopicImpl.getSubjectLocators()Ljava/util/Set;
at
org.tmapiutils.impexp.xtm.XTMSerializer.writeTopic(XTMSerializer.java:20
5)
at
org.tmapiutils.impexp.xtm.XTMSerializer.writeTopic(XTMSerializer.java:18
1)
.....
At first I thought it is due to an error in the XTMSerializer, but later
discover that that kind of error could be due to compiling and running
against different versions of classes/jars (I used TM4J 0.9.6, while
obviously TMAPI utilities have been compliled using TM4J 0.9.7). When I
replaced my TM4J version with the latest one that error disapeared.
2/ I got a Java null pointer exception in my createNewTopic method
(which worked before) at t.createTopicName(topicName, null). Then I
noticed that I only was getting it after saving the file, when trying to
re-create my utility topics (which I delete before saving the file). It
took me a while to discover that it was related to the TM4J attempt for
topic merging and I needed to include
tmfac.setFeature("http://tmapi.org/features/merge/byTopicName", false);
This fixed that problem. (I haven't translated the editor's 'merge'
option code though - perhaps will have some problems ...)
Hope these notes could be of use to somebody.
> > My concern was whether I am missing the most efficient way
> of accessing
> > the 'primary' name of a topic, since this is a very often
> used operation
> > ...
>
> If you look into the source of "TopicNameExtractor" from TM4J you'll
> see that this extractor does basically the same as your code. So, if
> TM4L used TopicNameExtractor before it shoudn't really matter.
Great! Just wanted to be sure :-)
All the very best,
Darina
> Best regards,
> Lars
> --
> http://www.semagia.com
> http://www.topicgarden.com/mailinglist/ German Topic Maps mailinglist
>
>
More information about the topicmapmail
mailing list