Re: [Rife-users] i18n patch
Geert, Another question, why is TranslatorInCreation needed? It's just I didn't want to put setSupport method in Translator as this method is never needed by Translator users. But the other methods of Translator are used during the construction of Translator instances. Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] i18n patch
Geert, So, do we really need to control the order of priority from outside a Translator? Imho, yes. At least as soon as we don't want to do any assumption about when each resourcebundle will be added to the list. Well, I'm not so sure about this. People call the addResourceBundle method manually, right? Not always. For exemple it can be: - through plugins like rife-crud: the crud bundles will be put at the top of the list (see below the patch I use for CrudElement.decorateTemplate) - and/or through site configuration: then the final element, for exemple the Add one, can specify a required bundle basename, that will be put above the crud ones in the list. Can't they just call them in the correct order. I'll hear you say: Yeah but what when they need to add resource bundles in front when a translator already has some?. Adding to the top doesn't solve that either, since at a later time other resource bundles might be added above again and obscure the properties too. Yes indeed. But imo it's not an issue. My point is, if there's a specific order that needs to be respected, then the developer can easily handle this by adding all the resource bundles one after the other in a reference factory or IoC container. I don't think that explicitly adding to front or bottom helps. I don't think that we need to control very exactly this order, but at least to be able to deal with some simple cases. If you think that addResourceBundle(s) with atTopPriority parameter is too much complexity, there is always the possibilty to remove this parameter and use getResources to work directly on the list. But then the complexity is only transfered from inside the addResourceBundle method to the caller. Imo such a solution is worse that the one with atTopPriority parameter. Regards Pierre PJ : public Template decorateTemplate(Template template) { String[] bundleNames = new String[2]; bundleNames[0] = L10N_PREFIX_RESOURCEBUNDLE + StringUtils.encodeClassname(mBeanClassName); bundleNames[1] = L10N_CRUD_RESOURCEBUNDLE; return decorateTemplate( template , Localization.getResourceBundles(bundleNames, getTranslator().getLocales(), true) , null ); // add bundles in top priority } ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] i18n patch
Geert, I understood that, I'm more looking for a real-world use case that warrants this feature. I can see why it might be theoretically interesting, but doubt that it warrants the API complexity increase in practice. I propose a compromise: I remove withDefault and keep a withTopPriority Lol, I'm not looking for a compromise but for a detailed real world example of why this is needed, and why it needs to be there in the API. If you can convince me it's important, they can both just stay ;-) Is it really only an issue about boolean parameter? If so what about two methods, something like addTopPriorityResourceBundle and addBottomPriorityResourceBundle? But then it's just an other type of complexity. So to avoid to get 6 methods to add resource bundle, it's possible to remove: - addResourceBundles(String[] baseNames); - addResourceBundle(ResourceBundle bundle); and just keep addTop/BottomPriorityResourceBundles(ListResourceBundle bundles). Then it transfers the complexity from inside the API to the caller... (at least there is Localization.getResourceBundles to transform string array in bundle list) So, do we really need to control the order of priority from outside a Translator? Imho, yes. At least as soon as we don't want to do any assumption about when each resourcebundle will be added to the list. Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] i18n patch
Geert, I put the constant values here as imo they are not associated at the TranslatorSupport interface but at a specific implemantation, i.e. ElementSupport. Well in my reasoning, they could be associated with on particular TranslatorSupport implementation, no? Imo ElementSupport is a specific implementation, and there is no reason that all implementations work like it. But may be it's a little too flexible. The main thing that bothers me is that it imposes a bunch of standard property names for something as basic and generic as ElementSupport. It doesn't feel right to me. OK, I put them with all the specific methods in a ElementTranslatorSupport class. If we want to decouple TranslatorSupport implementation from ElementSupport, how to get then property specific to an element? ElementContext.getActiveElement() ? By injecting a property that is an implementation of TranslatorSupport that packages all those properties together. Don't you think that that would be cleaner and less intrusive? So we need to wait for a full rife ioc ... Actually, no. You can already use it now and provide the TranslatorSupport instance from a participant. Full IoC reference factory support isn't required for you to implement it. It's might just be handy to have for people that declare their site structures in XML and want to also declare an IoC reference in there. Using Java, Groovy and Janino for the site structure doesn't required this support at all. OK. The above class is a first step in this direction. It's now possible to use it by default, and if needed to specify a other TranslatorSupport for each element. I'll commit this as soon I have finish to complete the comments. Possibly next step: start with the participant stuff but as i see the thing, it'll be to intanciate directly a Translator. boolean atTheEnd is to put the items either at the begining or at the end of the list. atTheEnd at true is for the lowest priority. It's a lowest/highest choice. May be we can use some constants like Translator.HIGH_PRIORITY_RESOURCESBUNDLE/ Translator.LOW_PRIORITY_RESOURCESBUNDLE Yes, I understand that. Is this something you needed in practice, or do you just think that it would be nice to have? Can you give me an example of when you needed it in a real world project? It's used in ElementSupport.decorateTemplate. Usually, new bundles are added at the top priority level. But here we need to put them at the lowest priority level. It's also used in AbstractTemplate.addResourceBundle. I don't really see how to replace/remove it. May be a better name as topPriority (and inversion of true/false value). I understood that, I'm more looking for a real-world use case that warrants this feature. I can see why it might be theoretically interesting, but doubt that it warrants the API complexity increase in practice. boolean withDefault : it is to ask that at least a default resource bundle, if available, should be added. An other way would be to provide as parameter eitheir null value or the default resourcebundle to be used, even if it's always Localization.getResourceBundles(new String[] {null}, getLocales()) Same question as above. Here it's only to avoid to create a default bundle list before to know if this list is needed. Same remark as above. I propose a compromise: I remove withDefault and keep a withTopPriority Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] i18n patch
Geert, - in ElementSupport, you remove all the try/catch of the new methods: is this because there is no action associated with the catch? Or because the EngineException catching was not enough specific? The reason why I removed them was that you checked for the presence of the property manually before obtaining it. Any exception that is still triggered after that is probably an important problem and should at least be triggered. Swallowing exceptions is generally a very bad idea, unless you document the reason clearly or log something (which is usually not even a good idea for a framework). I could find a good reason to swallow them, however if there is one, add the appropriate comments to explain why. As I'm unable to find the exception I wanted to intercepted, it 's ok. * I'm not sure about the fixed property names and input names on ElementSupport, it seems a bit hackish to me. I think it would be better to inject an instance of TranslatorSupport. I know that RIFE's IoC doesn't support the creation of references or invocation of factories in-line yet in XML, but it will be added soon. Imho it would be better to totally decouple the actual fact of having properties or inputs from the base element support. I put the constant values here as imo they are not associated at the TranslatorSupport interface but at a specific implemantation, i.e. ElementSupport. Well in my reasoning, they could be associated with on particular TranslatorSupport implementation, no? Imo ElementSupport is a specific implementation, and there is no reason that all implementations work like it. But may be it's a little too flexible. If we want to decouple TranslatorSupport implementation from ElementSupport, how to get then property specific to an element? ElementContext.getActiveElement() ? By injecting a property that is an implementation of TranslatorSupport that packages all those properties together. Don't you think that that would be cleaner and less intrusive? So we need to wait for a full rife ioc ... boolean atTheEnd is to put the items either at the begining or at the end of the list. atTheEnd at true is for the lowest priority. It's a lowest/highest choice. May be we can use some constants like Translator.HIGH_PRIORITY_RESOURCESBUNDLE/ Translator.LOW_PRIORITY_RESOURCESBUNDLE Yes, I understand that. Is this something you needed in practice, or do you just think that it would be nice to have? Can you give me an example of when you needed it in a real world project? It's used in ElementSupport.decorateTemplate. Usually, new bundles are added at the top priority level. But here we need to put them at the lowest priority level. It's also used in AbstractTemplate.addResourceBundle. I don't really see how to replace/remove it. May be a better name as topPriority (and inversion of true/false value). boolean withDefault : it is to ask that at least a default resource bundle, if available, should be added. An other way would be to provide as parameter eitheir null value or the default resourcebundle to be used, even if it's always Localization.getResourceBundles(new String[] {null}, getLocales()) Same question as above. Here it's only to avoid to create a default bundle list before to know if this list is needed. This boolean parameter can be replaced by the default bundle list itself. But imo, there is no advantage with such a parameter. It'd better to keep only 2 parameters, String[] baseNames and boolean atTheEnd. Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] code conventions
I just added a first (little) draft about code conventions http://rifers.org/wiki/display/RIFE/Code+conventions Pierre Hi Frederic, no, such a document hasn't been written yet. When I find the time I will put something on the wiki about it. If you have some time and want to have a go at it, go right ahead, I'll jump in to help or correct when needed. Best regards, Geert Sure, I'd like to help. Coding standards are very important to me, in my projects, professional and personal, so I have a lot of respect for others that try to establish and follow standards as well. I'll try to start writing a document soon, and as you said, you can correct me where needed. Thanks for your response. Frederic Hi Geert, Is there a document with the RIFE coding standards? I've looked through the RIFE source code quite a bit (sometimes it's the best way to learn things!), so I could already see some standards being used. However I was wondering if there was an official document. Thanks, Frederic ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] localized login template
Lars, With the patch I submitted yesterday to Geert about RIFE-258, it will only need to add property name=L10N_REQUIRED_RESOURCEBUNDLEl10n/authentication/login/property in element extends=elements/authentication/common.xml Regards Pierre Hi Geert, Sorry I can't see how the 'Embedded element priorities' can solve this problem. In the config-base.xml the DEFAULT_RESOURCEBUNDLE is set: param name=L10N_DEFAULT_RESOURCEBUNDLEcom.acrolinx.termmanagement.elements. localization.Resource/param That's working for all my templates except the login template. In my site file I have the following elements defined (among others): element id=HOME file=elements/login/home.xml url=/home inherits=AUTH_ADMIN flowlink srcexit=dashboard destid=DASHBOARD/ flowlink srcexit=termmanagement destid=TERMMANAGEMENT/ /element element id=AUTH_ADMIN file=elements/authentication/administration.xml/ The administration.xml looks like: element extends=elements/authentication/common.xml property name=template_namelogin/login/property property name=roleadmin/property property name=datasource datasourcederby/datasource /property /element common.xml: element extends=rife/authenticated/database.xml submission name=credentials param name=login/ param name=password/ /submission childtrigger name=authid/ /element login.html: !--I 'generic.main'/-- !--BV 'content'-- !--I 'login.form'/-- !--/BV-- main.html: ... head title!--V 'L10N:LABEL.TERM_DESIGN_TITLE'/--/title /head ... div id=subpageContent div id=subpageText !--V 'content'/-- /div /div ... The !--V 'L10N:LABEL.TERM_DESIGN_TITLE'/-- will not be replaced by the string from the resourcebundle. There is no embedded element, or? Or where should I change the priority? Cheers, Lars -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Geert Bevin Sent: 30 March 2006 11:00 To: RIFE users list : questions, bug reports and suggestions. Subject: Re: [Rife-users] localized login template Yes, you can tailor to priority of embedded elements now: http://rifers.org/blogs/gbevin/2006/3/2/ rife_1_4_released#1_4_highlight04 On 30-mrt-06, at 10:53, Lars Grupe wrote: Hi Geert, Is this old problem from November now resolved too? Where can I find information about how L10N should be implemented now? Cheers, Lars -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Geert Bevin Sent: 25 November 2005 20:51 To: RIFE users list : questions, bug reports and suggestions. Subject: Re: [Rife-users] localized login template Hi Lars, hmmm, good point, there is no solution for that at the moment. This needs some thinking and I'd like to find a solution for it since it seems to be an important oversight. I don't have any real solutions in mind at the moment. If you think of something, shoot, I'll ponder about it too. Best regards, Geert On 25-nov-05, at 19:52, Lars Grupe wrote: Hi Geert. Ok, that's working now, many thx again. :) Now I think I have only one problem. I added some strings to the login template which should be localized. If I understand it correct the built-in element rife/authenticated/memory.xml is used to print the template that is given in the 'template_name' property. Is there a way to submit a path to the resource bundle and a name of a global variable where the locale should be taken from? Or do you know another solution for my problem? Cheers, Lars -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Geert Bevin Sent: 25 November 2005 15:03 To: RIFE users list : questions, bug reports and suggestions. Subject: Re: [Rife-users] Embedded elements submissions execution order Hi Lars, this will work if you make it a globalcookie. This also makes sense, since you generally would want the user's language preference to be remembered. Best regards, Geert On 25-nov-05, at 14:53, Lars Grupe wrote: Hi Geert, No, it's not a cookie it's a globalvar, that is defined in the site as follows: globalvar name=locale/ I think the problem is not depedent on the type of global var I use. I will show you an part of my log file: [DEBUG] [2005-11-25 14:36:25,187] [init] Home.processElement -- main element [DEBUG] [2005-11-25 14:36:25,234] [init] LanguageSelection.processElement -- embedded element [DEBUG] [2005-11-25 14:36:25,234] [init] LanguageChanged.processElement [DEBUG] [2005-11-25 14:36:25,234] [init] LanguageSelection.processElement [DEBUG] [2005-11-25 14:36:25,234] [init]
Re: [Rife-users] localized login template
Lars, Should the path 'l10n/authentication/login' point to my login template? No, to your resource bundle to be used by the template associated to the element. Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] localized login template
Geert, Have you any suggestion for the best place to put it in wiki? Atm a lot about i18n is under Cook book Templates page. So may be a new entry Translator there, even if it's possible to use it in other context. Pierre Hi Pierre, maybe it would be a good idea for you to write a small documentation piece about the features you implemented, as I do for the release notes. This would make it easier for everybody and I can also just integrate them in the release notes of the next version. Feel free to use the wiki for doing this. Best regards, Geert On 30-mrt-06, at 12:21, Raoul Pierre wrote: Lars, Should the path 'l10n/authentication/login' point to my login template? No, to your resource bundle to be used by the template associated to the element. Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba GTalk: [EMAIL PROTECTED] Use what you need Avenue de Scailmont 34 Skype: gbevin http://www.uwyn.com 7170 Manage, Belgium AIM: geertbevin gbevin at uwyn dot com Tel: +32 64 84 80 03 Mobile: +32 477 302 599 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] UnsupportedNestedTagException with r:v name=LANG:xxxxx
Geert, With r:v name=LANG:i18n_contentSome english text:${v EXIT:QUERY:admin/}/r:v r:bv name=LANG:i18n_content:frQuelques mots:${v EXIT:QUERY:admin/}/r:bv I get an UnsupportedNestedTagException for the first ${v EXIT:QUERY:admin/} but if I remove it the second one works fine. Is it at purpose that a value tag can't be nested in the default value of a LANG: tag? Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Submission and i18n test
Hello, To avoid 2 failures with TestEngineSubmissions.testSubmissionBean, I had to add Locale.get/setDefault calls: public void testSubmissionBean() throws Exception { Locale locale = Locale.getDefault(); Locale.setDefault(Locale.ENGLISH); [...] String result = response.getText(); Locale.setDefault(locale); assertEquals(the string,the stringbuffer,23154,893749,u,null,true,false,0,21,34878.34,25435.98,3434.76,6534.8,34347897,2335454,32,12,this is some html content,true,someimage.png,true,Sat 20 Aug 2005 09:44:00, result); [...] Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] ElementSupport.getInput
Geert, The method ElementSupport.getInput(String name, String defaultValue) throws an rife.engine.exceptions.InputUnknownException when no name input exists. The test on null input is never used. Proposition: public String getInput(String name, String defaultValue) throws EngineException { try { return getInput(name); } catch (InputUnknownException iue){ return defaultValue; } } Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Reinitialize a singleton during unit test
Hello, Is there any easy way to reinitialize a singleton during unit test, for exemple: public class I18nSingleton { static final I18n INSTANCE = I18n.getInstance(); static final LocaleProviderFactory DEFAULT_LOCALE_PROVIDER_FACTORY = INSTANCE.getDefaultLocaleProviderFactory(); static final TranslatorFactory DEFAULT_TRANSLATOR_FACTORY = INSTANCE.getDefaultTranslatorFactory(); } The goal is to test different implementation of I18n, LocaleProviderFactory TranslatorFactory . Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Localisation and automatic language detection
Does anyone know what the current status of automatic language detection (from web browser header values) is? The main part is done: - no more Spring - all the unit tests for Template, Test and Tools are OK Still to be done: - update with Rife 1.4 - check Rife style - add doc - add some specifics unit tests Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Template unit tests
Geert, Yes I did. I also ran the tests on Windows and they pass. It's also ok for me now. Thanks again. Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Template unit tests
Geert, When I run the unit tests: suite.addTest(com.uwyn.rife.template.TestSuiteTemplate.suite()); suite.addTest(com.uwyn.rife.test.TestSuiteTest.suite()); suite.addTest(com.uwyn.rife.tools.TestSuiteTools.suite()); with Rife directly copied from CVS, I get many failures and one error, see messages below. I use Windows XP Pro and I run the test with ant target test under Eclipse 3. It seems there is three types of issue: - Parser bug: I can't see any difference between the 2 strings; but if I check directly their length, they aren't different! - files not found, e.g. includes_reload_master is not found (but there is a includes_reload_master_in html file ...) - postgresql is used: I have no such RDBMS installed; should it be possible to choice an other one? Regards Pierre == [java] Time: 62,688 [java] There was 1 error: [java] 1) testReloadTransformationDependencies(com.uwyn.rife.template.TestTemplateFactory)com.uwyn.rife.template.exceptions.FilterNotFoundException: Couldn't find the filter 'transformation_reload_dependency2.xsl'. [java] at com.uwyn.rife.template.TemplateTransformerXslt.addFilter(TemplateTransformerXslt.java:106) [java] at com.uwyn.rife.template.TestTemplateFactory.testReloadTransformationDependencies(TestTemplateFactory.java:3722) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.TestRife.main(TestRife.java:43) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.test.RunWithEngineClassLoader.main(RunWithEngineClassLoader.java:44) [java] There were 18 failures: [java] 1) testParseIncludesOtherType(com.uwyn.rife.template.TestParser)junit.framework.ComparisonFailure: expected:... [java] !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; [java] html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=eng... but was:... [java] !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; [java] html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=eng [java] ... [java] at com.uwyn.rife.template.TestParser.testParseIncludesOtherType(TestParser.java:638) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.TestRife.main(TestRife.java:43) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.test.RunWithEngineClassLoader.main(RunWithEngineClassLoader.java:44) [java] 2) testFilteredTagsRenderHtml(com.uwyn.rife.template.TestTemplateFactory)junit.framework.ComparisonFailure: expected:... [java] This is another render value 'RENDER:COM.UWYN.RIFE.TEMPLATE.RENDERERIMPLnull:1'. [java] This is the render value with a differentiator 'RENDER:COM.UWYN.RIFE.TEMPLATE.RENDERERIMPL:DIFFERENT:different:2' but was:... [java] This is another render value 'RENDER:COM.UWYN.RIFE.TEMPLATE.RENDERERIMPLnull:1'. [java] This is the render value with a differentiator 'RENDER:COM.UWYN.RIFE.TEMPLATE.RENDERERIMPL:DIFFERENT:different:2'. [java] ... [java] at com.uwyn.rife.template.TestTemplateFactory.testFilteredTagsRenderHtml(TestTemplateFactory.java:577) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.TestRife.main(TestRife.java:43) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.test.RunWithEngineClassLoader.main(RunWithEngineClassLoader.java:44) [java] 3)
Re: [Rife-users] Template unit tests
Geert, Your other errors are most probably related to the fact that you didn't configure rife/programs/unittests/config/rep/config- windows_xp.html according to the location of the files on your machine. Thanks. Much less errors now... I think that the invisible equals differences are related to the linebreak differences. Either SVN converted them to windows at checkout, either something else is as play. What are they in cvs? Unix one? Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Template unit tests
Geert, I think that the invisible equals differences are related to the linebreak differences. Either SVN converted them to windows at checkout, either something else is as play. What are they in cvs? Unix one? They're in subversion, not cvs, and yeah they are unix ones. I changed eol of the concerned files, and again much less messages. See below. Is there any way to force subversion to keep the unix eol during update? Why is this an issue with Parser? Regards Pierre = [java] Time: 83,64 [java] There was 1 error: [java] 1) testReloadTransformationDependencies(com.uwyn.rife.template.TestTemplateFactory)com.uwyn.rife.template.exceptions.FilterNotFoundException: Couldn't find the filter 'transformation_reload_dependency2.xsl'. [java] at com.uwyn.rife.template.TemplateTransformerXslt.addFilter(TemplateTransformerXslt.java:106) [java] at com.uwyn.rife.template.TestTemplateFactory.testReloadTransformationDependencies(TestTemplateFactory.java:3722) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.TestRife.main(TestRife.java:43) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.test.RunWithEngineClassLoader.main(RunWithEngineClassLoader.java:44) [java] There were 8 failures: [java] 1) testParseIncludesOtherType(com.uwyn.rife.template.TestParser)junit.framework.ComparisonFailure: expected:... but was:... [java] [java] at com.uwyn.rife.template.TestParser.testParseIncludesOtherType(TestParser.java:638) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.TestRife.main(TestRife.java:43) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.test.RunWithEngineClassLoader.main(RunWithEngineClassLoader.java:44) [java] 2) testReloadBasic(com.uwyn.rife.template.TestTemplateFactory)junit.framework.AssertionFailedError: com.uwyn.rife.template.exceptions.TemplateNotFoundException: Couldn't find template 'reload_basic'. [java] at com.uwyn.rife.template.TemplateFactory.get(TemplateFactory.java:428) [java] at com.uwyn.rife.template.TemplateFactory.get(TemplateFactory.java:374) [java] at com.uwyn.rife.template.TestTemplateFactory.testReloadBasic(TestTemplateFactory.java:3441) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.TestRife.main(TestRife.java:43) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.test.RunWithEngineClassLoader.main(RunWithEngineClassLoader.java:44) [java] Caused by: java.lang.ClassNotFoundException: Couldn't resolve template: 'com.uwyn.rife.template.html.reload_basic'. [java] at com.uwyn.rife.template.TemplateClassLoader.compileTemplate(TemplateClassLoader.java:175) [java] at com.uwyn.rife.template.TemplateClassLoader.loadClass(TemplateClassLoader.java:146) [java] at com.uwyn.rife.template.TemplateFactory.get(TemplateFactory.java:397) [java] ... 27 more [java] at com.uwyn.rife.template.TestTemplateFactory.testReloadBasic(TestTemplateFactory.java:3446) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.TestRife.main(TestRife.java:43) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at
Re: [Rife-users] Template unit tests
Geert, You apparently still haven't setup your config file correctly either. So now I get only one failure, see below. I checked the files: includes_othertype_in.html includes_othertype_out_content_0.html includes_othertype_out_content_1.html includes_othertype_out_content_2.html includes_othertype_out_content_3.html includes_othertype_out_content_4.html Is there any other file concerned by this test? Other point: I had to specified the locale in TestArrayUtils.testCreateStringArrayDate. See diff below. Regards Pierre Index: C:/DEV/Rife/rife-svn-orig/src/unittests/com/uwyn/rife/tools/TestArrayUtils.java === --- C:/DEV/Rife/rife-svn-orig/src/unittests/com/uwyn/rife/tools/TestArrayUtils.java (revision 2854) +++ C:/DEV/Rife/rife-svn-orig/src/unittests/com/uwyn/rife/tools/TestArrayUtils.java (working copy) @@ -12,6 +12,7 @@ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; +import java.util.Locale; import junit.framework.TestCase; public class TestArrayUtils extends TestCase @@ -160,7 +161,7 @@ assertEquals(1, converted.length); assertEquals(2005-08-18 09:27, converted[0]); -converted = ArrayUtils.createStringArray(cal.getTime(), new ConstrainedProperty(someProperty).format(new SimpleDateFormat(.MM.dd G 'at' HH:mm:ss))); +converted = ArrayUtils.createStringArray(cal.getTime(), new ConstrainedProperty(someProperty).format(new SimpleDateFormat(.MM.dd G 'at' HH:mm:ss, Locale.ENGLISH))); assertEquals(1, converted.length); assertEquals(2005.08.18 AD at 09:27:13, converted[0]); } [java] Time: 55,766 [java] There was 1 failure: [java] 1) testParseIncludesOtherType(com.uwyn.rife.template.TestParser)junit.framework.ComparisonFailure: expected:... but was:... [java] [java] at com.uwyn.rife.template.TestParser.testParseIncludesOtherType(TestParser.java:638) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.TestRife.main(TestRife.java:43) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at com.uwyn.rife.test.RunWithEngineClassLoader.main(RunWithEngineClassLoader.java:44) [java] FAILURES!!! [java] Tests run: 528, Failures: 1, Errors: 0 BUILD SUCCESSFUL Total time: 1 minute 6 seconds ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Template unit tests
Geert, The last error is most probably because you edited a template file in an editor that insists on having a final newline at the end of a file. Some editors always add this, even is you remove that last blank line. Even if I replace my locale file by a copy from svn repository, the eol in the file are CR+LF. After some search with google, I found it's a svn issue: the files I have problem with have svn:eol-style property to native. When I remove this property and update the files, nothing appends. When I replace the locale file by a copy of the repository, svn recreates the property svn:eol-style for the file and remplace the LF by CR+LF! Same thing if I force this property to LF value. So i'm stuck. Does anybody know how to update such a file after removing the property svn:eol-style? Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Template unit tests
Geert, I set the svn:eol-style property to LF on the test template files. I hope that helps. Great! I got the files with svn:eol-style at LF :-) Did you change the value for includes_othertype_out_content_4.html? I still got the native value? Question: almost all the unittests/templates files are loaded without any svn:eol-style property. And then everything is ok: svn keeps LF as eol. Is this property set for these files on the svn repository? Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] I18n
Geert, I just finished to code a new proposition. I want to write unit tests for methods like public static Translator getTranslator(TranslatorSupport support) where I need TranslatorSupport instance, in fact ElementSupport instance. Where can I find unit tests in rife as exemples? Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] i18n and injection
Geert, That's actually not entirely correct. RIFE supports injection of any kind of object and will try its best to convert between types. Can you give me an exemple with an object other than a String. I didn't find very usefull the exemple in Ioc Support wiki article as it uses directly supported tag datasource. And I don't know where to find other exemples. You can retrieve any object from any participant, using the XML declaration. This is explained here: http://rifers.org/wiki/display/RIFE/IoC+support#IoCsupport-1 Besides that, a site structure can be declared in Java, Groovy or Janino (not just XML). So people can easily inject any object using the SiteBuilder method calls, like this: addProperty(prop1, new PropertyValueObject(myobject)) OK. So besides the participant, atm there is no way to inject object (other than string or with directly supported tags) from participants or site XML files. You need some Java, Groovy or Janino code like above. Am'I right? Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] About RIFE hosting
Christophe, I would like to ask you a question related to the hosting problem. Initially, we are going to use a cheap host. It is easy to find ones supporting PHP, cheap and with a very good service. But, for Java I don't know any. I fear that cheap solutions may not be efficient ones. Do you know of a few hosts in shared environment and supporting Java servers ? If you want very low cost server and if Tomcat is enough for you, then check http://www.llord.com Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] I18n
Geert Bevin a écrit : rarely anything is contributed to RIFE without me making changes or consulting with other developers (for my own additions). It was only proposition. I never hope that you take it as it :-) * There's no need to add javadoc statements like See [EMAIL PROTECTED] TranslatorSupport} interface. Interface methods that are implemented without javadocs will automatically inherit the javadocs that have been written in the interface and have a reference towards them. What do you mean by reference? * Defensive markup encoding If you remember well, I wasn't very enthusiast by this feature when we discussed it here before. I couldn't quite put my finger on why, but I do now. What you ask in fact is a more intelligent defensive encoding functionality. The current implementation has been quickly thrown together since it worked well enough for our purposes, but evidently it does satisfy you. So instead of adding another configuration option and imposing another syntax on users (to escape the html tags), I think it's better to let the defensive encoding feature detect when text is part of a tag or an entity and not encode that. This shouldn't be terribly difficult to do. You can detect tags with these regexp patterns: [a-z]+(?:\s+\w+\s*=\s*[^]**)*\s*/? /[a-z]+ and entities with this regexp pattern: \w+; I think that everything outside those can safely be encoded. Maybe some special handling is needed for script tags though so that the text in between those is always unescaped. What if is needed some tags as litteral strings, i.e. not to be interpreted as real tags? Anyway, I think this should better be left for a second stage and that the l18n is first focused on the dynamic provision of locales. I would thus not at all create an encoder package, nor perform the refactorings you did. * The I18n class This seems to be too hardcoded and linked to a SpringWeb participant. I don't like this very much since Spring should merely be a one possible IoC reference factory. I put all the Spring dependencies into I18n class. Then it should be the only part to refactor if an other container is to be used. I haven't looked at all the interactions, but please try to leverage the HierarchicalProperties support of RIFE that is present throughout the whole application (from Rep, to participants, to elements): http://rifers.org/wiki/ display/RIFE/IoC+properties+support+inside+the+repository I did it like this in the continuation of my first proposition about getLocales. I'll dive asap in the HierarchicalProperties stuff. However, I don't feel comfortable with the getTemplate (TemplateFactory factory, String name, String encoding, TemplateTransformer transformer) method and sibling methods that you added. I don't particularly like the changes you performed throughout the rest of the framework to delegate the instantiation of all engine template types to an element. It would be best to perform the resourcebundle addition code in the EngineTemplateInitializer class: http://rifers.org:8088/viewrep/rifers/rife/trunk/src/framework/com/ uwyn/rife/engine/EngineTemplateInitializer.java?r=HEAD As you see, it's possible that these templates are instantiated without elements, so don't make the presence of an element mandatory, things will break. OK to use EngineTemplateInitializer. It was my first attempt ;-) I don't remember exactly why I changed. My goal is to get the same behavior with encoder, locales and bundles for L10N tag in template and a direct call from an element. Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
[Rife-users] Rife-crud: not edible property also not visible
Geert, When a property is constrained with editable to false, it is not shown. But there are cases where it is needed to see such data even if it must not be changed. May I suggest a new constrain visible that will be false by default if editable is false. This need to replace the editable test in Edit/Add/DeleteTemplateTransformer.java of Rife-crud. A step further: when a value is non editable, to be able to give a first value, automatically or manually. Herewith proposition patches about this two points. Happy new year (with some hours in advance...) Pierre Index: C:/DEV/Rife/rife-svn/src/framework/com/uwyn/rife/engine/ElementContext.java === --- C:/DEV/Rife/rife-svn/src/framework/com/uwyn/rife/engine/ElementContext.java (revision 2808) +++ C:/DEV/Rife/rife-svn/src/framework/com/uwyn/rife/engine/ElementContext.java (working copy) @@ -7,24 +7,6 @@ */ package com.uwyn.rife.engine; -import com.uwyn.rife.engine.exceptions.*; -import com.uwyn.rife.template.*; -import com.uwyn.rife.tools.*; -import java.util.*; - -import com.uwyn.rife.authentication.credentialsmanagers.RoleUserAttributes; -import com.uwyn.rife.authentication.credentialsmanagers.RoleUserIdentity; -import com.uwyn.rife.authentication.elements.Identified; -import com.uwyn.rife.config.RifeConfig; -import com.uwyn.rife.engine.ContinuationContext; -import com.uwyn.rife.site.Constrained; -import com.uwyn.rife.site.ConstrainedProperty; -import com.uwyn.rife.site.ConstrainedUtils; -import com.uwyn.rife.site.FormBuilder; -import com.uwyn.rife.template.exceptions.TemplateException; -import com.uwyn.rife.tools.exceptions.BeanUtilsException; -import com.uwyn.rife.tools.exceptions.ConversionException; -import com.uwyn.rife.tools.exceptions.SerializationUtilsErrorException; import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.beans.Introspector; @@ -34,12 +16,31 @@ import java.io.UnsupportedEncodingException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; + import javax.servlet.RequestDispatcher; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; +import com.uwyn.rife.authentication.credentialsmanagers.RoleUserAttributes; +import com.uwyn.rife.authentication.credentialsmanagers.RoleUserIdentity; +import com.uwyn.rife.authentication.elements.Identified; +import com.uwyn.rife.config.RifeConfig; +import com.uwyn.rife.engine.exceptions.*; +import com.uwyn.rife.i18n.Encoder; +import com.uwyn.rife.site.Constrained; +import com.uwyn.rife.site.ConstrainedProperty; +import com.uwyn.rife.site.ConstrainedUtils; +import com.uwyn.rife.site.FormBuilder; +import com.uwyn.rife.template.*; +import com.uwyn.rife.template.exceptions.TemplateException; +import com.uwyn.rife.tools.*; +import com.uwyn.rife.tools.exceptions.BeanUtilsException; +import com.uwyn.rife.tools.exceptions.ConversionException; +import com.uwyn.rife.tools.exceptions.SerializationUtilsErrorException; + public class ElementContext { public static final String PREFIX_EXIT_QUERY = EXIT:QUERY:; @@ -67,6 +68,7 @@ public static final String TAG_JANINO_ROLEUSER = (?s)^(+PREFIX_JANINO_ROLEUSER+.*):\\s*\\[\\[\\s*(.*)\\s*\\]\\]\\s*$; public static final String TAG_GROOVY_ROLEUSER = (?s)^(+PREFIX_GROOVY_ROLEUSER+.*):\\s*\\[\\[\\s*(.*)\\s*\\]\\]\\s*$; + protected final static String EMPTY_STRING = ; //$NON-NLS-1$ private static ThreadLocalElementSupport sActiveElements = new ThreadLocalElementSupport(); private ElementSupport mElement = null; @@ -1090,14 +1092,14 @@ { return mOutputs; } - + Template getHtmlTemplate(String name, String encoding, TemplateTransformer transformer) throws TemplateException { if (null == name) throw new IllegalArgumentException(name can't be null.); if (0 == name.length()) throw new IllegalArgumentException(name can't be empty.); - return TemplateFactory.ENGINEHTML.get(name, encoding, transformer); + return mElement.getTemplate(TemplateFactory.ENGINEHTML, name, encoding, transformer); } Template getXhtmlTemplate(String name, String encoding, TemplateTransformer transformer) @@ -1106,7 +1108,7 @@ if (null == name) throw new IllegalArgumentException(name can't be null.); if (0 == name.length()) throw new IllegalArgumentException(name can't be empty.); - return TemplateFactory.ENGINEXHTML.get(name, encoding, transformer); +
Re: [Rife-users] I18n
Geert Bevin a écrit : Is everything in the new i18n package tested? Yes but EncoderSql / Xhtml / Xml And everything works as current Rife if there is no participant for the i18nContext.xml file. The main API change is the removed TemplateEncoder interface: there is now the com.uwyn.rife.i18n.Encoder. The idea is: - Encoder is accessible from the Element level; - but direct access must be avoided: Translator hides it. Note. There are two types of encodage: charset and markup. And in the two cases, encode words are used. It can be confusing. Any better idea for one of them? Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] ENGINEHTML and xhtml dtd in html file
Geert, !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd Ok, but that doesn't really matter, does it? There is a little difference about apos; which is defined in xhtml but not in html. Atm StringUtils.encodeHtml doesn't encode it. Both engine types behave the same except for resolving the template name with a file name extension. Yes May be it's possible to do both of them: - for any element or template, to give the choice between with or without html tags/entities capabilities - even in the case without html tags/entities, to be able to use them with escaping, like summary-legend = XHTML Transitional 1.0\\br /\\Fragment body-help = \\div class=\\form_helpVous pouvez saisir ici le texte complet de la nouvelle. Seul \ du texte XHTML valide est acceptable.\ \/div\\ I'm not so sure about this. You'll still have to educate people that they have to escape these character with a custom RIFE method. Yes. In my opinion, it's much better for them to know how to escape the characterd that encodeDefensive doesn't handle in a standard xhtml way. At least they already know it correctly. My concern is to manage properties files with as few as possible code rules in them: - here, in addition to the specify rules of properties files (dynamic value, unicode, eol...), by default you must know at least the html codage of these characters - if you want to use these files in a not web context, you must then filter such html code. Also, check out the frequency. How often do you add ' to text. It's actually just really once in a while. But it's something very nasty to deal with. And not so rare in language as french, with apostrophe and quotations When you have xhtml enabled properties, you'll have a lot more characters for the tags. So imho this custom escaping might actually be more work. Yes. I think we should have the best of the two, as wanted: - separation of concern ( :-) I succeeded to place it!), i.e. pure text: if xhtml tags are needed, then escape with something like \\ - xhtml enabled: ' as literals must be escaped with xhtml entity references Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] ENGINEHTML and xhtml dtd in html file
Geert, - TemplateFactoryEngineTypes associates EncoderHtml instance with TemplateFactory ENGINEHTML and ENGINEXHTML - TemplateFactory ENGINEHTML is used with all html files, even if xhtml dtd is specified inside the file. No, it's used when you do getHtmlTemplate from within your element. Using getXhtmlTemplate gives you an ENGINEXHTML type. Sorry I was not clear enough. The point is neither about html or xhtml file suffix nor about ENGINEHTML or ENGINEXHTML instances: it's always EncoderHtml which is used. What do you mean with the dtd? Even in files with html suffixe, it can be xhtml code, e.g. in src/templates/crud/common/blueprint_admin.html, you have: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; - AbstractTemplate.evaluateL10nTags uses EncoderHtml.encodeDefensive and not EncoderHtml.encodeDefensive to convert string, that is StringUtils.encodeHtmlDefensive - this last method doesn't convert , , , ' and So, for html files with xhtml dtd and for xhtml files, we can have trouble when any of the above characters is present in a key's value, e.g. double quote used in an attribute's value: then the end of the value is not displayed. I'm not fully following, can you give an example? For exemples: 1/ put some character inside element body like: Take xp and then..., the tag will be ppTake xp and then.../p only 'Take x' will be displayed 2/ a buttom wich must display text with quotation inside as: Liste des canailles, the tag will be input type=submit value=Liste des canailles / and only 'Liste des ' displayed. 3/ if simple quote is used for an attribut and the text is: S'inscrire, then the tag will be input type='submit value='S'inscrire' / only 'S' displayed. Note: XHTML 1.0 Standard states 4.4 Attribute values must always be quoted - All attribute values must be quoted, even those which appear to be numeric. But it dosn't specify single or double quotes. 4/ with value as Rire pleurer The XHTML 1.0 standard states: C.12 Using Ampersands in Attribute Values When an attribute value contains an ampersand, it must be expressed as a character entity reference (e.g. amp;). For example, when the href attribute of the a element refers to a CGI script that takes parameters, it must be expressed as http://my.site.dom/cgi-bin/myscript.pl?class=guestamp;name=user rather than as http://my.site.dom/cgi-bin/myscript.pl?class=guestname=user.; Is there any reason against to used EncoderHtml.encodeDefensive in all the cases. Yes, if you want to make sure that no html tags or entities can be provided at all through form fields. OK I never used such possibilities. I put only pure text in properties files: anybody can translate them without knowing anything in codage. Is the choice only between: - to be able to provide html tags ans entities from properties files - to be able to use , , , ' and caracters for attribute or element values. May be it's possible to do both of them: - for any element or template, to give the choice between with or without html tags/entities capabilities - even in the case without html tags/entities, to be able to use them with escaping, like summary-legend = XHTML Transitional 1.0\\br /\\Fragment body-help = \\div class=\\form_helpVous pouvez saisir ici le texte complet de la nouvelle. Seul \ du texte XHTML valide est acceptable.\\/div\\ Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
[Rife-users] ENGINEHTML and xhtml dtd in html file
Hello, Atm: - TemplateFactoryEngineTypes associates EncoderHtml instance with TemplateFactory ENGINEHTML and ENGINEXHTML - TemplateFactory ENGINEHTML is used with all html files, even if xhtml dtd is specified inside the file. - AbstractTemplate.evaluateL10nTags uses EncoderHtml.encodeDefensive and not EncoderHtml.encodeDefensive to convert string, that is StringUtils.encodeHtmlDefensive - this last method doesn't convert , , , ' and So, for html files with xhtml dtd and for xhtml files, we can have trouble when any of the above characters is present in a key's value, e.g. double quote used in an attribute's value: then the end of the value is not displayed. Is there any reason against to used EncoderHtml.encodeDefensive in all the cases. Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
[Rife-users] I18n and Rife-crud
Geert, Herewith a patch for template/crud/admin/browse.html to be able to get the L10N messsages. Regards Pierre Index: C:/DEV/Rife/rife-crud-svn/src/templates/crud/admin/browse.html === --- C:/DEV/Rife/rife-crud-svn/src/templates/crud/admin/browse.html (revision 2755) +++ C:/DEV/Rife/rife-crud-svn/src/templates/crud/admin/browse.html (working copy) @@ -27,13 +27,15 @@ tr !--V 'columnheaders'--!--/V-- !--B 'columnheader'-- - th nowrap=nowrapdiv\!--V 'L10N:[!V 'property'/]'--!--V 'property'/--\!--/V--/div/th + th nowrap=nowrapdiv\!--V 'L10N:[!V 'property'/]'--!--V 'property'/--\!--/V--/div/th !--/B-- th nowrap=nowrapdiv\!--V 'L10N:column_label-actions'--column_label-actions\!--/V--/div/th !--V 'associationheaders'--!--/V-- !--B 'associationheader'-- - th nowrap=nowrapdiv id=association_header[!V 'association_count'/]\!--V 'L10N:association_header-[!V 'association_classname'/]'--association_header-!--V 'association_classname'/--\!--/V--/div/th - \!--BV 'L10N:association_header-[!V 'association_classname'/]'--!--V 'association_short-classname'/--\!--/BV-- + th nowrap=nowrap + div id=association_header[!V 'association_count'/]\!--V 'L10N:association_header-[!V 'association_classname'/]'--\!--/V--/div/th + \!--BV 'L10N:association_header-[!V 'association_classname'/]'--\!--V 'L10N:association_header-[!V 'association_short-classname'/]'--\!--/V--\!--/BV-- + \!--BV 'L10N:association_header-[!V 'association_short-classname'/]'--[!V 'association_short-classname'/]\!--/BV-- !--/B-- /tr /thead ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] IDE Support (Eclipse)
Emmanuel, I noticed that there are 4 of us currently (Pierre Raoul, Geert Bevin, Oliver Dohmen and I) who have shown interest in helping build the RIFE eclipse plugin. I was wondering if folk would like to start discussions/code towards this. I don't have the skill or experience about writing Eclipse plugin. Eclipse is only my favorite (and unique) IDE. I'm concerned by any improvement of Rife integration in Eclipse. So on this point I can help on discussion, not on code ;-) I had taken a look at the ant plugin to get a few ideas, but thinking about it more, i think the wst carves a good place for us to start. Thoughts? Anyone with any experience building an eclipse plugin? If I'm right, it will provide a graphical tool for the representation of Rife applications. What about GEF or even VE? Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] rife and l10n
Geert, I'll be only able to look at it in a few days since I will be at JavaPolis and just got a last minute confirmation that I'll be giving a 2 1/2 h RIFE University session tomorrow morning. Good. Unluckily, I won't be there... I briefly glanced over the code, and it looks good. Before I can commit it though, it needs some tests that cover the added features. I still have some issues about the ResourceBundle list. Its priority order is broken as AbstractTemplate runs evaluateL10nTags twice (in initialize and processLateTags). Is it needed to keep the call from initialize? Other point: what about a specific class to deal with ResourceBundle list? So we can avoid to put its management in ElementSupoort or other existing class. Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Readying RIFE 1.3
Geert, When I rebuild rife-crud completly with ant package, I get the error below. If I run ant package again, this time the build is ok. Notes: Eclipse 3.1, Windows XP, JDK 1.5 Regards Pierre Buildfile: C:\DEV\Rife\rife-crud-svn\build.xml init: [echo] === RIFE Crud 1.1 [2004-2005] === prepare: [mkdir] Created dir: C:\DEV\Rife\rife-crud-svn\build\classesweaved [mkdir] Created dir: C:\DEV\Rife\rife-crud-svn\build\tests compile: libjar15: [mkdir] Created dir: C:\DEV\Rife\rife-crud-svn\build\dist [jar] Building jar: C:\DEV\Rife\rife-crud-svn\build\dist\rife-crud-1.1-jdk15.jar weaveClassfiles: [echo] Weaving classfiles... [copy] Copying 46 files to C:\DEV\Rife\rife-crud-svn\build\classesweaved BUILD FAILED C:\DEV\Rife\rife-crud-svn\build.xml:189: java.lang.NullPointerException Total time: 5 seconds Hi everyone, I'm preparing everything to release RIFE 1.3. These are the reported issues that were fixed: http://servlet.uwyn.com/issues/secure/IssueNavigator.jspa? reset=truepid=1fixfor=10311 This is the start of the changelog, which includes details of all the other things that have been done: http://rifers.org:8088/changelog/rifers/rife/trunk?fromid=2587 (you can browse to later revisions in the changelog with the navigation buttons that FishEye provides) I generated new snapshots with the latest commit in them, you can download them here: http://rifers.org/downloads/rife/snapshots/rife-1.3-snapshot-20051207/ It would be great if as many people as possible can try them out, at least to see if all their current projects are still running without a problem. Those who requested fixes or new features, please check if they behave as intended. In the meantime I'll get started on the release notes. I'd like to release before next Monday, since I'm talking then about RIFE at JavaPolis. Best regards, Geert -- Geert Bevin Uwyn bvba Use what you need Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
[Rife-users] rife and l10n
Geert, Herewith a new proposition with: - Spring as IoC container - interface ListLocale getLocales(ElementSupport) Regards Pierre ?xml version=1.0 encoding=UTF-8? !DOCTYPE beans PUBLIC -//SPRING//DTD BEAN//EN http://www.springframework.org/dtd/spring-beans.dtd; beans bean id=UserLocaleProvider class=com.uwyn.rife.i18n.UserLocaleProvider lazy-init=true / bean id=RequestLocaleProvider class=com.uwyn.rife.i18n.RequestLocaleProvider lazy-init=true / bean id=BaseLocaleProvider class=com.uwyn.rife.i18n.BaseLocaleProvider lazy-init=true / bean id=LocaleProviderFactory class=com.uwyn.rife.i18n.DefaultLocaleProviderFactory property name=defaultProviderref local=UserLocaleProvider//property /bean /beans package com.uwyn.rife.i18n; import java.util.ArrayList; import java.util.List; import java.util.Locale; import com.uwyn.rife.config.RifeConfig; import com.uwyn.rife.engine.ElementSupport; public abstract class AbstractLocaleProvider implements LocaleProvider { public final static String PROP_L10N_DEFAULT_LANGUAGE = RifeConfig.Tools.PARAM_L10N_DEFAULT_LANGUAGE; public final static String PROP_L10N_DEFAULT_COUNTRY = RifeConfig.Tools.PARAM_L10N_DEFAULT_COUNTRY; protected final static String EMPTY_STRING = ; //$NON-NLS-1$ AbstractLocaleProvider () { } public ListLocale getLocales(ElementSupport element) { if (element == null) { return null; } return addLocales(new ArrayListLocale(), element); } protected void addAllNotNullLocales(ListLocale locales, ListLocale more) { if (more != null) { for(Locale locale : more) { if (locale != null) { locales.add(locale); } } } } protected void addNotNullLocale(ListLocale locales, Locale more) { if (more != null) { locales.add(more); } } /* * Used to specify the locales in reverse order of priority */ protected abstract ListLocale addLocales(ListLocale locales, ElementSupport element); protected abstract Locale getDefaultLocale(ElementSupport element); } /* * This locale provider has a behavior similar to the old one of Rife, * i.e. with only default value. But this one can be changed by any * element. * */ package com.uwyn.rife.i18n; import java.util.List; import java.util.Locale; import com.uwyn.rife.engine.ElementSupport; import com.uwyn.rife.engine.exceptions.EngineException; public class BaseLocaleProvider extends AbstractLocaleProvider { protected ListLocale addLocales(ListLocale locales, ElementSupport element){ locales.add(getDefaultLocale(element)); // null: en as last default return locales; } protected Locale getDefaultLocale(ElementSupport element) { try { String language = element.getPropertyString(PROP_L10N_DEFAULT_LANGUAGE); if (language != null) { return new Locale( language , element.getPropertyString(PROP_L10N_DEFAULT_COUNTRY, EMPTY_STRING) ); } } catch (EngineException ee) { } return null; } } package com.uwyn.rife.i18n; import com.uwyn.rife.engine.ElementSupport; public final class DefaultLocaleProviderFactory implements LocaleProviderFactory { public static final String PROP_L10N_LOCALE_PROVIDER = L10N_LOCALE_PROVIDER; //$NON-NLS-1$ private static final String DEFAULT_LOCALE_PROVIDER = BaseLocaleProvider;//$NON-NLS-1$ private LocaleProvider defaultProvider = null; protected DefaultLocaleProviderFactory() { } public void setDefaultProvider(LocaleProvider provider) { this.defaultProvider = provider; } public LocaleProvider getDefaultProvider() { return this.defaultProvider; } public LocaleProvider getInstance(ElementSupport element) { LocaleProvider provider = null; if (element.hasProperty(PROP_L10N_LOCALE_PROVIDER)) { String locale_provider_type = null; locale_provider_type = element.getPropertyString(PROP_L10N_LOCALE_PROVIDER); if ((locale_provider_type != null) (locale_provider_type.length() 0)) { provider = Locales.getProvider(locale_provider_type); if (provider != null) { return provider; }
[Rife-users] Spring
Hello Seems that for Spring A is not A... Any idea? Pierre (The code is after the exception) /org.springframework.beans.factory.BeanNotOfRequiredTypeException/ *Bean named 'appVersionTarget' must be of type [com.uwyn.ecalendar.elements.Version], but was actually of type [com.uwyn.ecalendar.elements.Version]* at org.springframework.beans.factory.support.AbstractBeanFactory getBean ( AbstractBeanFactory.java : 245 ) at org.springframework.beans.factory.support.AbstractBeanFactory getBean ( AbstractBeanFactory.java : 151 ) at org.springframework.context.support.AbstractApplicationContext getBean ( AbstractApplicationContext.java : 552 ) at com.uwyn.rife.jumpstart.elements.pub.Home processElement ( Home.java : 20 ) at com.uwyn.rife.engine.ElementContext processContext ( ElementContext.java : 587 ) at com.uwyn.rife.engine.RequestState service ( RequestState.java : 212 ) at com.uwyn.rife.engine.Gate handleRequest( Gate.java : 422 ) at com.uwyn.rife.engine.Gate handleRequest( Gate.java : 240 ) at sun.reflect.NativeMethodAccessorImpl invoke0 ( NativeMethodAccessorImpl.java ) at sun.reflect.NativeMethodAccessorImpl invoke ( NativeMethodAccessorImpl.java : 39 ) at sun.reflect.DelegatingMethodAccessorImpl invoke ( DelegatingMethodAccessorImpl.java : 25 ) at java.lang.reflect.Method invoke ( Method.java : 585 ) at com.uwyn.rife.servlet.RifeFilter doFilter ( RifeFilter.java : 112 ) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain doFilter ( WebApplicationHandler.java : 823 ) at org.mortbay.jetty.servlet.WebApplicationHandler dispatch ( WebApplicationHandler.java : 473 ) at org.mortbay.jetty.servlet.ServletHandler handle ( ServletHandler.java : 567 ) at org.mortbay.http.HttpContext handle ( HttpContext.java : 1565 ) *9 more ...* package com.uwyn.rife.jumpstart.elements.pub; import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; import com.uwyn.ecalendar.elements.Version; import com.uwyn.rife.engine.Element; import com.uwyn.rife.template.Template; public class Home extends Element { public void processElement() { ApplicationContext ctx = new FileSystemXmlApplicationContext(c:/DEV/Rife/rife-popsuite/web/WEB-INF/applicationContext2.xml); Version v = (Version) ctx.getBean(appVersionTarget, Version.class); System.out.println([com.uwyn.rife.jumpstart.elements.pub.Home] popsuite version class name: +v.getClass().getName()); Template template = getHtmlTemplate(pub.home); print(template); } } with applicationContext2.xml: ?xml version=1.0 encoding=UTF-8? !DOCTYPE beans PUBLIC -//SPRING//DTD BEAN//EN http://www.springframework.org/dtd/spring-beans.dtd; beans bean id=appVersionTarget class=com.uwyn.ecalendar.elements.Version/ /beans ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring
Geert, Can you output the both values of com.uwyn.ecalendar.elements.Version.class.hashcode() ? There are different: [com.uwyn.rife.jumpstart.elements.pub.Home] popsuite version class, direct hashcode: 5884890 [com.uwyn.rife.jumpstart.elements.pub.Home] popsuite version class, bean hashcode: 22445676 Pierre On 6-dec-05, at 13:35, Raoul Pierre wrote: Hello Seems that for Spring A is not A... Any idea? Pierre (The code is after the exception) /org.springframework.beans.factory.BeanNotOfRequiredTypeException/ *Bean named 'appVersionTarget' must be of type [com.uwyn.ecalendar.elements.Version], but was actually of type [com.uwyn.ecalendar.elements.Version]* at org.springframework.beans.factory.support.AbstractBeanFactory getBean ( AbstractBeanFactory.java : 245 ) at org.springframework.beans.factory.support.AbstractBeanFactory getBean ( AbstractBeanFactory.java : 151 ) at org.springframework.context.support.AbstractApplicationContext getBean ( AbstractApplicationContext.java : 552 ) at com.uwyn.rife.jumpstart.elements.pub.Home processElement( Home.java : 20 ) at com.uwyn.rife.engine.ElementContextprocessContext ( ElementContext.java : 587 ) at com.uwyn.rife.engine.RequestStateservice( RequestState.java : 212 ) at com.uwyn.rife.engine.GatehandleRequest ( Gate.java : 422 ) at com.uwyn.rife.engine.GatehandleRequest ( Gate.java : 240 ) at sun.reflect.NativeMethodAccessorImplinvoke0( NativeMethodAccessorImpl.java ) at sun.reflect.NativeMethodAccessorImplinvoke( NativeMethodAccessorImpl.java : 39 ) at sun.reflect.DelegatingMethodAccessorImplinvoke( DelegatingMethodAccessorImpl.java : 25 ) at java.lang.reflect.Methodinvoke ( Method.java : 585 ) at com.uwyn.rife.servlet.RifeFilterdoFilter( RifeFilter.java : 112 ) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain doFilter ( WebApplicationHandler.java : 823 ) at org.mortbay.jetty.servlet.WebApplicationHandler dispatch( WebApplicationHandler.java : 473 ) at org.mortbay.jetty.servlet.ServletHandlerhandle( ServletHandler.java : 567 ) at org.mortbay.http.HttpContexthandle ( HttpContext.java : 1565 ) *9 more ...* package com.uwyn.rife.jumpstart.elements.pub; import org.springframework.context.ApplicationContext; import org.springframework.context.support.FileSystemXmlApplicationContext; import com.uwyn.ecalendar.elements.Version; import com.uwyn.rife.engine.Element; import com.uwyn.rife.template.Template; public class Home extends Element { public void processElement() { ApplicationContext ctx = new FileSystemXmlApplicationContext(c:/ DEV/Rife/rife-popsuite/web/WEB-INF/applicationContext2.xml); Version v = (Version) ctx.getBean(appVersionTarget, Version.class); System.out.println([com.uwyn.rife.jumpstart.elements.pub.Home] popsuite version class name: +v.getClass().getName()); Template template = getHtmlTemplate(pub.home); print(template); } } with applicationContext2.xml: ?xml version=1.0 encoding=UTF-8? !DOCTYPE beans PUBLIC -//SPRING//DTD BEAN//EN http:// www.springframework.org/dtd/spring-beans.dtd beans bean id=appVersionTarget class=com.uwyn.ecalendar.elements.Version/ /beans ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba Use what you need Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring
Geert, Ok, then you either have two versions of that class, either the same class is loaded by different classloaders. Can you get the class's classloader's classname and again the instance hashcode? The Bozo class doesn't extend any other class and is only called by Home class. No other Bozo class. Only bean id=appBozoTarget class=com.uwyn.ecalendar.elements.Bozo/ in applicationContext2.xml Then: 6 déc. 2005 15:50:20 org.mortbay.http.SocketListener start INFO: Started SocketListener on 0.0.0.0:8008 6 déc. 2005 15:50:20 org.mortbay.util.Container start INFO: Started [EMAIL PROTECTED] 6 déc. 2005 15:50:20 org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Root WebApplicationContext: initialization started 6 déc. 2005 15:50:20 org.mortbay.jetty.servlet.ServletHandler$Context log INFO: Loading Spring root WebApplicationContext 6 déc. 2005 15:50:21 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext2.xml] 6 déc. 2005 15:50:21 org.springframework.context.support.AbstractRefreshableApplicationContext refreshBeanFactory INFO: Bean factory for application context [Root WebApplicationContext]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [appBozoTarget]; root of BeanFactory hierarchy 6 déc. 2005 15:50:21 org.springframework.context.support.AbstractApplicationContext refresh INFO: 1 beans defined in application context [Root WebApplicationContext] 6 déc. 2005 15:50:21 org.springframework.core.CollectionFactory clinit INFO: JDK 1.4+ collections available 6 déc. 2005 15:50:21 org.springframework.context.support.AbstractApplicationContext initMessageSource INFO: Unable to locate MessageSource with name 'messageSource': using default [EMAIL PROTECTED] 6 déc. 2005 15:50:21 org.springframework.context.support.AbstractApplicationContext initApplicationEventMulticaster INFO: Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [EMAIL PROTECTED] 6 déc. 2005 15:50:21 org.springframework.ui.context.support.UiApplicationContextUtils initThemeSource INFO: No ThemeSource found for [Root WebApplicationContext]: using ResourceBundleThemeSource 6 déc. 2005 15:50:21 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [appBozoTarget]; root of BeanFactory hierarchy] 6 déc. 2005 15:50:21 org.springframework.beans.factory.support.AbstractBeanFactory getBean INFO: Creating shared instance of singleton bean 'appBozoTarget' [com.uwyn.ecalendar.elements.Bozo] ctor, classloader: com.uwyn.rife.engine.EngineClassLoader 6 déc. 2005 15:50:22 org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Using context class [org.springframework.web.context.support.XmlWebApplicationContext] for root WebApplicationContext 6 déc. 2005 15:50:22 org.springframework.web.context.ContextLoader initWebApplicationContext INFO: Root WebApplicationContext: initialization completed in 1797 ms 6 déc. 2005 15:50:45 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from file [c:\DEV\Rife\rife-popsuite\web\WEB-INF\applicationContext2.xml] 6 déc. 2005 15:50:45 org.springframework.context.support.AbstractRefreshableApplicationContext refreshBeanFactory INFO: Bean factory for application context [org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=31147154]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [appBozoTarget]; root of BeanFactory hierarchy 6 déc. 2005 15:50:45 org.springframework.context.support.AbstractApplicationContext refresh INFO: 1 beans defined in application context [org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=31147154] 6 déc. 2005 15:50:45 org.springframework.context.support.AbstractApplicationContext initMessageSource INFO: Unable to locate MessageSource with name 'messageSource': using default [EMAIL PROTECTED] 6 déc. 2005 15:50:45 org.springframework.context.support.AbstractApplicationContext initApplicationEventMulticaster INFO: Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [EMAIL PROTECTED] 6 déc. 2005 15:50:45 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [appBozoTarget]; root of BeanFactory hierarchy] 6 déc. 2005 15:50:45 org.springframework.beans.factory.support.AbstractBeanFactory getBean INFO: Creating shared instance of singleton bean 'appBozoTarget'
Re: [Rife-users] Spring
Geert, Could you do this on the class and the instance that aren't compatible: com.uwyn.ecalendar.elements.Version.class.getClassLoader().getClass ().getName(); com.uwyn.ecalendar.elements.Version.class.getClassLoader().hashCode(); instance.getClass().getClassLoader().getClass().getName(); instance.getClass().getClassLoader().hashCode(); Sorry not to have told you that it was at the end of the output: [com.uwyn.ecalendar.elements.Bozo] ctor, classloader: sun.misc.Launcher$AppClassLoader [com.uwyn.ecalendar.elements.Bozo] ctor, classloader: com.uwyn.rife.engine.EngineClassLoader [com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, bean hashcode: 15470939 [com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, direct hashcode: 6789355 [com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, bean classloader type/hashcode: sun.misc.Launcher$AppClassLoader / 20120943 [com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, direct classloader type/hashcode: com.uwyn.rife.engine.EngineClassLoader / 20812788 Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Spring
Geert, That's of the Home class, no? Not of the Version class? In the Home class, I have: ApplicationContext ctx = new FileSystemXmlApplicationContext(c:/DEV/Rife/rife-popsuite/web/WEB-INF/applicationContext2.xml); Object bozo1 = ctx.getBean(appBozoTarget); Bozo bozo2 = new Bozo(); System.out.println([com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, bean hashcode: + bozo1.hashCode()); System.out.println([com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, direct hashcode: +bozo2.hashCode()); System.out.println([com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, bean classloader type/hashcode: + bozo1.getClass().getClassLoader().getClass().getName() + / + bozo1.getClass().getClassLoader().hashCode() ); System.out.println([com.uwyn.rife.jumpstart.elements.pub.Home] Bozo class, direct classloader type/hashcode: + bozo2.getClass().getClassLoader().getClass().getName() + / + bozo2.getClass().getClassLoader().hashCode() ); Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] localized login template
Geert No, it will be a property, you can set properties inside the rep tag that will be used throughout the system. You can override them in the site structure or for individual elements. [...] Since it should not store the element instance in the LocaleProvider instance. The instance will be constructor through IoC and the element instance is not known in that context. It's also much more appropriate since the element instance changes at each request, and otherwise you'd have to create a new LocaleProvider instance for each request. If we want to avoid creation of LocalProvider instance with each element instance, the only way I see is to store the LocalProvider in a global variable. Is it right? Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] localized login template
Geert, Since it should not store the element instance in the LocaleProvider instance. The instance will be constructor through IoC and the element instance is not known in that context. It's also much more appropriate since the element instance changes at each request, and otherwise you'd have to create a new LocaleProvider instance for each request. If we want to avoid creation of LocalProvider instance with each element instance, the only way I see is to store the LocalProvider in a global variable. Is it right? No, if they are injected through IoC, the reference factory can either provide the LocalProvider as a singleton, singleton: is there no risk of confusion between 2 or more elements from different threads? either instantiate it at each use. This can then be injected into a property. We still need to add simple reference factory features to RIFE itself currently it delegates that to a repository participant can you give me a link to any howto. where you either do it in plain Java or interface with an IoC container like Spring or Pico. Regrards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] localized login template
Geert, either instantiate it at each use. This can then be injected into a property. We still need to add simple reference factory features to RIFE itself currently it delegates that to a repository participant can you give me a link to any howto. Not a real howto, but this explains it a bit: http://rifers.org/wiki/display/RIFE/IoC+support http://rifers.org/wiki/display/RIFE/IoC+properties+support+inside+the +repository In this 2d link, the exemple is about a datasource instance created through a property datasource using participant ParticipantDatasources. If I understood, to be able to define a LocaleProvider as a property, with need some participant ParticipantLocaleProviders. Is it right? Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] localized login template
Geert, this is imho the job of a specific LocaleProvider implementation. Your proposition could be a good fit for the DefaultLocaleProvider implementation. OK. Just to be sure, the only function of the interface would be: ListLocale getLocales() The element instance should be given to the ctor or the factory. What about no interface but an abstract class? (if you know of a better name, that would be cool) Not atm. Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
[Rife-users] TemplateFactory type
Hello, Is it at purpose that in ctor public TemplateFactory(String identifier, TemplateFactory base), the mIdentifierUppercase is not copied from base argument to the current factory? I think that we need here: mIdentifierUppercase = base.getIdentifierUppercase(); Same question about mDefaultContentType. Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] AspectJ bis
Geert, Nope, it's only in the build file. Not making the java process fork to execute the template precompilation prevents ant on Windows to apply the file globbing to the parameters. OK, it works now. Thanks. May I ask for a name attribut in project element of the build.xml, then Eclipse can use it as label in its ant view. Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
[Rife-users] signature issues
Geert, There are signature function issues with com.uwyn.rife.database.queries.CreateTable.foreignKey. In the first and fifth cases, there are 6 parameters... I think these need some transformation as in second case: localColumn and foreignColumn in a String[] Regards Pierre public CreateTable foreignKey(String foreignTable, String localColumn, String foreignColumn) { return foreignKey(null, foreignTable, localColumn, foreignColumn, null, null); == } public CreateTable foreignKey(String foreignTable, String localColumn, String foreignColumn, ViolationAction onUpdate, ViolationAction onDelete) { return foreignKey(null, foreignTable, new String[] {localColumn, foreignColumn}, onUpdate, onDelete); } public CreateTable foreignKey(String foreignTable, String[] columnsMapping) { return foreignKey(null, foreignTable, columnsMapping, null, null); } public CreateTable foreignKey(String foreignTable, String[] columnsMapping, ViolationAction onUpdate, ViolationAction onDelete) { return foreignKey(null, foreignTable, columnsMapping, onUpdate, onDelete); } public CreateTable foreignKey(String name, String foreignTable, String localColumn, String foreignColumn) { return foreignKey(name, foreignTable, localColumn, foreignColumn, null, null);== } public CreateTable foreignKey(String name, String foreignTable, String localColumn, String foreignColumn, ViolationAction onUpdate, ViolationAction onDelete) { return foreignKey(name, foreignTable, new String[] {localColumn, foreignColumn}, onUpdate, onDelete); } public CreateTable foreignKey(String name, String foreignTable, String[] columnsMapping) { return foreignKey(name, foreignTable, columnsMapping, null, null); } public CreateTable foreignKey(String name, String foreignTable, String[] columnsMapping, ViolationAction onUpdate, ViolationAction onDelete) { if (name != null 0 == name.length())throw new IllegalArgumentException(name can't be empty.); ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] signature issues
Geert, Which RIFE jar are you using (jdk 1.4 or jdk 1.5 version?) Are you using Eclipse? Are you using a 1.5 JDK? I'm working with Eclipse and jre from jdk1.5.0_05. I'm using svn repository rife (local files updated four hours ago) and build-1.5.xml (revision 2663) Regards Pierre Best regards, Geert On 14-nov-05, at 13:56, Raoul Pierre wrote: Geert, There are signature function issues with com.uwyn.rife.database.queries.CreateTable.foreignKey. In the first and fifth cases, there are 6 parameters... I think these need some transformation as in second case: localColumn and foreignColumn in a String[] Regards Pierre public CreateTable foreignKey(String foreignTable, String localColumn, String foreignColumn) { return foreignKey(null, foreignTable, localColumn, foreignColumn, null, null); == } public CreateTable foreignKey(String foreignTable, String localColumn, String foreignColumn, ViolationAction onUpdate, ViolationAction onDelete) { return foreignKey(null, foreignTable, new String[] {localColumn, foreignColumn}, onUpdate, onDelete); } public CreateTable foreignKey(String foreignTable, String[] columnsMapping) { return foreignKey(null, foreignTable, columnsMapping, null, null); } public CreateTable foreignKey(String foreignTable, String[] columnsMapping, ViolationAction onUpdate, ViolationAction onDelete) { return foreignKey(null, foreignTable, columnsMapping, onUpdate, onDelete); } public CreateTable foreignKey(String name, String foreignTable, String localColumn, String foreignColumn) { return foreignKey(name, foreignTable, localColumn, foreignColumn, null, null);== } public CreateTable foreignKey(String name, String foreignTable, String localColumn, String foreignColumn, ViolationAction onUpdate, ViolationAction onDelete) { return foreignKey(name, foreignTable, new String[] {localColumn, foreignColumn}, onUpdate, onDelete); } public CreateTable foreignKey(String name, String foreignTable, String[] columnsMapping) { return foreignKey(name, foreignTable, columnsMapping, null, null); } public CreateTable foreignKey(String name, String foreignTable, String[] columnsMapping, ViolationAction onUpdate, ViolationAction onDelete) { if (name != null 0 == name.length())throw new IllegalArgumentException(name can't be empty.); ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba Use what you need Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] signature issues
Geert, I think I misunderstood, these are suggestions, right? Not a remark about that fact that the signatures don't work? So you want to add some methods? No. In fact, it's AspectJ which complains about some errors inside rife-framework and rife-crud jars. When I check rife-framework files, the only one I found is about com.uwyn.rife.database.queries.CreateTable.foreignKey. But in fact it seems it's a false alarm. Eclipse points out an error about the call in line 608: The method foreignKey(String, String, String) in the type CreateTable is not applicable for the arguments (String, String, String, CreateTable.ViolationAction, CreateTable.ViolationAction) but I don't see why. So... I'll check now why AspectJ isn't happy with rife-crud. Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] AspectJ bis
Geert, Mmmm, is there any change in an other place than build-1.5.xml? For this last one, revision 2663 is the same than before (flip flop with r2662...) Pierre Hi Pierre, this was a weird problem on Windows with the java ant task parameters being extrapolated as against an active command prompt, hence it picked up the actual files on the file system instead of passing the parameters to the executed class. I committed a fix, it should now build on Windows. Best regards, Geert On 14-nov-05, at 01:18, Raoul Pierre wrote: Geert, I'm still trying to get AspectJ working with Rife. Atm, as far as joinpoints are in my projects it's ok. But when I try to define a poincut with some joinpoints in rife-1.3-snapshot-jdk15.jar, it doesn't work, with errors from inside rife jar... So I tried to compile rife from svn repository. And then I get this error with build-1.5.xml: precompileSqlTemplates: [echo] Precompiling sql templates: [java] The path '.project' is not a directory. BUILD FAILED C:\DEV\Rife\rife-svn\build-1.5.xml:347: Java returned: 1 I'm working with Eclipse+Subclipse under Windows XP. Even if I add some -e parameter, I get System.exit from TemplateDeployer's ctor with file name as .project. In fact TemplateDeployer checks directory names in its ctor, before the exclusion step in its execute function. May I suggest to replace the exit instructions in the ctor by continue ones (just keep the warnings). Other issue: in target precompileSqlTemplates, there is an include parameter, arg value=-i/ arg value=.*.${dbdriver}.*/ This pattern becomes .classpath in TemplateDeployer.main. I don't really understand this behavior. May be because ${dbdriver}= *, so the final pattern is equivalent to .*? Anyhow with the pattern .classpath, none of the sql templates are found by TemplateException execute. Is it at purpose, to avoid taking in account any sql files if no driver is specified? Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba Use what you need Avenue de Scailmont 34 http://www.uwyn.com 7170 Manage, Belgium gbevin[remove] at uwyn dot comTel +32 64 84 80 03 PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9 Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] signature issues
Geert, I've seen weird behavior with Eclipse in the past regarding to this. Sometimes Eclipse thinks that there are bad signatures or other errors while there aren't any. When I compile with the javac from the JDK everything is ok. Yes, the compilation is ok (only a bunch of deprecated and unchecked warnings), only this weird error message from Eclipse. Just make sure that you're using a JDK 1.5 version of the RIFE jar, not doing so confuses Eclipse completely. Last time I checked, RIFE/Crud compiled without a problem in Eclipse though. I'll check again later tonight. Compilation is ok and Eclipse doesn't complain. May I ask a name attribute for project element in build.xml? Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
[Rife-users] AspectJ bis
Geert, I'm still trying to get AspectJ working with Rife. Atm, as far as joinpoints are in my projects it's ok. But when I try to define a poincut with some joinpoints in rife-1.3-snapshot-jdk15.jar, it doesn't work, with errors from inside rife jar... So I tried to compile rife from svn repository. And then I get this error with build-1.5.xml: precompileSqlTemplates: [echo] Precompiling sql templates: [java] The path '.project' is not a directory. BUILD FAILED C:\DEV\Rife\rife-svn\build-1.5.xml:347: Java returned: 1 I'm working with Eclipse+Subclipse under Windows XP. Even if I add some -e parameter, I get System.exit from TemplateDeployer's ctor with file name as .project. In fact TemplateDeployer checks directory names in its ctor, before the exclusion step in its execute function. May I suggest to replace the exit instructions in the ctor by continue ones (just keep the warnings). Other issue: in target precompileSqlTemplates, there is an include parameter, arg value=-i/ arg value=.*.${dbdriver}.*/ This pattern becomes .classpath in TemplateDeployer.main. I don't really understand this behavior. May be because ${dbdriver}= *, so the final pattern is equivalent to .*? Anyhow with the pattern .classpath, none of the sql templates are found by TemplateException execute. Is it at purpose, to avoid taking in account any sql files if no driver is specified? Regards Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] spring application context
Geert, I think that is normal behavior, everything in this class is simply delegated to Spring. I updated the text to be a bit more precise about it. For more info, just look at the source code: https://svn.rifers.org/rife/trunk/src/framework/com/uwyn/rife/rep/ participants/ParticipantSpringWeb.java In ParticipantSpringWeb, the value of ParticipantSpringWeb is used to set an attribute. But in ContextLoader.createWebApplicationContext there is: String configLocation = servletContext.getInitParameter(CONFIG_LOCATION_PARAM); and so the ParticipantSpringWeb value is not get here to set configLocation. So it's always the default location which is used (/WEB-INF/applicationContext.xml) Did I miss something? Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] spring application context
Geert, afaik this is overridden in ParticipantSpringWeb with this line: context.setAttribute(ContextLoader.CONFIG_LOCATION_PARAM, getParameter ()); This instruction adds a ContextLoader.CONFIG_LOCATION_PARAM item to the attribute list, not to the InitParameter one. And the context provided by (ServletContext)getRepository().getContext() doesn't give a adder to this last list. Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] eCalendar and AspectJ
Geert, And do you get it if you only have the where statement? Same exception. Note: even with the AspectJ exception, ecalendar works almost normally. Only the Scheduled view doesn't show any list. Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
[Rife-users] How to stop jetty
Hello, I run eCalendar from Eclipse (ant run). How can I stop Jetty then? Or directly load some changes in source files? Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] How to stop jetty
Geert, Just click the red 'stop' rectangle in the console window. Doesn't work. Atm I use quite a dirty trick: C:/WINDOWS/system32/taskkill.exe /F /IM java.exe Hopefully it doesn't stop neither Eclipse nor Tomcat (I put Jetty listening on port 8008 to keep running Tomcat) But I would prefer something cleaner. Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] How to stop jetty
Just click the red 'stop' rectangle in the console window. OK I found the point. It works fine now. Pierre ___ Rife-users mailing list Rife-users@uwyn.com http://www.uwyn.com/mailman/listinfo/rife-users