From: Alistair Y. <ali...@sm...> - 2005-05-24 12:36:55
|
It seems that when you pre-compile the templates, it breaks i18n. This is due to the local build path being used to initialise the resource file paths: WEB-INF/template_classes/working/style_default_default/ template_useroptions.java: String resourceFile = "/Users/alistair/dev/sourceforge/Bodington/build/bodington/templates/ style_default/default/lang/null/useroptions.properties"; this is never going to work as resourceFile as defined above doesn't exist when you deploy. it works if you don't compile the templates and let bodington compile them itself as and when needed. There are two ways round this: 1) Don't pre-compile templates - bod can do it anyway 2) I change i18n to put resource files in the classpath so the full path isn't required. That means the resource files will be separate from the templates and we'll need a new WEB-INF/classes directory where one didn't exist before. anyone got any opinions? Alistair |
From: Matthew B. <mat...@co...> - 2005-05-24 13:04:14
|
Alistair Young wrote: > It seems that when you pre-compile the templates, it breaks i18n. > > This is due to the local build path being used to initialise the > resource file paths: > > WEB-INF/template_classes/working/style_default_default/ > template_useroptions.java: > > String resourceFile = > "/Users/alistair/dev/sourceforge/Bodington/build/bodington/templates/ > style_default/default/lang/null/useroptions.properties"; > > this is never going to work as resourceFile as defined above doesn't > exist when you deploy. > > it works if you don't compile the templates and let bodington compile > them itself as and when needed. This does cause another problem though, if someone is running tomcat and bodington in the directory /usr/local/tomcat and decides to move tomcat to /home/tomcat then all the templates stop working. > There are two ways round this: > > 1) Don't pre-compile templates - bod can do it anyway I'd say that if we are trying to make Bodington as easy as possible to install having the ability to install Bod when running Tomcat with a JRE is better. > 2) I change i18n to put resource files in the classpath so the full > path isn't required. That means the resource files will be separate > from the templates and we'll need a new WEB-INF/classes directory where > one didn't exist before. I think is probably the way to go as it is the "standard" Java way of loading i18n properties files. We don't need to have the files expanded under WEB-INF/classes, it just makes things easier for people who want to do translation. > anyone got any opinions? Silly question ;-) -- +--Matthew Buckett-----------------------------------------+ | VLE Developer, Learning Technologies Group | | Tel: +44 (0) 1865 283660 http://www.oucs.ox.ac.uk/ | +------------Computing Services, University of Oxford------+ |
From: Alistair Y. <ali...@sm...> - 2005-05-24 13:24:29
|
> having the ability to install Bod when running Tomcat with a JRE is > better ...than precompiling templates? Do you think we shouldn't precompile Mathew? > I think is probably the way to go as it is the "standard" Java way of > loading i18n properties files yes, agreed. See my next email about TMX! Alistair On 24 May 2005, at 14:04, Matthew Buckett wrote: > Alistair Young wrote: >> It seems that when you pre-compile the templates, it breaks i18n. >> This is due to the local build path being used to initialise the >> resource file paths: >> WEB-INF/template_classes/working/style_default_default/ >> template_useroptions.java: >> String resourceFile = >> "/Users/alistair/dev/sourceforge/Bodington/build/bodington/templates/ >> style_default/default/lang/null/useroptions.properties"; >> this is never going to work as resourceFile as defined above doesn't >> exist when you deploy. >> it works if you don't compile the templates and let bodington compile >> them itself as and when needed. > > This does cause another problem though, if someone is running tomcat > and bodington in the directory /usr/local/tomcat and decides to move > tomcat to /home/tomcat then all the templates stop working. > >> There are two ways round this: >> 1) Don't pre-compile templates - bod can do it anyway > > I'd say that if we are trying to make Bodington as easy as possible to > install having the ability to install Bod when running Tomcat with a > JRE is better. > >> 2) I change i18n to put resource files in the classpath so the full >> path isn't required. That means the resource files will be separate >> from the templates and we'll need a new WEB-INF/classes directory >> where one didn't exist before. > > I think is probably the way to go as it is the "standard" Java way of > loading i18n properties files. > We don't need to have the files expanded under WEB-INF/classes, it > just makes things easier for people who want to do translation. > >> anyone got any opinions? > > Silly question ;-) > > -- > +--Matthew Buckett-----------------------------------------+ > | VLE Developer, Learning Technologies Group | > | Tel: +44 (0) 1865 283660 http://www.oucs.ox.ac.uk/ | > +------------Computing Services, University of Oxford------+ > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click > _______________________________________________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers |
From: Matthew B. <mat...@co...> - 2005-05-24 13:50:15
|
Alistair Young wrote: >> having the ability to install Bod when running Tomcat with a JRE is >> better > > ...than precompiling templates? Do you think we shouldn't precompile > Mathew? Precompiling is better. It means someone can run Bodington without having to download a JDK. >> I think is probably the way to go as it is the "standard" Java way of >> loading i18n properties files > > yes, agreed. See my next email about TMX! Why have I seen and used ResourceBundles before but never TMX? -- +--Matthew Buckett-----------------------------------------+ | VLE Developer, Learning Technologies Group | | Tel: +44 (0) 1865 283660 http://www.oucs.ox.ac.uk/ | +------------Computing Services, University of Oxford------+ |
From: Alistair Y. <ali...@sm...> - 2005-05-24 14:20:45
|
> Why have I seen and used ResourceBundles before but never TMX? coz you (and I) are developers - there's a completely different world out there, where translators translate, who have never heard of programming language bindings such as ResourceBundle. Munging localised strings to internal representations is not even worth talking about, it's so trivial. The real work is in making it as easy as possible for translators to join the community. The translation community is moving in a tmx direction, so I would think it would be a good idea to shuffle along with them, if we want them to localise our vle. Alistair On 24 May 2005, at 14:50, Matthew Buckett wrote: > Alistair Young wrote: >>> having the ability to install Bod when running Tomcat with a JRE is >>> better >> ...than precompiling templates? Do you think we shouldn't precompile >> Mathew? > > Precompiling is better. It means someone can run Bodington without > having to download a JDK. > >>> I think is probably the way to go as it is the "standard" Java way >>> of loading i18n properties files >> yes, agreed. See my next email about TMX! > > Why have I seen and used ResourceBundles before but never TMX? > > -- > +--Matthew Buckett-----------------------------------------+ > | VLE Developer, Learning Technologies Group | > | Tel: +44 (0) 1865 283660 http://www.oucs.ox.ac.uk/ | > +------------Computing Services, University of Oxford------+ > > > ------------------------------------------------------- > This SF.Net email is sponsored by Yahoo. > Introducing Yahoo! Search Developer Network - Create apps using Yahoo! > Search APIs Find out how you can build Yahoo! directly into your own > Applications - visit > http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 > _______________________________________________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers |
From: Matthew B. <mat...@co...> - 2005-05-24 14:47:06
|
Alistair Young wrote: >> Why have I seen and used ResourceBundles before but never TMX? > > coz you (and I) are developers - there's a completely different world > out there, where translators translate, who have never heard of > programming language bindings such as ResourceBundle. But everyone (including translators) have head of files with: page.title=My Page [..snipped..] > The translation community is moving in a tmx direction, so I would think > it would be a good idea to shuffle along with them, if we want them to > localise our vle. I'm not at all convinced but hey, your the guy writing the code and I think we both understand each others point of view. Happy Hacking with TMX if you think that is the way to go. -- +--Matthew Buckett-----------------------------------------+ | VLE Developer, Learning Technologies Group | | Tel: +44 (0) 1865 283660 http://www.oucs.ox.ac.uk/ | +------------Computing Services, University of Oxford------+ |
From: Alexis O'C. <ale...@co...> - 2005-05-24 13:20:48
|
Alistair Young wrote: > It seems that when you pre-compile the templates, it breaks i18n. > Or even, i18n breaks template compilation. > There are two ways round this: > > 1) Don't pre-compile templates - bod can do it anyway > 2) I change i18n to put resource files in the classpath so the full > path isn't required. That means the resource files will be separate > from the templates and we'll need a new WEB-INF/classes directory where > one didn't exist before. > > anyone got any opinions? Er, point (1) is quite true. However, your "contributions" are demonstrating very clearly why it is desirable to valaidate the templates prior to deployment(!). In addition to validation up until now we've had pre-compilation too - i.e. generate all the templates and then you can even run Bodington on a JRE. Therefore, put the resource files on the CLASSPATH, and as you say, probably under 'WEB-INF/classes'. Whilst we're on the subject, a slightly rhetorical question, but do you reckon the method XmlTemplate::compileI18NConfig(Element) will work on Windows!?! Alexis |
From: Alistair Y. <ali...@sm...> - 2005-05-24 13:45:47
|
> Or even, i18n breaks template compilation well, hardly > However, your "contributions" are demonstrating very clearly why it is > desirable to valaidate the templates I know i18n is an unpopular subject and it's seen as superfluous by some people, especially trying to retrofit it to an ancient system like this - if it's too much for some to bear I can always just stop? > do you reckon the method XmlTemplate::compileI18NConfig(Element) will > work on Windows! of course not but there is time before 2.6 - I am getting there... Alistair On 24 May 2005, at 14:20, Alexis O'Connor wrote: > Alistair Young wrote: >> It seems that when you pre-compile the templates, it breaks i18n. > > Or even, i18n breaks template compilation. > >> There are two ways round this: >> 1) Don't pre-compile templates - bod can do it anyway >> 2) I change i18n to put resource files in the classpath so the full >> path isn't required. That means the resource files will be separate >> from the templates and we'll need a new WEB-INF/classes directory >> where one didn't exist before. >> anyone got any opinions? > > Er, point (1) is quite true. However, your "contributions" are > demonstrating very clearly why it is desirable to valaidate the > templates prior to deployment(!). In addition to validation up until > now we've had pre-compilation too - i.e. generate all the templates > and then you can even run Bodington on a JRE. Therefore, put the > resource files on the CLASSPATH, and as you say, probably under > 'WEB-INF/classes'. > > Whilst we're on the subject, a slightly rhetorical question, but do > you reckon the method XmlTemplate::compileI18NConfig(Element) will > work on Windows!?! > > > Alexis > > > ------------------------------------------------------- > This SF.Net email is sponsored by Yahoo. > Introducing Yahoo! Search Developer Network - Create apps using Yahoo! > Search APIs Find out how you can build Yahoo! directly into your own > Applications - visit > http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 > _______________________________________________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers |
From: Matthew B. <mat...@co...> - 2005-05-24 14:07:39
|
Alistair Young wrote: > I know i18n is an unpopular subject and it's seen as superfluous by some > people, especially trying to retrofit it to an ancient system like this > - if it's too much for some to bear I can always just stop? Sorry if my posts come across as too negative. I am keen on getting i18n in, just concerned about the implementation. -- +--Matthew Buckett-----------------------------------------+ | VLE Developer, Learning Technologies Group | | Tel: +44 (0) 1865 283660 http://www.oucs.ox.ac.uk/ | +------------Computing Services, University of Oxford------+ |
From: Alistair Y. <ali...@sm...> - 2005-05-24 14:22:53
|
> just concerned about the implementation what would you change? Alistair On 24 May 2005, at 15:07, Matthew Buckett wrote: > Alistair Young wrote: >> I know i18n is an unpopular subject and it's seen as superfluous by >> some people, especially trying to retrofit it to an ancient system >> like this - if it's too much for some to bear I can always just stop? > > Sorry if my posts come across as too negative. I am keen on getting > i18n in, just concerned about the implementation. > > -- > +--Matthew Buckett-----------------------------------------+ > | VLE Developer, Learning Technologies Group | > | Tel: +44 (0) 1865 283660 http://www.oucs.ox.ac.uk/ | > +------------Computing Services, University of Oxford------+ > > > ------------------------------------------------------- > This SF.Net email is sponsored by Yahoo. > Introducing Yahoo! Search Developer Network - Create apps using Yahoo! > Search APIs Find out how you can build Yahoo! directly into your own > Applications - visit > http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 > _______________________________________________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers |
From: Matthew B. <mat...@co...> - 2005-05-24 14:48:49
|
Alistair Young wrote: >> just concerned about the implementation > > what would you change? I'd just go with ResourceBundles. Is there any reason why we couldn't translate from TMX to ResourceBundles and back? -- +--Matthew Buckett-----------------------------------------+ | VLE Developer, Learning Technologies Group | | Tel: +44 (0) 1865 283660 http://www.oucs.ox.ac.uk/ | +------------Computing Services, University of Oxford------+ |
From: Alexis O'C. <ale...@co...> - 2005-05-24 14:30:02
|
Alistair Young wrote: > I know i18n is an unpopular subject and it's seen as superfluous by some > people, especially trying to retrofit it to an ancient system like this > - if it's too much for some to bear I can always just stop? Au contraire! I apologize for the somewhat sarcastic tone of some of my previous posts, but I'm actually entirely sympathetic to the notion of being i18n compatible. It's just that it strikes me you should be discovering some of these issues *before* committing rather than after. Just as a general point of illumination, the template-compiler ANT task (org.bodington.ant.TemplateBuilderTask) now supports the boolean 'failonerror' attribute (making it more consistent with complementary tasks such as Javac and JspC). By default this is true. Therefore, where a broken template is template no. 300 of 500, the following 199 are not even looked at. The whole build will fail as soon as a template contains 'unrecoverable errors'. Setting failonerror to 'false' means the build continues. If any templates contain unrecoverable errors then a warning message is written to the console saying how many fell into this category. Alexis P.S. Of course, the other alternative as the task is now an implicit FileSet is to do something like the following :-) <template-compiler ... > <include name="**/*.html" /> <exclude name="**/templateGivingYouAgro.html" /> </template-compiler> |
From: Alistair Y. <ali...@sm...> - 2005-05-24 14:50:01
|
> Au contraire! I apologize for the somewhat sarcastic tone of some of > my previous posts phew, I thought you hated me! I'm very delicate you know. when I say template compilation is boken I don't really mean it's broken - they compile fine. It's just that the resource files won't be found. I'm moving the resource files to the classpath which will remove this issue. It won't, however, remove the problem of a user moving the webapp around but the templates would break if they did that, whether they were precompiled or compiled by bod. perhaps a FAQ entry on how to move bod to a new server/webapp root? first thing after moving is to delete the compiled templates. > It's just that it strikes me you should be discovering some of these > issues *before* committing rather than after yes, I agree. I'm just using the space between now and 2.6 to get as much in head as I can, without major merging, which I can't do as I have a multitude of other projects waiting to bite my bum ;) If I get any more curmudgeonly I'll be getting dragged behind the boat in my own dinghy. Alistair On 24 May 2005, at 15:29, Alexis O'Connor wrote: > Alistair Young wrote: >> I know i18n is an unpopular subject and it's seen as superfluous by >> some people, especially trying to retrofit it to an ancient system >> like this - if it's too much for some to bear I can always just stop? > > Au contraire! I apologize for the somewhat sarcastic tone of some of > my previous posts, but I'm actually entirely sympathetic to the notion > of being i18n compatible. It's just that it strikes me you should be > discovering some of these issues *before* committing rather than > after. > > Just as a general point of illumination, the template-compiler ANT > task (org.bodington.ant.TemplateBuilderTask) now supports the boolean > 'failonerror' attribute (making it more consistent with complementary > tasks such as Javac and JspC). By default this is true. Therefore, > where a broken template is template no. 300 of 500, the following 199 > are not even looked at. The whole build will fail as soon as a > template contains 'unrecoverable errors'. Setting failonerror to > 'false' means the build continues. If any templates contain > unrecoverable errors then a warning message is written to the console > saying how many fell into this category. > > > Alexis > > > P.S. Of course, the other alternative as the task is now an implicit > FileSet is to do something like the following :-) > > <template-compiler ... > > <include name="**/*.html" /> > <exclude name="**/templateGivingYouAgro.html" /> > </template-compiler> > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Yahoo. > Introducing Yahoo! Search Developer Network - Create apps using Yahoo! > Search APIs Find out how you can build Yahoo! directly into your own > Applications - visit > http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 > _______________________________________________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers |
From: Matthew B. <mat...@co...> - 2005-05-24 16:34:55
|
Alistair Young wrote: > perhaps a FAQ entry on how to move bod to a new server/webapp root? > first thing after moving is to delete the compiled templates. Having the ability to change the context/hostname/filesystem location without having to do any reconfiguring is the right way to go. Then we don't need a FAQ entry. I have "fixed" WebLearn HEAD so that is doesn't store any references to the installed location (except for the event mailer) so it can be moved without any problems. I was going to push these changes across to Bodingtno HEAD. Yes/No? -- +--Matthew Buckett-----------------------------------------+ | VLE Developer, Learning Technologies Group | | Tel: +44 (0) 1865 283660 http://www.oucs.ox.ac.uk/ | +------------Computing Services, University of Oxford------+ |