You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
(68) |
Dec
(77) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(75) |
Feb
(84) |
Mar
(89) |
Apr
(96) |
May
(52) |
Jun
(73) |
Jul
(99) |
Aug
(46) |
Sep
(40) |
Oct
(46) |
Nov
(45) |
Dec
(25) |
2004 |
Jan
(13) |
Feb
(74) |
Mar
(40) |
Apr
(18) |
May
(31) |
Jun
(1) |
Jul
(16) |
Aug
(1) |
Sep
(21) |
Oct
(19) |
Nov
(10) |
Dec
(16) |
2005 |
Jan
(4) |
Feb
(12) |
Mar
(46) |
Apr
(33) |
May
(64) |
Jun
(1) |
Jul
(60) |
Aug
(31) |
Sep
(26) |
Oct
(24) |
Nov
(37) |
Dec
(10) |
2006 |
Jan
(3) |
Feb
(31) |
Mar
(122) |
Apr
(22) |
May
(4) |
Jun
|
Jul
|
Aug
(2) |
Sep
(4) |
Oct
(8) |
Nov
(3) |
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(8) |
From: Keats K. <ke...@xa...> - 2005-04-14 22:14:55
|
The $List tool can solve your problem. The "Ljava.lang.Object" is the JVMs polite way of telling you that $myList is an array of Objects, which is what WMScript uses to implement the square-bracket list syntax. This has always been a pain point in WMScript, but it is not easy to fix without breaking a lot of legacy templates. The $List tool gives you a pretty convenient workaround. You can see its methods in the JavaDocs: http://www.webmacro.org/api/org/webmacro/servlet/ListUtil.html. You can say: #if ($List.contains($myList,$compositeObj.name)) { ... or #if ($List.toList($myList).contains($compositeObj.name)) { ... or, using the function version: #if ($toList($myList).contains( ... or #set $myList = $toList($myList) #if ($myList.contains(... etc. Hope this does it for you. - Keats Peter Smith wrote: >I want to be able to find out if $myVar is in $mylist. > Is there syntax to handle this w/ WM template >scripting? > > ## Here is my list > #set $myList = [ "one", "two", "three" ] > > ## Here is the variable I'm looking for > #set $myVar = "two" > > ## I want to do this > #if ( $myVar in $myList ) { > do something... > } > #else { > do something else... > } > >In my particular case, $myList is a java.util.Vector >made up of composite objects - each object has a name, >value, etc. To keep maintenance simple, I wanted to >avoid doing a multiple-condition 'if' statement like >this: > > #if ( ($myVar==$possibility1) || > ($myVar==$possibility2) || > ($myVar==$possibility3) > etc. ) ) { > do something... > } > #else... > > >To give a fuller picture, my close-to-ideal >pseudo-code looks like this: > > #set $myList = [ "one", "two", "three" ] > > #foreach $compositeObj in $someRuntimeList { > > #if ($compositeObj.name in $myList) { > do something > } > #else { > do something else... > } > > } > >I've tried to turn around the 'if' condition using >this syntax: > > #if ($myList.contains($compositeObj.name)) { > >but I get a 'NoSuchMethodException on a >Ljava.lang.Object'. > >Thanks for any pointers. > >I'm willing to do some coding if we wanted to add this >to the codebase - only, not sure if I could even >understand enough of the engine (Expression.java >maybe?) to know where to start hacking. > > > > > |
From: Peter S. <sh...@ya...> - 2005-04-14 21:52:44
|
I want to be able to find out if $myVar is in $mylist. Is there syntax to handle this w/ WM template scripting? ## Here is my list #set $myList = [ "one", "two", "three" ] ## Here is the variable I'm looking for #set $myVar = "two" ## I want to do this #if ( $myVar in $myList ) { do something... } #else { do something else... } In my particular case, $myList is a java.util.Vector made up of composite objects - each object has a name, value, etc. To keep maintenance simple, I wanted to avoid doing a multiple-condition 'if' statement like this: #if ( ($myVar==$possibility1) || ($myVar==$possibility2) || ($myVar==$possibility3) etc. ) ) { do something... } #else... To give a fuller picture, my close-to-ideal pseudo-code looks like this: #set $myList = [ "one", "two", "three" ] #foreach $compositeObj in $someRuntimeList { #if ($compositeObj.name in $myList) { do something } #else { do something else... } } I've tried to turn around the 'if' condition using this syntax: #if ($myList.contains($compositeObj.name)) { but I get a 'NoSuchMethodException on a Ljava.lang.Object'. Thanks for any pointers. I'm willing to do some coding if we wanted to add this to the codebase - only, not sure if I could even understand enough of the engine (Expression.java maybe?) to know where to start hacking. __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ |
From: Marc P. <ma...@an...> - 2005-04-14 20:09:52
|
Lane Sharman wrote: > Marc, > > do you have some time to work on this? could you develop a plan that we > could use to implement some things which would allow WM to differentiate > itself some from Velocity going forward? I will look at the contrib'd code next week hopefully, after I've got a J2ME game porting contract out of the way. I'll have a think about any unique additions we could make for WM. Not sure there will be much though, apart from our *much nicer syntax*. It will be a good way for me to get into the Spring MVC stuff too. Cheers -- Marc Palmer wj...@wa... Wangjammers - Java, J2ME and Web Consultants ~ http://www.wangjammers.org/ |
From: Lane S. <la...@op...> - 2005-04-14 18:03:50
|
Marc, do you have some time to work on this? could you develop a plan that we could use to implement some things which would allow WM to differentiate itself some from Velocity going forward? -lane Marc Palmer wrote: > Lane Sharman wrote: > >> Hi Marc, >> >> this is an intriguing idea and does not seem like such a bad way to >> circumvent the politics of "we use JSP". >> >> Furthermore, it would allow you to refactor existing JSPs into a WM >> system over time. This would be really helpful. >> >> In short, JSPs are an utter left turn on the road to productive and >> extreme development. It boggles and bambles my mind where Sun has >> taken Java during the last 7 years. > > > LOL yes indeed. In my JSP tutorial journey I found that, horrendously: > > 1. I prefer JSP 1.2 to JSP 2 with its horribly verbose XML syntax > > 2. I thought JavaServer Faces was going to be a great useful > technology but all I can see is a -lot- of overcomplicated crap. I > particularly like the way the examples I've seen show *server-side* > field validation being specified inside the JSP pages - how is that MVC? > > On the flip side, the more I read about Spring the more I like it. I > think we should aim for a WebMacro view implementation for Spring, it > already has them for FreeMaker and Velocity. If we can get it done, I > may tackle it soon if work doesn't get in the way, we should contrib > it to Spring so it goes out with their distros. > > Cheers > > |
From: Lane S. <la...@op...> - 2005-04-14 06:19:47
|
Hi Alex, Message creation/management is by an administrator. Thus, they would be secure. But, yes, there is a small security issue. However, the context is well-defined and therefore limits the damage an error might create. I think this is a concern of yours. Right? But, in general, the user will be able to create a message as in: To: [$Message.To (not editable)] From: [User Input] CC: [User Input] Date: [$Message.Now] [ {user editable} $Message.Body (with embedded image refs) ] [optional image reference 1 input by user] ... [optional image reference n input by user] that is what the user interface is going to look like. $Message.Property will be a hashmap that can cotain application/message specific properties. that is the planned admin design. regards, Lane Alex Twisleton-Wykeham-Fiennes wrote: >On Wednesday 13 April 2005 16:13, Lane Sharman wrote: > > >>Alex Twisleton-Wykeham-Fiennes wrote: >> >> >>>On Wednesday 13 April 2005 06:40, Lane Sharman wrote: >>> >>> >>>>Hi, >>>> >>>>I have a requirement to manage about a dozen message templates where >>>>there will be variables, ($Message.To, $Message.StartDate, >>>>$Message.Image[]) will need to be managed in the source document as well. >>>> >>>> >>>are the templates constant or are they rewritten on the fly (other than >>>the $Message.Xxx variables that you mention?) >>> >>> >>the messages will need to be edited and updated over time as well as >>added and removed. >> >> > >and do you trust the editors to be able to be sensible or do you need to >deliver a very restricted subset of webmacro to them? (ie only basic >variable substitution) > >Alex > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >_______________________________________________ >Webmacro-user mailing list >Web...@li... >https://lists.sourceforge.net/lists/listinfo/webmacro-user > > > -- Lane Sharman Providing Private and SPAM-Free Email http://www.opendoors.com 858-755-2868 |
From: Alex Twisleton-Wykeham-F. <al...@fi...> - 2005-04-13 18:58:47
|
On Wednesday 13 April 2005 16:13, Lane Sharman wrote: > Alex Twisleton-Wykeham-Fiennes wrote: > >On Wednesday 13 April 2005 06:40, Lane Sharman wrote: > >>Hi, > >> > >>I have a requirement to manage about a dozen message templates where > >>there will be variables, ($Message.To, $Message.StartDate, > >>$Message.Image[]) will need to be managed in the source document as well. > > > >are the templates constant or are they rewritten on the fly (other than > > the $Message.Xxx variables that you mention?) > > the messages will need to be edited and updated over time as well as > added and removed. and do you trust the editors to be able to be sensible or do you need to deliver a very restricted subset of webmacro to them? (ie only basic variable substitution) Alex |
From: Sebastian K. <seb...@mu...> - 2005-04-13 18:37:44
|
Keats Kirsch wrote: > We actually had two implementations of a WM/Spring integration done > last September. I believe Sebastian's is available in our CVS. I've > included his message below. sorry for not responding earlier to this thread. Right, I used WM and Spring together for a project last year and it worked fine, for me. I've checked the code into wm's contrib directory somewhere, together with documentation on how to use it. I have to admit I switched to the (a bit over-hyped) ruby-on-rails framework for my current project, so I'm not using WebMacro actively right now. However, I can help with questions regarding my code, perhaps it's a starting point for a more complete Spring integration. Sebastian |
From: Keats K. <ke...@xa...> - 2005-04-13 18:00:20
|
We actually had two implementations of a WM/Spring integration done last September. I believe Sebastian's is available in our CVS. I've included his message below. Keats Marc Palmer wrote: > > Guys, > > Is anybody out there using Spring with WebMacro? Any likes/dislikes? > > It struck me that for a start we could do something really nice using > Spring's IoC for starters, i.e. a SpringContextAutoLoader that would > allow us to bootstrap beans (be they simple helpers, factories, or > dare I say EJBs) that go into the context. > > This should be a relatively simple task. I'll look into it a bit more. > I'm not saying make Spring a required dependency of WM, but having a > good optional IoC XML configuration mechanism would be a real boon to > WM usage I think. > > I'm seriously considering using it to replace my somewhat clumsy > plugin/action/helper configuration mechanism in Ignition. > > Cheers > > Hi Hai, Sebastian, Couple of observations from experience. If you have read the new book, "Effective (or is it) Better Java", you will note that the author stresses the importance of decoupling dependencies. Therefore, I do not like either of the solutions below because you are subclassing WMServlet and WMBroker. What if they have side effects? Change? Are inadequate? WMBroker has a lot of implementation internals which could break a subclass. From experience, both WMServlet and WMBroker have issues. Rather, I would like to see a POJO whose containment of a WebMacro context and, consequently, a broker, plus a number of convenience methods, make it the place to create the bridge object between Spring and WM. Let's call it WMSpring. (See o.w.u.WMEval for a class which could be remade easily into WMSpring). Thus, in WMSpring, you provide the bridges to both Spring and WebMacro which can be used in both a Servlet context and a non-servlet context. There are convenience initializers for both kinds of environments and for web context tools as needed. see: http://www.webmacro.org/api/org/webmacro/util/WMEval.html (the docs are a bit out of date). I do not want to be tied to subclassing WMServlet. Generally, creation of an adapter is accomplished thru composition by a POJO. kindest, Lane Hai-Chen Tu wrote: > Hi, > I exchanged several email with Sebastian on WebMacro-Spring > integration > issues and here is a summary of our discussion. It happened that > we have different approaches to implement the integration and I will > first describe the key parts of our approaches and then present > some issues I have. You are all welcome to give your views and > suggestions. > Hopefully at the end of discussion we will have a version of > integration > that everyone is happy to use. > > Sebastian's approach: > * a CommonsLog class that implements WebMacro's Log interface > using apache's common log API. > * a SpringBroker class that extends WebMacro's Broker. It uses > CommonsLog as the logger and Spring's ResourceLoader > as the resource loader. > * The WebMacro engine is created using SpringBroker. > * rendering output is done through > template.write(response.getOutputStream(), context); > > My approach: > * ServletBroker: under the Spring MVC framework, I couldn't > find any API > to access the DispatchServletcan to create a ServletBroker. > So I wrote a utility that creates a > Servlet20Broker/Servlet22Broker > using the ServletContext retrieved from the Spring > application context. > (There is probably a way to use Sebastian's CommonsLog as > the logger for this ServletBroker but I don't know how to > do it.) > * The WebMacro engine is based on WMServlet (which is probably > a mistake but please read on). Since there is > no servlet available during init time, I wrap WMServlet > in a thin subclass and override its initWebMacro() and use > new WM(broker created from the above mechanism) > to create a WM. > * rendering output is done through > WMServlet.execute(Template, WebContext) > * I also recycle WebContext instances > > The reasons I want to use WMServlet are because > 1. I can use error.wm: > 2. I can use #param to set TEMPLATE_OUTPUT_ENCODING and > TEMPLATE_LOCALE > 3. I can use ContextTools, e.g., $CGI. > > About error.wm, I am not quite sure if it is important to use it. > I did, however, use it in my applications. > > Sebastian thinks that there is no need to use WMServlet and > one can still access ContextTools without WMServlet. I think he is > correct but I think a ServletBroker is still needed to be able to > create > CGI_Impersonator, and probably some other ContextTools. If this > is the case, we may need to consolidate his SpringBroker and > ServletBroker. > > On encoding/local setting, if we don't use WMServlet, then we > probably > want to allow developers to specify template encoding/locale > through Spring's configuration file per WebMacroView bean (each > template > has a one-one correspondence with a view), which is the mechanism > Spring-Velocity integration uses. > Sebastian, > Could you describe the difference between Spring ResourcLoader > and default resource loading used by Servlet20Broker/Servlet22Broker? > Hai-Chen Tu > |
From: Marc P. <ma...@an...> - 2005-04-13 15:16:39
|
Lane Sharman wrote: > Hi Marc, > > this is an intriguing idea and does not seem like such a bad way to > circumvent the politics of "we use JSP". > > Furthermore, it would allow you to refactor existing JSPs into a WM > system over time. This would be really helpful. > > In short, JSPs are an utter left turn on the road to productive and > extreme development. It boggles and bambles my mind where Sun has taken > Java during the last 7 years. LOL yes indeed. In my JSP tutorial journey I found that, horrendously: 1. I prefer JSP 1.2 to JSP 2 with its horribly verbose XML syntax 2. I thought JavaServer Faces was going to be a great useful technology but all I can see is a -lot- of overcomplicated crap. I particularly like the way the examples I've seen show *server-side* field validation being specified inside the JSP pages - how is that MVC? On the flip side, the more I read about Spring the more I like it. I think we should aim for a WebMacro view implementation for Spring, it already has them for FreeMaker and Velocity. If we can get it done, I may tackle it soon if work doesn't get in the way, we should contrib it to Spring so it goes out with their distros. Cheers -- Marc Palmer wj...@wa... Wangjammers - Java, J2ME and Web Consultants ~ http://www.wangjammers.org/ |
From: Lane S. <la...@op...> - 2005-04-13 15:02:31
|
Hi Marc, this is an intriguing idea and does not seem like such a bad way to circumvent the politics of "we use JSP". Furthermore, it would allow you to refactor existing JSPs into a WM system over time. This would be really helpful. In short, JSPs are an utter left turn on the road to productive and extreme development. It boggles and bambles my mind where Sun has taken Java during the last 7 years. -Lane Marc Palmer wrote: > Hi all, > > Continuing my JSP/JSF/EJB journey a little more today... I thought > that probably we should have a WM tag library for JSP to help those > poor JSP people out. > > Has somebody already done this? It should be relatively simple. > > I notice Velocity has it already: > > http://jakarta.apache.org/velocity/veltag.html > > Basically we're talking a simple tag or two to render WM content > within a JSP page, or to render an external WM template - i.e. in JSP > land pages could be reduced to a variant of: > > <%@ taglib uri="/WEB-INF/webmacro.tld" prefix="wm" %> > > <wm:template name"/mytemplates/rendertemplate.wm" /> > > You'd need a couple of helpers like Velocity's, to provide access to > scoped variables (JSP's #bean-like scoping mechanism) and wrap up the > context. > > What does the community think? > > I'd love to be able to go somewhere and "use JSP" but really be using > WM :) > > Cheers > -- Lane Sharman Providing Private and SPAM-Free Email http://www.opendoors.com 858-755-2868 |
From: Lane S. <la...@op...> - 2005-04-13 14:57:54
|
Alex Twisleton-Wykeham-Fiennes wrote: >On Wednesday 13 April 2005 06:40, Lane Sharman wrote: > > >>Hi, >> >>I have a requirement to manage about a dozen message templates where >>there will be variables, ($Message.To, $Message.StartDate, >>$Message.Image[]) will need to be managed in the source document as well. >> >> > >are the templates constant or are they rewritten on the fly (other than the >$Message.Xxx variables that you mention?) > > the messages will need to be edited and updated over time as well as added and removed. -Lane > > >>Has anyone on the WM list build a backend to manage email templates? >>Please come forward!!! >> >>thanks, >> >> > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >_______________________________________________ >Webmacro-user mailing list >Web...@li... >https://lists.sourceforge.net/lists/listinfo/webmacro-user > > > -- Lane Sharman Providing Private and SPAM-Free Email http://www.opendoors.com 858-755-2868 |
From: Alex Twisleton-Wykeham-F. <al...@fi...> - 2005-04-13 12:51:18
|
On Wednesday 13 April 2005 06:40, Lane Sharman wrote: > Hi, > > I have a requirement to manage about a dozen message templates where > there will be variables, ($Message.To, $Message.StartDate, > $Message.Image[]) will need to be managed in the source document as well. are the templates constant or are they rewritten on the fly (other than the $Message.Xxx variables that you mention?) > Has anyone on the WM list build a backend to manage email templates? > Please come forward!!! > > thanks, |
From: Lane S. <la...@op...> - 2005-04-13 05:24:56
|
Hi, I have a requirement to manage about a dozen message templates where there will be variables, ($Message.To, $Message.StartDate, $Message.Image[]) will need to be managed in the source document as well. Has anyone on the WM list build a backend to manage email templates? Please come forward!!! thanks, -- Lane Sharman Providing Private and SPAM-Free Email http://www.opendoors.com 858-755-2868 |
From: Alex Twisleton-Wykeham-F. <al...@fi...> - 2005-04-12 15:08:57
|
On Tuesday 12 April 2005 15:35, Keats Kirsch wrote: > Endre St=F8lsvik wrote: > >On Fri, 1 Apr 2005, Keats Kirsch wrote: > >| I posted the new #eval directive last night, along with a couple of un= it > >| tests for the new functionality. I'll try to update the Wiki page soo= n. > >| > >| In a nutshell, you can now use Strings containing WMScript, instead of > >| Templets or other Macros, with #eval. E.g., > >| > >| [#eval "\$a \$b" using { "a":"Foo", "b":"Bar" }] > >| > >| would expand to: > >| > >| [Foo Bar] > >| > >| If you leave off the "using" clause, the current context will be used, > >| e.g., > >| > >| #set $a=3D"Foo" > >| #set $b=3D"Bar" > >| [#eval "\$a \$b"] > >| > >| would give the same result as above. > > > >What if I'd like a mix? I want the current context (copied), but I want = to > >"override" this and this and this variable? I see this as an immediate > >useful feature. > > You have two choices: use the $OutVars with a new context, or set and > restore the variables in the current context. (I want to keep things as > simple as possible.) could you not just clone the $OuterVars container? something like:- #set $a =3D "foo" #set $b =3D "bar" #eval "\#set \$myOuterVars =3D \$OuterVars.clone() \ $myOuterVars.b =3D "not bar" \ #eval "\$a \$b" using $myOuterVars"" Of course that is all a bit obtuse due to the dual nested val and all the=20 escaping of params and the like... As a templet it looks a little bit more= =20 sensible... #templet $inner { $a $b } #templet $outer { #set $myOuterVars =3D $OuterVars.clone() #set $myOuterVars.b =3D "not bar" #eval $inner using $myOuterVars } #set $a =3D "foo" #set $b =3D "bar" #eval $outer However, it doesn't actually work for the following reasons:- =2D "#eval $outer" doesn't have a local Context for $outer so I can't get h= old=20 of the Context to clone it. =20 Is there an object in the Context that corresponds to the Context itself? Or should there always be an $OuterVars available to the templet on the=20 grounds that the templet doesn't know whether or not it will have been pass= ed=20 a local context? Alternatively doing this: #eval $outer using { "anything":"anything" } work= s=20 although is ugly. =2D #eval $inner using $myOuterVars is rejected despite the fact that=20 $myOuterVars is actually a HashMap after being cloned from the OuterVars=20 object. I would have expected this to function, but get a ClassCastExcepti= on=20 so it doesn't appear to be possible at the moment. If these two issues where easily resolvable and we where to pass in the Str= ing=20 that contained the code of the inner template to be evaluated then we would= =20 be able to state this:- #templet $outer { #set $myOuterVars =3D $OuterVars.clone() #set $myOuterVars.b =3D "not bar" #eval $templateCode using $myOuterVars } #set $a =3D "foo" #set $b =3D "bar" #set $templateCode =3D "\$a \$b" #eval $outer which would give us the ability to insert "Context Filters" in between the= =20 current framework and an arbitrary target template where the wrangling was= =20 only visible within the context of the target template. Alex |
From: Keats K. <ke...@xa...> - 2005-04-12 14:35:30
|
Endre Stølsvik wrote: >On Fri, 1 Apr 2005, Keats Kirsch wrote: > >| I posted the new #eval directive last night, along with a couple of unit >| tests for the new functionality. I'll try to update the Wiki page soon. >| >| In a nutshell, you can now use Strings containing WMScript, instead of >| Templets or other Macros, with #eval. E.g., >| >| [#eval "\$a \$b" using { "a":"Foo", "b":"Bar" }] >| >| would expand to: >| >| [Foo Bar] >| >| If you leave off the "using" clause, the current context will be used, e.g., >| >| #set $a="Foo" >| #set $b="Bar" >| [#eval "\$a \$b"] >| >| would give the same result as above. > >What if I'd like a mix? I want the current context (copied), but I want to >"override" this and this and this variable? I see this as an immediate >useful feature. > > You have two choices: use the $OutVars with a new context, or set and restore the variables in the current context. (I want to keep things as simple as possible.) Cheers. Keats >Regards, >Endre, > >(PS: Dear developers: remember that there is also a possibility of a 2.1, >2.2 etc.. 2.0 won't -ever- come out, will it?!) > > > > > > |
From: Keats K. <ke...@xa...> - 2005-04-12 14:33:32
|
I did this a couple years ago, but I seem to have lost track of the code (probably lost in a disk crash last year). If anybody has a copy of it I'd appreciate it, otherwise, I don't think it took very long to create. Keats Marc Palmer wrote: > Hi all, > > Continuing my JSP/JSF/EJB journey a little more today... I thought > that probably we should have a WM tag library for JSP to help those > poor JSP people out. > > Has somebody already done this? It should be relatively simple. > > I notice Velocity has it already: > > http://jakarta.apache.org/velocity/veltag.html > > Basically we're talking a simple tag or two to render WM content > within a JSP page, or to render an external WM template - i.e. in JSP > land pages could be reduced to a variant of: > > <%@ taglib uri="/WEB-INF/webmacro.tld" prefix="wm" %> > > <wm:template name"/mytemplates/rendertemplate.wm" /> > > You'd need a couple of helpers like Velocity's, to provide access to > scoped variables (JSP's #bean-like scoping mechanism) and wrap up the > context. > > What does the community think? > > I'd love to be able to go somewhere and "use JSP" but really be using > WM :) > > Cheers > |
From: Mark C. <mcr...@ma...> - 2005-04-12 13:57:37
|
On 2005-04-12 04:42, Marc Palmer wrote: > I'd love to be able to go somewhere and "use JSP" but really be using WM :) That's an intriguing idea. I remember having a lot of trouble with a recent contract because the client had never heard of WebMacro and thought everything should be done with JSP. The customer is King, so they get what they want even if it's not the best solution. Normally I wouldn't even mention it a second time, but in this particular case, WebMacro really had some advantages that would reduce design time (sorry can't elaborate), and thus, cost. Even then, it was a very tough sell. If I didn't have to "sell" it, I'd probably use WebMacro more often. Sometimes I wish I could avoid telling the customer that it's a part of the solution at all because it tends the freak them out when they've never heard of it, but that wouldn't be ethical and contracts usually require disclosure of such things. |
From: Marc P. <ma...@an...> - 2005-04-12 13:29:22
|
Guys, Is anybody out there using Spring with WebMacro? Any likes/dislikes? It struck me that for a start we could do something really nice using Spring's IoC for starters, i.e. a SpringContextAutoLoader that would allow us to bootstrap beans (be they simple helpers, factories, or dare I say EJBs) that go into the context. This should be a relatively simple task. I'll look into it a bit more. I'm not saying make Spring a required dependency of WM, but having a good optional IoC XML configuration mechanism would be a real boon to WM usage I think. I'm seriously considering using it to replace my somewhat clumsy plugin/action/helper configuration mechanism in Ignition. Cheers -- Marc Palmer wj...@wa... Wangjammers - Java, J2ME and Web Consultants ~ http://www.wangjammers.org/ |
From: Marc P. <ma...@an...> - 2005-04-12 08:44:01
|
Hi all, Continuing my JSP/JSF/EJB journey a little more today... I thought that probably we should have a WM tag library for JSP to help those poor JSP people out. Has somebody already done this? It should be relatively simple. I notice Velocity has it already: http://jakarta.apache.org/velocity/veltag.html Basically we're talking a simple tag or two to render WM content within a JSP page, or to render an external WM template - i.e. in JSP land pages could be reduced to a variant of: <%@ taglib uri="/WEB-INF/webmacro.tld" prefix="wm" %> <wm:template name"/mytemplates/rendertemplate.wm" /> You'd need a couple of helpers like Velocity's, to provide access to scoped variables (JSP's #bean-like scoping mechanism) and wrap up the context. What does the community think? I'd love to be able to go somewhere and "use JSP" but really be using WM :) Cheers -- Marc Palmer wj...@wa... Wangjammers - Java, J2ME and Web Consultants ~ http://www.wangjammers.org/ |
From: <Web...@St...> - 2005-04-12 08:03:41
|
On Fri, 1 Apr 2005, Keats Kirsch wrote: | I posted the new #eval directive last night, along with a couple of unit | tests for the new functionality. I'll try to update the Wiki page soon. | | In a nutshell, you can now use Strings containing WMScript, instead of | Templets or other Macros, with #eval. E.g., | | [#eval "\$a \$b" using { "a":"Foo", "b":"Bar" }] | | would expand to: | | [Foo Bar] | | If you leave off the "using" clause, the current context will be used, e.g., | | #set $a="Foo" | #set $b="Bar" | [#eval "\$a \$b"] | | would give the same result as above. What if I'd like a mix? I want the current context (copied), but I want to "override" this and this and this variable? I see this as an immediate useful feature. Regards, Endre, (PS: Dear developers: remember that there is also a possibility of a 2.1, 2.2 etc.. 2.0 won't -ever- come out, will it?!) |
From: Nick S. <NSa...@ms...> - 2005-04-06 13:39:44
|
Hi We use webmacro in all our full j2ee applications, sevlets, session beans (even entity beans on old systems!), JMS etc. for large corporate customers. The patterns are different as we tend not to redirect very often, showing a page is less of a passing a bundle of variables to a renderer and far more naturally fill context -> show page. The EJB layer knows nothing about webmacro - except for odd templating uses divorced from display (emails for example) and webmacro knows nothing about EJB. Which is as it should be , I think. With our sets of macros replacing JSTL we never really have any need for JSP and as we still have legacy asp sites to support occasionally I can only say that it is a bit of a relief. Regards Nick >>> ma...@an... 04/06/05 12:26pm >>> Hello all, Due to market pressures, I'm currently training myself up on J2EE technologies. There's not much work here in the UK for Java web applications without commercial EJB and JSP experience, which is really sad :( Anyway, I was wondering if anybody has done any work to use WebMacro within serious J2EE applications, to use WM as the Web Tier instead of the dreaded JSP? I'd be interested to hear what people have found. There might be some work we can do on WM to smooth things out. It pains me when I see all these contracts for EJB/JSP/Hibernate/Spring but it pains me even more when I see the odd one for EJB/Velocity! Cheers -- Marc Palmer wj...@wa... Wangjammers - Java, J2ME and Web Consultants ~ http://www.wangjammers.org/ ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Webmacro-user mailing list Web...@li... https://lists.sourceforge.net/lists/listinfo/webmacro-user This Message has been Checked at MSXI for all known Viruses. You open this at your own risk. Please make sure all replies are also virus free. Also we do not accept or send Attachments of the type .exe, .vbs, scr, or .bat due to the increased virus risk they can contain. These types of attachments will be stripped from the message. MSXI |
From: Marc P. <ma...@an...> - 2005-04-06 11:27:39
|
Hello all, Due to market pressures, I'm currently training myself up on J2EE technologies. There's not much work here in the UK for Java web applications without commercial EJB and JSP experience, which is really sad :( Anyway, I was wondering if anybody has done any work to use WebMacro within serious J2EE applications, to use WM as the Web Tier instead of the dreaded JSP? I'd be interested to hear what people have found. There might be some work we can do on WM to smooth things out. It pains me when I see all these contracts for EJB/JSP/Hibernate/Spring but it pains me even more when I see the odd one for EJB/Velocity! Cheers -- Marc Palmer wj...@wa... Wangjammers - Java, J2ME and Web Consultants ~ http://www.wangjammers.org/ |
From: Keats K. <ke...@xa...> - 2005-04-01 15:44:02
|
I posted the new #eval directive last night, along with a couple of unit tests for the new functionality. I'll try to update the Wiki page soon. In a nutshell, you can now use Strings containing WMScript, instead of Templets or other Macros, with #eval. E.g., [#eval "\$a \$b" using { "a":"Foo", "b":"Bar" }] would expand to: [Foo Bar] If you leave off the "using" clause, the current context will be used, e.g., #set $a="Foo" #set $b="Bar" [#eval "\$a \$b"] would give the same result as above. I also added a simple StringMacro class (in org.webmacro.engine) that creates a Macro from a WMScript string. It is used internally by the EvalDirective and may be useful to others. Keats |
From: Keats K. <ke...@xa...> - 2005-03-30 23:38:10
|
Hey Mike, Yes I'm back from SD West. No, I wasn't promoting WebMacro. (I did get to hang out with Brian for a bit though.) I'm working on the #eval stuff, but I'm having a little trouble getting my dev environment set up again. (It has been a while.) I hope to get it finished by next week. btw, Looking at the code, it appears that the "inline" functionality is the default if you don't specify a "using" clause. I think this is the way it should work. Also, I'm toying with the idea of making it two different directives, #eval and #seval, one for Macro objects (e.g. Templets) and the other for String templates. This might make things a bit more straightforward. Any thoughts? I think I like most of the ideas you are suggesting. (Some of them look familiar.) I'll try to digest them a bit over the weekend. I'm not sure about the #while directive, but we can always include it as an option. (I've actually been thinking about a #case/#when directive.) [btw, For some reason your post only came through in the digest -- maybe because of the attachments?] Keats > > 1. WebMacro 2.0 release? / Items that are modified or added by Mike W / Marcel H (Mike Weerdenburg) > ----- Message from "Mike Weerdenburg" <M.W...@tr...> > on Wed, 30 Mar 2005 16:36:52 +0200 ----- > > [WebMacro-user] WebMacro 2.0 release? / Items that are modified or > added by Mike W / Marcel H > > Hello everybody, > > it would be great to have "soon" a 2.0 release. > > I'd like to see the following items to be included in this new version: > > 1) adjusted DefaultDirective (see attachment). > > Made #default pre wm2 compatible. > #default $myVar to "value" has been deprecated, but NOW it still works! > > It generates a warning if LogLevel.directive: NOTICE > This is a neat trick to log all the occurences and replace them! > Log-example: ../my.wmt:34.2 uses #default $border to "default", please use: > #default $border = "default" > > > 2) adjusted LogFile (see attachment) > > ChangeLog: > > 14-01-2005 (Mike Weerdenburg) > LogFilePerDay > It was : > exampl. c:/logs/wm.log -> c:/logs/wm.log_20050105 > exampl. c:/logs/wmlog -> c:/logs/wm_log_20050105 > > Now it is : > exampl. c:/logs/wm.log -> c:/logs/wm_20050105.log > exampl. c:/logs/wmlog -> c:/logs/wm_log_20050105 > > Write a message to the 'old' logfile when switching to a 'new' one. > > 17-07-2002 (Marcel Huijkman) > setting for WebMacro.properties added > LogFilePerDay > usage: > LogFilePerDay=FALSE or TRUE > > LogFileAutoFlush > usage: > LogFileAutoFlush=FALSE or TRUE > (Notice: Only handy when developing on a Operating system, that buffers > file-writing, not recommended for production, since it obviously slows down > the machine.) > > > 3) new WhileDirective (see attachment) > > Just have fun with it... > > Syntax: #while (condition) [limit (int)] { block } WhileDirective implements > a WebMacro directive for an while control structure. If you use it without > the limit option than it stops after 1000000 loops! Use a limit value < 0 to > create a loop without a limit, this could hang your template! > > > 4) new SilentEvaluationExceptionHandler (see attachment) > > An implementation of EvaluationExceptionHandler which throws some > exception's when it is called. > The error is stored back into the webcontext $WMERROR (as ArrayList) and > could be handled by the templatewriter. > > You can use this in case of a live-situation to mail the error or show the > error in a fashioned way. > > Example: > #if ( $Variable.isDefined("WMERROR") ) > { > <B>Error(s):</B><BR> > #foreach $item in $WMERROR > { > $item<BR> > } > } > > * This one looks like the 'DebugEvaluationExceptionHandler' but doesn't > throw all the Exeptions. > > > 5) adjusted EvalDirective (no attachment, sorry I have no clue how to adjust > this) > > #eval <Macro or String> [using { ... }] > > To 'parse' a Macro or String value... > > Keats? Already back from Calif? To do some SD for the WM community? ;-) > > > Please add this modifications / add-ons to WebMacro 2.0 ! > > Greetings > Mike Weerdenburg > > > PS. Maybe we should make a wish list for this 'new' WebMacro 2.0 release? > And set a date! when it should be up and running? |
From: Keats K. <ke...@xa...> - 2005-03-30 23:05:08
|
Hey Tim, AFAIK the Wiki doc represents the current whitespace handling. Can you give any specific examples of where it is wrong? Keats Tim Pizey wrote: >Hi gang, > >It is great that there is a bit more activity on the list. > >I have been using WM for java code generation, and >it has continued to work very nicely. > >However I am having pain with whitespace handling. > >Up until 0.98p1 whitespace gobbling was perfect, then just a few >versions before 1.0 there was an urgent, and I am sure genuine, >need to break it, (if I remember correctly so that CSV files could be >generated cleanly). > >The documentation at http://www.webmacro.org/WhiteSpace still refers >to the oldskool rules. > >Those rules worked perfectly for clean and elegant HTML and similar >code generation, which is the central use case for WM. > >Can the default be returned to the 0.98p1 rules and the current >incomprehensible rules become pluggable please? > >yours >TimP > > > |