You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(97) |
Dec
(35) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(12) |
Feb
(55) |
Mar
(21) |
Apr
(3) |
May
(7) |
Jun
(25) |
Jul
(108) |
Aug
(23) |
Sep
|
Oct
|
Nov
|
Dec
(4) |
2006 |
Jan
|
Feb
|
Mar
(6) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
(13) |
Feb
|
Mar
(257) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(38) |
Dec
|
2009 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(63) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2011 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <wan...@us...> - 2003-07-29 21:53:49
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive In directory sc8-pr-cvs1:/tmp/cvs-serv21898/src/org/webmacro/directive Modified Files: CountDirective.java Log Message: Made #count work out whether an implicit step -1 can be used. Index: CountDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/directive/CountDirective.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CountDirective.java 12 Jun 2003 00:47:44 -0000 1.5 --- CountDirective.java 29 Jul 2003 17:33:46 -0000 1.6 *************** *** 76,80 **** private Object _objStep; ! private int _start, _end, _step = 1; public Object build (DirectiveBuilder builder, BuildContext bc) throws BuildException --- 76,80 ---- private Object _objStep; ! private int _start, _end, _step = Integer.MAX_VALUE; public Object build (DirectiveBuilder builder, BuildContext bc) throws BuildException *************** *** 181,184 **** --- 181,190 ---- return; } + } + + // Check if no step explicitly assigned, if so auto-detect it + if (step == Integer.MAX_VALUE ) + { + step = (start > end) ? -1 : +1; } |
From: <wan...@us...> - 2003-07-29 21:48:52
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1:/tmp/cvs-serv21898/test/unit/org/webmacro/template Modified Files: TestCountDirective.java Log Message: Made #count work out whether an implicit step -1 can be used. Index: TestCountDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestCountDirective.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestCountDirective.java 12 Jun 2003 00:47:49 -0000 1.4 --- TestCountDirective.java 29 Jul 2003 17:33:45 -0000 1.5 *************** *** 59,62 **** --- 59,72 ---- + public void testCountBackwardsImplicitStep () throws Exception + { + executeStringTemplate("#count $i from 10 to 1 { $Counter.next() }"); + Integer i = (Integer) _context.get("i"); + Counter c = (Counter) _context.get("Counter"); + assertTrue(c.toString(), c.getCount() == 10); + assertTrue(i.toString(), i.intValue() == 1); + } + + public void testCountBackwards () throws Exception { |
From: <wan...@us...> - 2003-07-28 20:56:26
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv29429/org/webmacro/servlet Modified Files: VariableTool.java Log Message: New get() function so you can get a context var using a dynamic name. Index: VariableTool.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/VariableTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** VariableTool.java 16 Jul 2003 06:45:00 -0000 1.10 --- VariableTool.java 28 Jul 2003 20:56:23 -0000 1.11 *************** *** 64,67 **** --- 64,76 ---- /** + * Get the specified object <code>name</code> defined from the active + * Context. + */ + public Object get (Object name) + { + return context.get(name); + } + + /** * Is the specified object, <code>obj</code>, an instance of the * specified <code>className</code>?<p> |
From: <ke...@us...> - 2003-07-24 22:16:25
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive In directory sc8-pr-cvs1:/tmp/cvs-serv8727 Modified Files: EvalDirective.java Log Message: Fix to undeclared exception -- needed to cast to PropertyException Index: EvalDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/directive/EvalDirective.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EvalDirective.java 23 Jul 2003 19:20:31 -0000 1.1 --- EvalDirective.java 24 Jul 2003 21:48:25 -0000 1.2 *************** *** 167,171 **** catch (Exception e) { ! if (e instanceof PropertyException) throw e; throw new PropertyException("#eval: Unable to evaluate macro.", e); } --- 167,171 ---- catch (Exception e) { ! if (e instanceof PropertyException) throw (PropertyException)e; throw new PropertyException("#eval: Unable to evaluate macro.", e); } |
From: <ke...@us...> - 2003-07-24 21:42:30
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive In directory sc8-pr-cvs1:/tmp/cvs-serv7745 Removed Files: PropertyDirective.java Log Message: Cleaning out the garbage. Nothing uses this. --- PropertyDirective.java DELETED --- |
From: <ke...@us...> - 2003-07-23 19:22:04
|
Update of /cvsroot/webmacro/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv8213 Modified Files: WebMacro.defaults Log Message: Added #eval and #templet directives Index: WebMacro.defaults =================================================================== RCS file: /cvsroot/webmacro/webmacro/WebMacro.defaults,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** WebMacro.defaults 17 Jul 2003 05:25:06 -0000 1.39 --- WebMacro.defaults 23 Jul 2003 19:22:00 -0000 1.40 *************** *** 185,196 **** Directives.default: org.webmacro.directive.DefaultDirective Directives.count: org.webmacro.directive.CountDirective ! Directives.bean: org.webmacro.directive.BeanDirective ! ! ! # these are currently broken ! # Directives.encode: org.webmacro.directive.EncodeDirective ! # Directives.escape: org.webmacro.directive.EscapeDirective ! # Directives.silence: org.webmacro.directive.SilenceDirective ! # --- 185,191 ---- Directives.default: org.webmacro.directive.DefaultDirective Directives.count: org.webmacro.directive.CountDirective ! Directives.bean: org.webmacro.directive.BeanDirective ! Directives.templet: org.webmacro.directive.TempletDirective ! Directives.eval: org.webmacro.directive.EvalDirective # |
From: <ke...@us...> - 2003-07-23 19:20:34
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive In directory sc8-pr-cvs1:/tmp/cvs-serv7991 Added Files: EvalDirective.java TempletDirective.java Log Message: initial commit of #eval and #templet directives --- NEW FILE: EvalDirective.java --- /* * EvalDirective.java * * Created on May 12, 2003, 2:25 PM * * Copyright (C) 1998-2003 Semiotek Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of either of the following * Open Source licenses: * * The GNU General Public License, version 2, or any later version, as * published by the Free Software Foundation * (http://www.fsf.org/copyleft/gpl.html); * * or * * The Semiotek Public License (http://webmacro.org/LICENSE.) * * This software is provided "as is", with NO WARRANTY, not even the * implied warranties of fitness to purpose, or merchantability. You * assume all risks and liabilities associated with its use. * * See www.webmacro.org for more information on the WebMacro project. */ package org.webmacro.directive; import org.webmacro.*; import org.webmacro.engine.BuildContext; import org.webmacro.engine.BuildException; import org.webmacro.engine.Variable; import org.webmacro.directive.*; /** * * @author kkirsch * Usage: * #eval $macroVar * or * #eval $macroVar using $mapVar * */ public class EvalDirective extends org.webmacro.directive.Directive { private static final int EVAL_VAR = 1; private static final int EVAL_USING = 2; private static final int EVAL_MAP_EXPR = 3; private static final int MAX_RECURSION_DEPTH = 100; //private Macro _evalMacro; private Variable _evalTarget; private Object _mapExpr = null; private static final ArgDescriptor[] myArgs = new ArgDescriptor[] { new LValueArg(EVAL_VAR), new OptionalGroup(2), new KeywordArg(EVAL_USING, "using"), new RValueArg(EVAL_MAP_EXPR) }; private static final DirectiveDescriptor myDescr = new DirectiveDescriptor("eval", null, myArgs, null); public static DirectiveDescriptor getDescriptor() { return myDescr; } /** Creates a new instance of EvalDirective */ public EvalDirective() { } public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { try { _evalTarget = (Variable)builder.getArg(EVAL_VAR, bc); //_evalMacro = (Macro)o; } catch (ClassCastException e) { throw new NotVariableBuildException(myDescr.name, e); } if (builder.getArg(EVAL_USING) != null) { // "using" keyword specified, get map expression _mapExpr = builder.getArg(EVAL_MAP_EXPR, bc); } //_result = (org.webmacro.engine.Block)builder.getArg(TEMPLET_RESULT, bc); return this; } public void write(org.webmacro.FastWriter out, org.webmacro.Context context) throws org.webmacro.PropertyException, java.io.IOException { try { String s = null; Context c = null; Macro macro = (Macro)_evalTarget.getValue(context); if (_mapExpr == null) { // no map specified, use current context s = (String)macro.evaluate(context); } else { Object o = _mapExpr; if (o instanceof Macro) { o = ((Macro)o).evaluate(context); } if (!(o instanceof java.util.Map)) { throw new PropertyException("The supplied expression did not evaluate to a java.util.Map instance."); } // check for max recursion int recursionDepth = 0; if (context.containsKey("EvalDepth")) { // check the value try { recursionDepth = ((Integer)context.get("EvalDepth")).intValue(); recursionDepth++; if (recursionDepth > MAX_RECURSION_DEPTH) { throw new PropertyException( "ERROR: A recursive call to #eval exceeded the maximum depth of " + MAX_RECURSION_DEPTH); } } catch (Exception e){ // something bad happend, leave depth at default } } java.util.Map outerVars = null; if (context.containsKey("OuterVars")) { // check the value try { outerVars = (java.util.Map)context.get("OuterVars"); } catch (Exception e){ // something bad happend, use vars from calling context } } if (outerVars == null) outerVars = context.getMap(); c = new Context(context.getBroker()); // replace _variables map with supplied map c.setMap((java.util.Map)o); // put current depth into the new context c.put("EvalDepth", recursionDepth); // add a reference to parent context variables c.put("OuterVars", outerVars); // add a reference to this macro c.put("Self", macro); s = (String)macro.evaluate(c); } out.write(s); } catch (Exception e) { if (e instanceof PropertyException) throw e; throw new PropertyException("#eval: Unable to evaluate macro.", e); } } public void accept(TemplateVisitor v) { v.beginDirective(myDescr.name); v.visitDirectiveArg("EvalTarget", _evalTarget); if (_mapExpr != null){ v.visitDirectiveArg("EvalKeyword", "using"); v.visitDirectiveArg("EvalMap", _mapExpr); } v.endDirective(); } } --- NEW FILE: TempletDirective.java --- /* * TempletDirective.java * * Created on May 12, 2003, 2:25 PM * * Copyright (C) 1998-2003 Semiotek Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of either of the following * Open Source licenses: * * The GNU General Public License, version 2, or any later version, as * published by the Free Software Foundation * (http://www.fsf.org/copyleft/gpl.html); * * or * * The Semiotek Public License (http://webmacro.org/LICENSE.) * * This software is provided "as is", with NO WARRANTY, not even the * implied warranties of fitness to purpose, or merchantability. You * assume all risks and liabilities associated with its use. * * See www.webmacro.org for more information on the WebMacro project. */ package org.webmacro.directive; import org.webmacro.*; import org.webmacro.engine.BuildContext; import org.webmacro.engine.BuildException; import org.webmacro.engine.Variable; import org.webmacro.directive.*; /** This directive allows a block within a template to be reused * as a "templet" that can be invoked using the #eval directive. * @author Keats Kirsch * @since June 2003 * @see org.webmacro.directive.EvalDirective */ public class TempletDirective extends org.webmacro.directive.Directive { private static final int TEMPLET_TARGET = 1; private static final int TEMPLET_RESULT = 2; private Variable _target; private org.webmacro.engine.Block _result; static private org.webmacro.servlet.TemplateTool _templateTool; private static final ArgDescriptor[] myArgs = new ArgDescriptor[] { new LValueArg(TEMPLET_TARGET), new BlockArg(TEMPLET_RESULT) }; private static final DirectiveDescriptor myDescr = new DirectiveDescriptor("templet", null, myArgs, null); /** Returns the descriptor for this directive * @return the directive descriptor */ public static DirectiveDescriptor getDescriptor() { return myDescr; } /** Creates a new instance of TempletDirective */ public TempletDirective() { } /** Build the directive. Parses the block and saves it. * @param builder The Builder * @param bc The BuildContext * @throws BuildException when directive cannot build its arguments, * e.g., when the first argument is not a valid lval. * @return the built directive */ public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { try { _target = (Variable) builder.getArg(TEMPLET_TARGET, bc); } catch (ClassCastException e) { throw new NotVariableBuildException(myDescr.name, e); } _result = (org.webmacro.engine.Block)builder.getArg(TEMPLET_RESULT, bc); // store the variable name in the block for debugging _result.setTemplateName(_target.getVariableName()); return this; } /** Do nothing. This directive is completely evaluated * at build time. * @param out the FastWriter * @param context the Context * @throws PropertyException N/A * @throws IOException N/A */ public void write(org.webmacro.FastWriter out, org.webmacro.Context context) throws org.webmacro.PropertyException, java.io.IOException { try { _target.setValue(context, _result); } catch (PropertyException e) { throw e; } catch (Exception e) { String errorText = "#templet: Unable to set " + _target; if (!(e instanceof PropertyException)) { throw new PropertyException(errorText, e); } else throw (PropertyException)e; //writeWarning(errorText, context, out); } } /** Used by template visitors * @param v a template vistor */ public void accept(TemplateVisitor v) { v.beginDirective(myDescr.name); v.visitDirectiveArg("TempletTarget", _target); v.visitDirectiveArg("TempletValue", _result); v.endDirective(); } } |
From: <ke...@us...> - 2003-07-23 19:19:16
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1:/tmp/cvs-serv7751 Added Files: TestEvalTemplet.java Log Message: Unit tests for #templet and #eval directives --- NEW FILE: TestEvalTemplet.java --- package org.webmacro.template; import org.webmacro.Context; public class TestEvalTemplet extends TemplateTestCase { public TestEvalTemplet(String name) { super(name); } public void stuffContext (Context context) throws Exception { context.setEvaluationExceptionHandler( new org.webmacro.engine.CrankyEvaluationExceptionHandler()); StringMacro m = new StringMacro("$A $B $C"); context.put("m", m); StringMacro recursive = new StringMacro( "Title: $Node.Title\n\n" + "#foreach $Child in $Node.Children {Level $EvalDepth\n\n#eval $Self using {'Node':$Child}}"); context.put("recursive", recursive); Node root = new Node("Root Node"); Node n = new Node("Child 1"); root.addChild(n); n.addChild(new Node("Grandchild 1-1")); n.addChild(new Node("Grandchild 1-2")); n = new Node("Child 2"); root.addChild(n); n.addChild(new Node("Grandchild 2-1")); n.addChild(new Node("Grandchild 2-2")); n.addChild(new Node("Grandchild 2-3")); context.put("Tree", root); } public void testTemplet () throws Exception { assertStringTemplateEquals("#set $x=99\n#templet $t {$x$x}\n$t", "9999"); } public void testEvalWithMacro () throws Exception { assertStringTemplateEquals("#eval $m using { 'A':1,'B':2,'C':3 }", "1 2 3"); } public void testTempletEval () throws Exception { String prefix = "Mr."; String user = "Jones"; assertStringTemplateEquals( "#templet $t {Dear $prefix $user}\n" + "#eval $t using {'prefix':'" + prefix + "', 'user':'" + user + "'}", "Dear " + prefix + " " + user); } public void testEvalRecursive() throws Exception { assertStringTemplateEquals("#eval $recursive using {'Node':$Tree}", "Title: Root Node\n" + "Level 0\n" + "Title: Child 1\n" + "Level 1\n" + "Title: Grandchild 1-1\n" + "Level 1\n" + "Title: Grandchild 1-2\n" + "Level 0\n" + "Title: Child 2\n" + "Level 1\n" + "Title: Grandchild 2-1\n" + "Level 1\n" + "Title: Grandchild 2-2\n" + "Level 1\n" + "Title: Grandchild 2-3\n"); } /** Convenience class to evaluate a string template as a Macro */ public class StringMacro implements org.webmacro.Macro { private String s = ""; public StringMacro(String text) { s = text; } public Object evaluate(Context context) throws org.webmacro.PropertyException { org.webmacro.engine.StringTemplate t = new org.webmacro.engine.StringTemplate(context.getBroker(), s); return t.evaluateAsString(context); } public void write(org.webmacro.FastWriter fw, Context context) { } } public class Node { private String title; private java.util.ArrayList children = new java.util.ArrayList(); public Node(String title){ this.title = title; } public String getTitle(){ return title; } public void addChild(Node child){ children.add(child); } public java.util.List getChildren(){ return children; } } } |
From: <lan...@us...> - 2003-07-23 17:33:24
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1:/tmp/cvs-serv6404/test/unit/org/webmacro/template Modified Files: TestParseInclude.java Log Message: correct test case Index: TestParseInclude.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestParseInclude.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TestParseInclude.java 21 Jul 2003 05:49:47 -0000 1.13 --- TestParseInclude.java 23 Jul 2003 17:33:21 -0000 1.14 *************** *** 98,104 **** + "$a", "\\$a was found"); - assertStringTemplateMatches("#include as macro \"root.wmm\"\n" - + "$a", "\\$a was found"); - } --- 98,101 ---- |
From: <wan...@us...> - 2003-07-23 09:59:39
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/engine In directory sc8-pr-cvs1:/tmp/cvs-serv30356 Modified Files: PropertyOperatorCache.java Log Message: Removed redundant test code I left in. Index: PropertyOperatorCache.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/PropertyOperatorCache.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PropertyOperatorCache.java 16 Jul 2003 14:25:31 -0000 1.19 --- PropertyOperatorCache.java 23 Jul 2003 09:59:36 -0000 1.20 *************** *** 247,310 **** } - public static class Wrapper - { - - private Map params = new Hashtable(); - - public String getParameters( String key ) - { - return (String) params.get( key ); - } - - public void setParameters( String key, Object value ) - { - params.put( key, value ); - } - } - - public static class Wrapper2 - { - - private Map params = new Hashtable(); - - public Wrapper2() - { - this.params.put( "Parameters", new Hashtable() ); - } - - public Object get( Object key ) - { - return params.get( key ); - } - - public void put( Object key, Object value ) - { - params.put( key, value ); - } - } - - public static void main( String[] args ) - { - final String templateText = - "#set $test.Parameters.Name = 'marc'\n" + - "#set $test2.Parameters.Name = 'eric'\n" + - "Current value is: $test.Parameters.Name\n"+ - "Current value2 is: $test2.Parameters.Name\n"; - try - { - WebMacro wm = new WM( "testconfig.properties" ); - Template t = new StringTemplate( wm.getBroker(), templateText ); - Context context = wm.getContext(); - context.put( "test", new Wrapper() ); - context.put( "test2", new Wrapper2() ); - t.write( System.out, context ); - } - catch ( Exception e ) - { - e.printStackTrace(); //To change body of catch statement use Options | File Templates. - } - - } - } --- 247,250 ---- |
From: <ke...@us...> - 2003-07-21 21:28:27
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/parser In directory sc8-pr-cvs1:/tmp/cvs-serv9508 Modified Files: WMParser_impl.java Log Message: Removing the remnants of the old Filter mechanism Index: WMParser_impl.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/parser/WMParser_impl.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** WMParser_impl.java 12 Jun 2003 00:47:46 -0000 1.51 --- WMParser_impl.java 21 Jul 2003 21:28:24 -0000 1.52 *************** *** 979,983 **** Object[] names = v.toArray(); { ! if (true) return new VariableBuilder(names, false); } throw new Error("Missing return statement in function"); --- 979,983 ---- Object[] names = v.toArray(); { ! if (true) return new VariableBuilder(names); } throw new Error("Missing return statement in function"); |
From: <ke...@us...> - 2003-07-21 21:28:06
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/parser In directory sc8-pr-cvs1:/tmp/cvs-serv9446 Modified Files: WMParser_impl.jj Log Message: Removing the remnants of the old Filter mechanism Index: WMParser_impl.jj =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/parser/WMParser_impl.jj,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** WMParser_impl.jj 12 Jun 2003 00:17:49 -0000 1.48 --- WMParser_impl.jj 21 Jul 2003 21:28:00 -0000 1.49 *************** *** 773,777 **** { Object[] names = v.toArray(); ! return new VariableBuilder(names, false); } } --- 773,777 ---- { Object[] names = v.toArray(); ! return new VariableBuilder(names); } } |
From: <ke...@us...> - 2003-07-21 21:27:26
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/engine In directory sc8-pr-cvs1:/tmp/cvs-serv9364 Modified Files: VariableBuilder.java Log Message: Removing the remnants of the old Filter mechanism Index: VariableBuilder.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/VariableBuilder.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** VariableBuilder.java 12 Jun 2003 00:47:45 -0000 1.15 --- VariableBuilder.java 21 Jul 2003 21:27:23 -0000 1.16 *************** *** 29,43 **** private final Object[] _names; - private final boolean _filtered; ! public VariableBuilder (Object names[], boolean filtered) { _names = names; - _filtered = filtered; } public final Object build (BuildContext bc) throws BuildException { ! return bc.resolveVariableReference(_names, _filtered); } } --- 29,41 ---- private final Object[] _names; ! public VariableBuilder (Object names[]) { _names = names; } public final Object build (BuildContext bc) throws BuildException { ! return bc.resolveVariableReference(_names); } } |
From: <ke...@us...> - 2003-07-21 21:26:28
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive In directory sc8-pr-cvs1:/tmp/cvs-serv9219 Removed Files: EncodeDirective.java EscapeDirective.java SilenceDirective.java Log Message: Removing the remnants of the old Filter mechanism --- EncodeDirective.java DELETED --- --- EscapeDirective.java DELETED --- --- SilenceDirective.java DELETED --- |
From: <ke...@us...> - 2003-07-21 21:25:42
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/engine In directory sc8-pr-cvs1:/tmp/cvs-serv9122 Modified Files: BuildContext.java Log Message: Removing the remnants of the old Filter mechanism Index: BuildContext.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/engine/BuildContext.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** BuildContext.java 16 Jul 2003 06:45:00 -0000 1.27 --- BuildContext.java 21 Jul 2003 21:25:40 -0000 1.28 *************** *** 45,49 **** private final Map _types = new HashMap(); private final Map _macros = new HashMap(); - private final FilterManager _filters = new FilterManager(); public BuildContext (Broker b) --- 45,48 ---- *************** *** 100,134 **** /** - * Register a new filter, adding it to the chain for the supplied name. - * The name is either a top level property name or * to mean "all". - * @param var the top level property name that is being filtered - * @param ft the Filter which will handle this property - */ - public void addFilter (Variable var, Filter ft) - { - _filters.addFilter(var, ft); - } - - /** - * Clear all the filtered for the supplied name. Cleaing * clears - * only global filters, leaving filters for specific properties. - */ - public void clearFilters (Variable var) - { - _filters.clearFilters(var); - } - - /** - * Get the filter that applies to a specific variable. Returning - * null from this method means that the entire variable should - * be dropped from the output since it's been filtered to null. - * @return the Macro to be used to filter it, or null - */ - public Macro getFilterMacro (Variable v) - { - return _filters.getMacro(v); - } - - /** * Add a MacroDefinition to the build context */ --- 99,102 ---- *************** *** 172,176 **** * Used by various build() routines */ ! Object resolveVariableReference (Object names[], boolean filtered) throws BuildException { --- 140,144 ---- * Used by various build() routines */ ! Object resolveVariableReference (Object names[]) throws BuildException { *************** *** 231,237 **** throw new BuildException("Unrecognized Variable Type: " + type); } ! ! return (filtered && v instanceof Variable) ! ? getFilterMacro((Variable) v) : v; } --- 199,203 ---- throw new BuildException("Unrecognized Variable Type: " + type); } ! return v; } |
From: <ke...@us...> - 2003-07-21 21:24:39
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/engine In directory sc8-pr-cvs1:/tmp/cvs-serv8834 Removed Files: FilterManager.java EscapeFilter.java EncodeFilter.java SilenceFilter.java Log Message: Removing the remnants of the old Filter mechanism --- FilterManager.java DELETED --- --- EscapeFilter.java DELETED --- --- EncodeFilter.java DELETED --- --- SilenceFilter.java DELETED --- |
From: <ke...@us...> - 2003-07-21 21:23:53
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv8656 Removed Files: Filter.java Log Message: Removing the remnants of the old Filter mechanism --- Filter.java DELETED --- |
From: <lan...@us...> - 2003-07-21 05:49:51
|
Update of /cvsroot/webmacro/webmacro/macros/html In directory sc8-pr-cvs1:/tmp/cvs-serv11197/macros/html Added Files: menuStyles.wmm Log Message: Add macros missing required for execution and unit tests. --- NEW FILE: menuStyles.wmm --- #comment { menuStyles.wmm Macros for formatting html menus. The general approach is to support multiple levels, a selection on or off, and formatting on both edges. See http://apple.com and http://paypal.com for style examples used as templates for these menus. } ## tabbedMenu(menuData, formatProps) where: ## arg1 corresponds to the data elements of the menu ## arg2 provides style values for the menu #macro tabbedMenu($menuData, $formatProps) { $formatProps.tableSpec <tr> <td $formatProps.leftCellSpec> $formatProps.leftCellValue </td> <td $formatProps.leftCellSpec> <table $formatProps.contentTableSpec> <tr> <td $formatProps.contentCellSpec> #foreach $menuItem in $menuData.menuList { $menuItem } </td> </tr> <tr> <td $formatProps.contextCellSpec> #foreach $contextItem in $menuData.contextList { $contextItem } </td> </tr> </table> </td> <td $formatProps.rightCellSpec> $formatProps.rightCellValue </td> </tr> </table> } #macro singleTabbedMenu($menuData, $formatProps) { $formatProps.tableSpec <tr> <td $formatProps.leftCellSpec> $formatProps.leftCellValue </td> <td $formatProps.leftCellSpec> <table $formatProps.contentTableSpec> <tr> <td $formatProps.contentCellSpec> #foreach $menuItem in $menuData.menuList { $menuItem } </td> </tr> </table> </td> <td $formatProps.rightCellSpec> $formatProps.rightCellValue </td> </tr> </table> } |
From: <lan...@us...> - 2003-07-21 05:49:51
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/util In directory sc8-pr-cvs1:/tmp/cvs-serv11197/src/org/webmacro/util Added Files: SparseProperties.java Log Message: Add macros missing required for execution and unit tests. |
From: <lan...@us...> - 2003-07-21 05:49:50
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1:/tmp/cvs-serv11197/test/unit/org/webmacro/template Modified Files: TestParseInclude.java ecomm.wm Added Files: verisign.wm Log Message: Add macros missing required for execution and unit tests. --- NEW FILE: verisign.wm --- #comment { ecomm.wm A template to excercise the standard eCommerce macros supplied with WM. } #include as macro "allmacros.wmm" ## set up some useful data for the transaction. ## see the paypalSetup macro for the property name specs. #bean $System = "java.lang.System" scope=static ## verisign data... #bean $App = "org.webmacro.util.SparseProperties" scope=page onNew { #set $App.LoginName = "opendoors" #set $App.PartnerName = "VeriSign" #set $App.InputType = "image" #set $App.SubmitLabel = "Complete Order" #set $App.imageURL = "http://lyon.opendoors.com/img/completeOrder.gif" } #bean $Tran = "org.webmacro.util.SparseProperties" scope=page onNew { #set $Tran.Amount = "100.00" #set $Tran.TranType = "S" } ## now invoke the paypal macro with some supporting html so it can be viewed <html> <center> <p> Please go to the account of $App.LoginName. Amount Due=$Tran.Amount USD </p> <p> calling: #ccBasicTransaction( $Tran, $App ) </center> </html> Index: TestParseInclude.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestParseInclude.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TestParseInclude.java 14 Jul 2003 09:39:15 -0000 1.12 --- TestParseInclude.java 21 Jul 2003 05:49:47 -0000 1.13 *************** *** 98,101 **** --- 98,104 ---- + "$a", "\\$a was found"); + assertStringTemplateMatches("#include as macro \"root.wmm\"\n" + + "$a", "\\$a was found"); + } *************** *** 147,151 **** store(System.getProperty("user.dir") + "/" + "ecomm.html", value); } - /** executes out of the standard macro/ distribution. */ --- 150,153 ---- Index: ecomm.wm =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/ecomm.wm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ecomm.wm 23 Mar 2003 02:00:41 -0000 1.2 --- ecomm.wm 21 Jul 2003 05:49:47 -0000 1.3 *************** *** 1,63 **** ! #comment { ! ecomm.wm ! A template to excercise the standard eCommerce macros supplied with WM. ! } ! #include as macro "allmacros.wmm" ! ! ## set up some useful data for the transaction. ! ## see the paypalSetup macro for the property name specs. ! #bean $System = "java.lang.System" scope=static ! ! ## verisign data... ! #bean $App = "org.webmacro.util.SparseProperties" scope=page onNew { ! #set $App.LoginName = "lanesharman" ! #set $App.PartnerName = "VeriSign" ! } ! #bean $Tran = "org.webmacro.util.SparseProperties" scope=page onNew { ! #set $Tran.Amount = "100.00" ! #set $Tran.TranType = "S" ! } ! ! #bean $cust = "org.webmacro.util.SparseProperties" scope=page onNew { ! #set $cust.firstName = $System.getProperty("user.name") ! } ! ## set all the tran properties ! #bean $tran = "org.webmacro.util.SparseProperties" scope=page onNew { ! #set $tran.sellersEmailAccount = "su...@op..." ! #set $tran.itemName = "WebMacro Dues" ! #set $tran.itemNumber = "9092" ! #set $tran.amount = "25.00" ! #set $tran.specialInstructions = "Your Dues Help Support WebMacro Publicity!" ! } ! #bean $app = "org.webmacro.util.SparseProperties" scope=page onNew { ! #set $app.returnURL = "http://www.webmacro.org" ! #set $app.cancelURL = "http://www.webmacro.org/CancelDues" ! } ! ! ## now invoke the paypal macro with some supporting html so it can be viewed ! <html> ! <center> ! $cust.firstName: ! <p> ! Please Pay Your WebMacro Dues Today at PayPal. ! <br> ! $tran.amount is due and will keep your WebMacro subscritpion rolling. ! <p> ! #paypalSetup($cust, $tran, $app) ! <hr> ! #bean $bongoTran = "org.webmacro.util.SparseProperties" scope=page onNew { ! #set $bongoTran.sellersEmailAccount = "sa...@op..." ! #set $bongoTran.itemName = "Bongo Annual Subscription" ! #set $bongoTran.itemNumber = "9102" ! #set $bongoTran.amount = "72.00" ! #set $bongoTran.specialInstructions = "Your Dues Help Support WebMacro Publicity!" ! } ! #set $app.returnURL = "http://opendoors.com/bongo/paid" ! #set $app.cancelURL = "http://opendoors.com/bongo/cancel" ! <p> ! Also, please consider a one year subscription to bongo. ! <br> ! The most amazing graphical interface builder for java! Just $bongoTran.amount USD. ! #paypalSubscribe($cust, $bongoTran, $app); ! </center> ! </html> --- 1 ---- ! #comment { ecomm.wm A template to excercise the standard eCommerce macros supplied with WM. } #include as macro "allmacros.wmm" ## set up some useful data for the transaction. ## see the paypalSetup macro for the property name specs. #bean $System = "java.lang.System" scope=static ## verisign data... #bean $App = "org.webmacro.util.SparseProperties" scope=page onNew { #set $App.LoginName = "lanesharman" #set $App.PartnerName = "VeriSign" } #bean $Tran = "org.webmacro.util.SparseProperties" scope=page onNew { #set $Tran.Amount = "100.00" #set $Tran.TranType = "S" } #bean $cust = "org.webmacro.util.SparseProperties" scope=page onNew { #set $cust.firstName = $System.getProperty("user.name") } ## set all the tran properties #bean $tran = "org.webmacro.util.SparseProperties" scope=page onNew { #set $tran.sellersEmailAccount = "su...@op..." #set $tran.itemName = "WebMacro Dues" #set $tran.itemNumber = "9092" #set $tran.amount = "25.00" #set $tran.specialInstructions = "Your Dues Help Support WebMacro Publicity!" } #bean $app = "org.webmacro.util.SparseProperties" scope=page onNew { #set $app.returnURL = "http://www.webmacro.org" #set $app.cancelURL = "http://www.webmacro.org/CancelDues" } ## now invoke the paypal macro with some supporting html so it can be viewed <html> <center> $cust.firstName: <p> Please Pay Your WebMacro Dues Today at PayPal. <br> $tran.amount is due and will keep your WebMacro subscritpion rolling. <p> #paypalSetup($cust, $tran, $app) <hr> #bean $bongoTran = "org.webmacro.util.SparseProperties" scope=page onNew { #set $bongoTran.sellersEmailAccount = "sa...@op..." #set $bongoTran.itemName = "Bongo Annual Subscription" #set $bongoTran.itemNumber = "9102" #set $bongoTran.amount = "72.00" #set $bongoTran.specialInstructions = "Your Dues Help Support WebMacro Publicity!" } #set $app.returnURL = "http://opendoors.com/bongo/paid" #set $app.cancelURL = "http://opendoors.com/bongo/cancel" <p> Also, please consider a one year subscription to bongo. <br> The most amazing graphical interface builder for java! Just $bongoTran.amount USD. #paypalSubscribe($cust, $bongoTran, $app); </center> </html> \ No newline at end of file |
From: <lan...@us...> - 2003-07-21 05:49:50
|
Update of /cvsroot/webmacro/webmacro/macros/ecomm In directory sc8-pr-cvs1:/tmp/cvs-serv11197/macros/ecomm Added Files: verisign.wmm Log Message: Add macros missing required for execution and unit tests. --- NEW FILE: verisign.wmm --- #comment { verisign.wmm Macros to support common web actions for a verisign cc transaction. } ## basicCreditCard(arg2, arg3) where: ## arg1 corresponds to transaction properties with names mapped below ## arg2 corresponds to application/format properties with names mapped below ## to the field elements required by verisign, Minimum Integration. #macro ccBasicTransaction($TranProps, $AppProps) { <FORM ACTION="https://payflowlink.verisign.com/payflowlink.cfm" METHOD="GET"> <INPUT TYPE="hidden" NAME="LOGIN" VALUE="$AppProps.LoginName"> <INPUT TYPE="hidden" NAME="PARTNER" VALUE="$AppProps.PartnerName"> <INPUT TYPE="hidden" NAME="AMOUNT" VALUE="$TranProps.Amount"> <INPUT TYPE="hidden" NAME="TYPE" VALUE="$TranProps.TranType"> #if ($AppProps.InputType == "submit") { <INPUT TYPE="submit" value="$AppProps.SubmitLabel"> } #else { <INPUT TYPE="image" SRC="$AppProps.imageURL" BORDER="0" NAME="submit" alt="$AppProps.SubmitLabel"> } </FORM> } |
From: <lan...@us...> - 2003-07-19 23:07:26
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/engine In directory sc8-pr-cvs1:/tmp/cvs-serv21795/test/unit/org/webmacro/engine Modified Files: TestStaticClasses.java Log Message: typo in method call Index: TestStaticClasses.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/engine/TestStaticClasses.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestStaticClasses.java 12 Jun 2003 00:47:49 -0000 1.2 --- TestStaticClasses.java 19 Jul 2003 23:07:24 -0000 1.3 *************** *** 42,47 **** public void testStaticClassWithNullAsFirstArg_1 () throws Exception { ! assertEvalutionEquals("$SimpleClass.foo(null, null)", "arg is null"); ! assertEvalutionEquals("$SimpleInstance.foo(null, null)", "arg is null"); } --- 42,47 ---- public void testStaticClassWithNullAsFirstArg_1 () throws Exception { ! assertEvaluationEquals("$SimpleClass.foo(null, null)", "arg is null"); ! assertEvaluationEquals("$SimpleInstance.foo(null, null)", "arg is null"); } |
From: <wan...@us...> - 2003-07-17 21:14:27
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/util In directory sc8-pr-cvs1:/tmp/cvs-serv29619 Modified Files: HTMLEscaper.java Log Message: Fix to allow null strings to be parsed, resulting in null. Index: HTMLEscaper.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/util/HTMLEscaper.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** HTMLEscaper.java 12 Jun 2003 00:47:48 -0000 1.7 --- HTMLEscaper.java 17 Jul 2003 21:14:24 -0000 1.8 *************** *** 31,53 **** /** - * A little bit of unit testing - */ - public static void main (String[] args) - { - - String text = - "This is a test of the html escaper & let's hope it really, " + - "really <B><I>works</I></B>! Is there an \u00f7 with an umlaut in the house?" + - "This code is \u00a9copyleft. I like to be paid in \u00fa\u00fa\u00fas"; - - System.out.println("NOTE: Due to differences in ASCII fonts, the text " + - "sent to the escaper may not display properly. Hopefully you will be " + - "able to tell what it should have looked like from the escaped output."); - System.out.println("in: " + text); - - System.out.println("out: " + escape(text)); - } - - /** * This method will take the input and escape characters that have * an HTML entity representation. --- 31,34 ---- *************** *** 59,62 **** --- 40,46 ---- public static final String escape (String nonHTMLsrc) { + if (nonHTMLsrc == null) + return null; + StringBuffer res = new StringBuffer(); int l = nonHTMLsrc.length(); |
From: <wan...@us...> - 2003-07-17 21:13:52
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/util In directory sc8-pr-cvs1:/tmp/cvs-serv29507 Added Files: TestHTMLEscaper.java Log Message: New unit tests --- NEW FILE: TestHTMLEscaper.java --- package org.webmacro.util; import junit.framework.TestCase; public class TestHTMLEscaper extends TestCase { public TestHTMLEscaper (String name) { super(name); } protected void setUp () { } public void testEscaping () throws Exception { assertEscape("<B>", "<B>"); assertEscape("\u00f6", "ö"); assertEscape("\u00a9", "©"); assertEscape("\u00a3", "£"); assertEscape("\u0080", "€"); assertEscape("This is a test: \u0080\u0080\u0080 is better than" + "\u00a3\u00a3\u00a3!", "This is a test: €€€ is better than" + "£££!" ); } public void testEscapingNull() throws Exception { assertTrue( "Escaping null didn't return null!", HTMLEscaper.escape( null) == null); } private void assertEscape( String text, String expected ) { String res = HTMLEscaper.escape(text); if (!res.equals(expected)) { String s = "Escaped /" + text + "/ and expected /" + expected + "/ but got /" + res+"/"; assertTrue( s, false); } } } |
From: <wan...@us...> - 2003-07-17 21:13:10
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1:/tmp/cvs-serv29394 Modified Files: TemplateTestCase.java Log Message: Call me a pedant, corrected spelling error Index: TemplateTestCase.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TemplateTestCase.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TemplateTestCase.java 17 Jul 2003 12:52:58 -0000 1.18 --- TemplateTestCase.java 17 Jul 2003 21:13:07 -0000 1.19 *************** *** 126,137 **** ! public void assertEvalutionEquals (String eval, Object result) throws Exception { ! String template = "#set $assertEvalutionEquals = " + eval; executeStringTemplate(template); if (result == null) ! assertTrue(_context.get("assertEvalutionEquals") == null); else ! assertTrue(result == null ? "null" : result.toString(), result.equals(_context.get("assertEvalutionEquals"))); } --- 126,137 ---- ! public void assertEvaluationEquals (String eval, Object result) throws Exception { ! String template = "#set $assertEvaluationEquals = " + eval; executeStringTemplate(template); if (result == null) ! assertTrue(_context.get("assertEvaluationEquals") == null); else ! assertTrue(result == null ? "null" : result.toString(), result.equals(_context.get("assertEvaluationEquals"))); } |