From: <hri...@ru...> - 2006-03-21 10:14:33
|
Since something with the encoding of my mail went wrong, once again the draft (using UTF-8). Sorry for the inconvenience ... Hey folks, I am currently implementing a specific web application on the basis of TM4Web. I am facing the following problem: The underlying topic map contains topics that have both an English and a German base name. I set their scopes to 'en' resp. 'de' so that they correspond to the country codes. Goal: Depending on the locale of the client=E2=80=99s system, the correct base na= me should be shown. Idea: There is a method 'addPreferredTheme(Topic theme)' in the TopicNameExtractor-Class that I have been trying to use to solve that problem. Question: Is there a way to simply say like: TopicNameExtractor m_nameExtractor =3D new TopicNameExtractor(); m_nameExtractor.addPreferredTheme(current locale); How can I provide the current locale as an argument? Thanks for any help, Holger |
From: Lars H. <he...@se...> - 2006-03-21 16:36:33
|
Hi, Code was wrong, here a slightly modified version. --- // Put this in one line static final String TM_LANG = \\ "http://www.topicmaps.org/xtm/1.0/language.xtm"; Locale locale = Locale.getDefault(); // Note that the ISO 639 is not stable String preferredLang = locale.getLanguage().equals("de") ? "de" : "en"; // Used to create the subject identifier String langRef = TM_LANG + preferredLang; // Subject identifier Locator langLoc = topicMap.getBaseLocator().resolveRelative(langRef); // Fetch topic by the subject identifier Topic langTopic = topicMap.getTopicBySubjectIndicator(langLoc); if (langTopic == null) { langTopic = topicMap.createTopic(); langTopic.addSubjectIndicator(langLoc); } nameExtractor.addPreferredTheme(langTopic); --- Best regards, Lars -- http://semagia.com http://topicgarden.com/mailinglist/ German Topic Maps mailinglist |
From: Lars H. <he...@se...> - 2006-03-21 17:34:26
|
Hi, [...] > // Put this in one line > static final String TM_LANG = \\ > "http://www.topicmaps.org/xtm/1.0/language.xtm"; [...] Note: The "#" at the end is missing. Should be: static final String TM_LANG = \\ "http://www.topicmaps.org/xtm/1.0/language.xtm#"; Best regards, Lars -- http://semagia.com http://topicgarden.com/mailinglist/ German Topic Maps mailinglist |
From: Holger <hri...@ru...> - 2006-03-21 18:45:26
|
Hi Lars, thanks for your help. It works fine. I achieved some "dirty" solution in = the meanwhile - however it was not as stable and not as good as yours. ;-) Best regards, Holger -----Urspr=FCngliche Nachricht----- Von: Lars Heuer [mailto:he...@se...]=20 Gesendet: Dienstag, 21. M=E4rz 2006 18:32 An: hri...@ru...; tm4...@li... Betreff: Re: [TM4J-users] Using locale for scoped base names Hi, [...] > // Put this in one line > static final String TM_LANG =3D \\ > "http://www.topicmaps.org/xtm/1.0/language.xtm"; [...] Note: The "#" at the end is missing. Should be: static final String TM_LANG =3D \\ "http://www.topicmaps.org/xtm/1.0/language.xtm#"; Best regards, Lars --=20 http://semagia.com http://topicgarden.com/mailinglist/ German Topic Maps mailinglist |
From: <mag...@st...> - 2006-03-22 11:42:38
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Does anyone know if there exists a printer-friendly version of the "TM4J Developer's Guide"? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org iD8DBQFEIThiB6/gap0IM6sRAsXAAKCramuJwBf6QyV2ZRkg3Lv94G9udQCggUKB p6nzY2uaF3ZbIXL2svy47FE= =sIQj -----END PGP SIGNATURE----- |
From: Richard G. <ric...@ya...> - 2006-03-22 11:47:07
|
There is devguide.pdf in the docs directory of the download. Cheers, Richard. --- Magnus Folgerø <mag...@st...> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Does anyone know if there exists a printer-friendly version of the "TM4J > Developer's Guide"? > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2.2 (GNU/Linux) > Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org > > iD8DBQFEIThiB6/gap0IM6sRAsXAAKCramuJwBf6QyV2ZRkg3Lv94G9udQCggUKB > p6nzY2uaF3ZbIXL2svy47FE= > =sIQj > -----END PGP SIGNATURE----- > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Tm4j-users mailing list > Tm4...@li... > https://lists.sourceforge.net/lists/listinfo/tm4j-users > ___________________________________________________________ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com |
From: <mag...@st...> - 2006-03-22 11:58:17
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm trying to get tm4web to work, but I guess I have to do some initial work with tm4j.. how do I build the files under tm4j-0.9.7/build/lib ? output: $ ant -f batch.xml -Dtopicmap=tmworld.xtm topicmap Buildfile: batch.xml topicmap: [mkdir] Created dir: /home/mags/Documents/haupt/tm4j/tm4web/build/batch/temp [mkdir] Created dir: /home/mags/Documents/haupt/tm4j/tm4web/build/batch/html [mkdir] Created dir: /home/mags/Documents/haupt/tm4j/tm4web/build/batch/img [mkdir] Created dir: /home/mags/Documents/haupt/tm4j/tm4web/build/batch/css [copy] Copying 1 file to /home/mags/Documents/haupt/tm4j/tm4web/build/batch/temp [copy] Copying 13 files to /home/mags/Documents/haupt/tm4j/tm4web/build/batch/temp BUILD FAILED /home/mags/Documents/haupt/tm4j/tm4web/batch.xml:69: /home/mags/Documents/haupt/tm4j/tm4j-0.9.7/build/lib not found. Total time: 5 seconds -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org iD8DBQFEITwMB6/gap0IM6sRArW5AJ9MkXyRNBK0YKiA+IvaiFQ+diP0kgCgmoaU FWi59JYGhZSi3nlV2GdiPGk= =BSjX -----END PGP SIGNATURE----- |
From: Kal A. <ka...@te...> - 2006-03-23 09:05:31
|
Hi Magnus If you have the source version of TM4J 0.9.7, you will need to compile=20 that first - it should be as simple as executing ant with no parameters=20 in the tm4j-0.9.7 directory. Hope this helps Kal Magnus Folger=F8 wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > I'm trying to get tm4web to work, but I guess I have to do some initial > work with tm4j.. how do I build the files under tm4j-0.9.7/build/lib ? >=20 > output: >=20 > $ ant -f batch.xml -Dtopicmap=3Dtmworld.xtm topicmap > Buildfile: batch.xml >=20 > topicmap: > [mkdir] Created dir: > /home/mags/Documents/haupt/tm4j/tm4web/build/batch/temp > [mkdir] Created dir: > /home/mags/Documents/haupt/tm4j/tm4web/build/batch/html > [mkdir] Created dir: > /home/mags/Documents/haupt/tm4j/tm4web/build/batch/img > [mkdir] Created dir: > /home/mags/Documents/haupt/tm4j/tm4web/build/batch/css > [copy] Copying 1 file to > /home/mags/Documents/haupt/tm4j/tm4web/build/batch/temp > [copy] Copying 13 files to > /home/mags/Documents/haupt/tm4j/tm4web/build/batch/temp >=20 > BUILD FAILED > /home/mags/Documents/haupt/tm4j/tm4web/batch.xml:69: > /home/mags/Documents/haupt/tm4j/tm4j-0.9.7/build/lib not found. >=20 > Total time: 5 seconds > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2.2 (GNU/Linux) > Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org >=20 > iD8DBQFEITwMB6/gap0IM6sRArW5AJ9MkXyRNBK0YKiA+IvaiFQ+diP0kgCgmoaU > FWi59JYGhZSi3nlV2GdiPGk=3D > =3DBSjX > -----END PGP SIGNATURE----- >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting lang= uage > that extends applications into web and mobile media. Attend the live we= bcast > and join the prime developer group breaking into this new coding territ= ory! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > _______________________________________________ > Tm4j-users mailing list > Tm4...@li... > https://lists.sourceforge.net/lists/listinfo/tm4j-users >=20 >=20 |
From: Lars H. <he...@se...> - 2006-03-21 16:37:04
|
Hi Holger, [...] > Depending on the locale of the client=E2=80=99s system, the correct bas= e name > should be shown. [...] > There is a method 'addPreferredTheme(Topic theme)' in the > TopicNameExtractor-Class that I have been trying to use to solve that > problem. How about: static final String TM_LANG =3D "http://www.topicmaps.org/xtm/1.0/language.xtm" Locale locale =3D Locale.getDefault(); // Note that the ISO 639 is not stable String preferredLang =3D locale.getLanguage().equals("de") ? "de" : "en"; // Used to create the subject identifier String langReference =3D TM_LANG + preferredLang; // Subject identifier Locator langLocator =3D topicMap.getBaseLocator().resolveRelative(loc); // Fetch topic by the subject identifier Topic langTopic =3D topicMap.getTopicBySubjectIndicator(langLoc); if (langTopic =3D=3D null) { langTopic =3D topicMap.createTopic(); langTopic.addSubjectIndicator(langLocator); } nameExtractor.addPreferredTheme(langTopic); =20 Best regards, Lars --=20 http://semagia.com http://topicgarden.com/mailinglist/ German Topic Maps mailinglist |