[Rife-users] A first component using embedded elements
Hi all, I recently started experimenting with using embedded elements to create components. Today, after just 5 minutes messing about, I produced my first component, a simple label. Here is how I did it. In sites/main.xml: subsite id=Components element id=Label implementation=web.components.Label /element /subsite In templates/test.html: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 titleView profile/title /head body !--V 'content' /-- !--BV 'content'-- pThis is your profile./p pUsername: !--V 'ELEMENT:^Components.Label'-- id = username value = uname !--/V-- !--/BV-- /body /html In web.components.Label: /* * Label.java * * $Id$ */ package web.components; import com.uwyn.rife.engine.Element; import java.util.Properties; /** * * @author Eddy.Young * @version $Revision$ */ public class Label extends Element { private String id; private String value; public void processElement() { Properties properties = getEmbedProperties(); id = properties.getProperty(id); value = properties.getProperty(value); print(label id= + id + + getInput(value) + /label); } } The interesting thing here is that the ELEMENT:name tag can embed more than one value. This can be used to specify parameters. For example, for a list component, the parameter could be the name of a bean that contains the entries. Another parameter could be the name of a template. The possibilities are virtually limitless. It would be great if those who have used embedded elements to create components could share their experience here. -- http://coding.mu http://priscimon.com/blog ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] A first component using embedded elements
ahh nice one, eddy; something new to mention when i talk again about rife on the 17th at the oracle city office :) cheers, emmanuel On 3/6/06, Eddy Young [EMAIL PROTECTED] wrote: Hi all, I recently started experimenting with using embedded elements to create components. Today, after just 5 minutes messing about, I produced my first component, a simple label. Here is how I did it. In sites/main.xml: subsite id=Components element id=Label implementation=web.components.Label /element /subsite In templates/test.html: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 titleView profile/title /head body !--V 'content' /-- !--BV 'content'-- pThis is your profile./p pUsername: !--V 'ELEMENT:^Components.Label'-- id = username value = uname !--/V-- !--/BV-- /body /html In web.components.Label: /* * Label.java * * $Id$ */ package web.components; import com.uwyn.rife.engine.Element; import java.util.Properties; /** * * @author Eddy.Young * @version $Revision$ */ public class Label extends Element { private String id; private String value; public void processElement() { Properties properties = getEmbedProperties(); id = properties.getProperty(id); value = properties.getProperty(value); print(label id= + id + + getInput(value) + /label); } } The interesting thing here is that the ELEMENT:name tag can embed more than one value. This can be used to specify parameters. For example, for a list component, the parameter could be the name of a bean that contains the entries. Another parameter could be the name of a template. The possibilities are virtually limitless. It would be great if those who have used embedded elements to create components could share their experience here. -- http://coding.mu http://priscimon.com/blog ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Mohandas Gandhi - You must be the change you wish to see in the world. ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] Problem with boolean in Beans with MySQL ?
Hi Geert, Just for your information : I made a new test with the 1.4 version of RIFE and the problem is still here. Regards, Christophe. Le 23 févr. 06 à 20:01, Geert Bevin a écrit : Hi Christophe, I can't reproduce it on OSX. I'll have to test on Windows, but I will not have time for this until next week. Best regards, Geert On 23-feb-06, at 18:15, alpheccar wrote: Hi Geert, The exact version is : MySQL 5.0.18-nt running on XP. Christophe. Hi Christophe, I tried with MySQL 4.0.21, 4.1.13 and 5.0.18 and it works correctly with all those. It would be good to know which exact version you are using. Maybe you need to upgrade to a later minor release. Best regards, Geert On 22-feb-06, at 20:52, alpheccar wrote: Hi Geert, I have just tested with another version (an old one : 4.1.15) and it is working. I cannot tell you which version I am using at my office because I don't remember but it is a more recent one. But the difference between both is : in the 4.1.15 the boolean field is giving a column TINYINT in the database but in the MySQL version I am using at my office for the web site of my team I get a BIT column. With TINYINT the restore is working. With BIT, it is not. BOOLEAN being synonym for TINYINT(1) in the MySQL documentation, I assume getting a BIT column is not right. Christophe. Le 22 févr. 06 à 19:44, Geert Bevin a écrit : Hi Christophe, first, which version of MySQL are you using? On 22-feb-06, at 19:40, alpheccar wrote: Hi All, I have a problem with a boolean field in a bean and so far I have been unable to understand why. I hope you have some clues. When I create a MySQL table based upon the class of the bean, then it is working. I have a column of type BIT for the corresponding boolean field. When I save objects in the table it is working. When the field is true I have a bit to 1 in the corresponding column and a zero otherwise. When I use some queries filtering (with a where clause) on this boolean field then it is working. But, when I am restoring a bean, I always get false for my boolean field. So, I had a look to my getters and setters and it looks like the setter is always called with an argument set to false so I assume the problem is not in my bean ? I have put no constraint on the boolean field. I have another related question : when I look at Elephant where some beans have boolean field, I see that the getter is sometime written isXXX or getXXX. Both are equivalent ? Regards, Christophe. _ __Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international. Téléchargez sur http://fr.messenger.yahoo.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.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://lists.uwyn.com/mailman/listinfo/rife-users ___ Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international. Téléchargez sur http://fr.messenger.yahoo.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.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://lists.uwyn.com/mailman/listinfo/rife-users _ __ Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international. Téléchargez sur http://fr.messenger.yahoo.com ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users -- Geert Bevin Uwyn bvba Use what you need Avenue de Scailmont 34 http://www.uwyn.com
Re: [Rife-users] JavaPosse topics
Is there anything that you find important to discuss, or anything that you would like to know more about? If I were a journalist, my first question to you would be: Why did you switch to RIFE ? fred ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users
Re: [Rife-users] JavaPosse topics
why? On 3/7/06, Geert Bevin [EMAIL PROTECTED] wrote: Well answer that for me then! I possible can't say why I switched to RIFE. ___ Rife-users mailing list Rife-users@uwyn.com http://lists.uwyn.com/mailman/listinfo/rife-users