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: Tim P <ti...@us...> - 2008-01-28 15:56:08
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/parser In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23838/src/org/webmacro/parser Modified Files: WMParser_implTokenManager.java Log Message: Organise imports Index: WMParser_implTokenManager.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/parser/WMParser_implTokenManager.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** WMParser_implTokenManager.java 27 May 2005 19:44:58 -0000 1.29 --- WMParser_implTokenManager.java 28 Jan 2008 15:55:54 -0000 1.30 *************** *** 1,15 **** /* Generated By:JavaCC: Do not edit this line. WMParser_implTokenManager.java */ package org.webmacro.parser; - import java.util.*; - import java.io.*; - import org.webmacro.*; - import org.webmacro.engine.*; - import org.webmacro.directive.*; - import org.webmacro.directive.Directive; - import org.webmacro.directive.DirectiveProvider; - import org.webmacro.directive.DirectiveBuilder; - import org.webmacro.directive.Directive.ArgDescriptor; - import org.webmacro.directive.Directive.OptionChoice; - import org.webmacro.directive.Directive.Subdirective; public class WMParser_implTokenManager implements WMParser_implConstants --- 1,4 ---- |
From: Tim P. <ti...@pa...> - 2006-04-19 17:57:59
|
This has been fixed in svn-head http://jira.codehaus.org/browse/JETTY-43 I will undo when next jetty-6 version comes out Cheers timP On Thursday 13 April 2006 12:42, Tim P wrote: > Update of /cvsroot/webmacro/webmacro/src/org/webmacro/servlet > In directory > sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25758/src/org/webmacro/servlet > > Modified Files: > Form.java > Log Message: > Jetty6 Maven Plugin appears to have a bug such that getParameterValues > returns a null String rather than null if field does not exist. > > > Index: Form.java > =================================================================== > RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/Form.java,v > retrieving revision 1.11 > retrieving revision 1.12 > diff -C2 -d -r1.11 -r1.12 > *** Form.java 27 May 2005 19:44:59 -0000 1.11 > --- Form.java 13 Apr 2006 11:42:19 -0000 1.12 > *************** > *** 37,41 **** > > /** > ! * Provide access to form variables > */ > final public class Form implements Bag > --- 37,41 ---- > > /** > ! * Provide access to form variables. > */ > final public class Form implements Bag > *************** > *** 43,47 **** > > /** > ! * This is the request object from the WebContext > */ > final HttpServletRequest _request; > --- 43,47 ---- > > /** > ! * This is the request object from the WebContext. > */ > final HttpServletRequest _request; > *************** > *** 50,54 **** > * Read the form data from the supplied Request object > */ > ! Form (final HttpServletRequest r) > { > _request = r; > --- 50,54 ---- > * Read the form data from the supplied Request object > */ > ! Form(final HttpServletRequest r) > { > _request = r; > *************** > *** 56,66 **** > > /** > ! * Get a form value > */ > ! final public Object get (String field) > { > try > { > ! return _request.getParameterValues(field)[0]; > } > catch (NullPointerException ne) > --- 56,67 ---- > > /** > ! * Get a form value. > */ > ! final public Object get(String field) > { > + String[] values = _request.getParameterValues(field); > try > { > ! return values[0]; > } > catch (NullPointerException ne) > *************** > *** 68,82 **** > return null; > } > } > > /** > ! * Try to get a form value > * > ! * @param strKey = The form key that we're looking for. > * > * @return The value of that form key if found, else null > * > **/ > ! final public Object getPossibleForm (String strKey) > { > String strElement; > --- 69,88 ---- > return null; > } > + catch (ArrayIndexOutOfBoundsException e) > + { > + // Seems to be a bug in Jetty > + return null; > + } > } > > /** > ! * Try to get a form value. > * > ! * @param strKey The form key that we're looking for. > * > * @return The value of that form key if found, else null > * > **/ > ! final public Object getPossibleForm(String strKey) > { > String strElement; > *************** > *** 107,113 **** > > /** > ! * Get a form value as an array > */ > ! final public Object[] getList (String field) > { > try > --- 113,119 ---- > > /** > ! * Get a form value as an array. > */ > ! final public Object[] getList(String field) > { > try > *************** > *** 122,128 **** > > /** > ! * Unsupported > */ > ! final public void put (String key, Object value) > throws UnsettableException > { > --- 128,134 ---- > > /** > ! * Unsupported. > */ > ! final public void put(String key, Object value) > throws UnsettableException > { > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live > webcast and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Webmacro-cvs mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-cvs |
From: Tim P <ti...@us...> - 2006-04-13 16:34:57
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/adapter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18916/test/unit/org/webmacro/adapter Modified Files: TestSpringView.java Log Message: Set the WM explicitly so test works in eclipse as well as ant Index: TestSpringView.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/adapter/TestSpringView.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestSpringView.java 8 Dec 2005 22:12:42 -0000 1.1 --- TestSpringView.java 13 Apr 2006 16:34:54 -0000 1.2 *************** *** 26,35 **** public void testViewRender() throws Exception { WebMacroView v = new WebMacroView(); // Setup dummy Spring context and provide a WM instance so that // It doesn't try to resolve test template from Servletcontext DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(); ! beanFactory.registerSingleton("WebMacro", new WM()); GenericWebApplicationContext springContext = --- 26,37 ---- public void testViewRender() throws Exception { + WM wm = new WM(); WebMacroView v = new WebMacroView(); + v.setWebMacro(wm); // Setup dummy Spring context and provide a WM instance so that // It doesn't try to resolve test template from Servletcontext DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(); ! beanFactory.registerSingleton("WebMacro", wm); GenericWebApplicationContext springContext = |
From: Tim P <ti...@us...> - 2006-04-13 11:42:22
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/servlet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25758/src/org/webmacro/servlet Modified Files: Form.java Log Message: Jetty6 Maven Plugin appears to have a bug such that getParameterValues returns a null String rather than null if field does not exist. Index: Form.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/servlet/Form.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Form.java 27 May 2005 19:44:59 -0000 1.11 --- Form.java 13 Apr 2006 11:42:19 -0000 1.12 *************** *** 37,41 **** /** ! * Provide access to form variables */ final public class Form implements Bag --- 37,41 ---- /** ! * Provide access to form variables. */ final public class Form implements Bag *************** *** 43,47 **** /** ! * This is the request object from the WebContext */ final HttpServletRequest _request; --- 43,47 ---- /** ! * This is the request object from the WebContext. */ final HttpServletRequest _request; *************** *** 50,54 **** * Read the form data from the supplied Request object */ ! Form (final HttpServletRequest r) { _request = r; --- 50,54 ---- * Read the form data from the supplied Request object */ ! Form(final HttpServletRequest r) { _request = r; *************** *** 56,66 **** /** ! * Get a form value */ ! final public Object get (String field) { try { ! return _request.getParameterValues(field)[0]; } catch (NullPointerException ne) --- 56,67 ---- /** ! * Get a form value. */ ! final public Object get(String field) { + String[] values = _request.getParameterValues(field); try { ! return values[0]; } catch (NullPointerException ne) *************** *** 68,82 **** return null; } } /** ! * Try to get a form value * ! * @param strKey = The form key that we're looking for. * * @return The value of that form key if found, else null * **/ ! final public Object getPossibleForm (String strKey) { String strElement; --- 69,88 ---- return null; } + catch (ArrayIndexOutOfBoundsException e) + { + // Seems to be a bug in Jetty + return null; + } } /** ! * Try to get a form value. * ! * @param strKey The form key that we're looking for. * * @return The value of that form key if found, else null * **/ ! final public Object getPossibleForm(String strKey) { String strElement; *************** *** 107,113 **** /** ! * Get a form value as an array */ ! final public Object[] getList (String field) { try --- 113,119 ---- /** ! * Get a form value as an array. */ ! final public Object[] getList(String field) { try *************** *** 122,128 **** /** ! * Unsupported */ ! final public void put (String key, Object value) throws UnsettableException { --- 128,134 ---- /** ! * Unsupported. */ ! final public void put(String key, Object value) throws UnsettableException { |
From: Keats K. <ke...@us...> - 2006-03-29 16:27:50
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13066 Modified Files: TypeDirective.java Log Message: fixed potential infinite loop when variable is undefined. Index: TypeDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/directive/TypeDirective.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TypeDirective.java 12 Jun 2003 00:47:44 -0000 1.8 --- TypeDirective.java 29 Mar 2006 16:27:44 -0000 1.9 *************** *** 25,28 **** --- 25,29 ---- import org.webmacro.engine.BuildContext; import org.webmacro.engine.BuildException; + import org.webmacro.engine.UndefinedMacro; import org.webmacro.engine.Variable; import org.webmacro.util.Settings; *************** *** 148,155 **** // evaluate the _object reference down to its base object ! while (o instanceof Macro) o = ((Macro) o).evaluate(context); ! if (o == null) { // the Variable to check isn't in the Context. --- 149,156 ---- // evaluate the _object reference down to its base object ! while (o instanceof Macro && o != UndefinedMacro.getInstance()) o = ((Macro) o).evaluate(context); ! if (o == null || o == UndefinedMacro.getInstance()) { // the Variable to check isn't in the Context. |
From: Keats K. <ke...@us...> - 2006-03-28 23:45:14
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2207 Modified Files: TestCountDirective.java Log Message: Added test for undefined arguments. Index: TestCountDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestCountDirective.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TestCountDirective.java 29 Jul 2003 17:33:45 -0000 1.5 --- TestCountDirective.java 28 Mar 2006 23:45:09 -0000 1.6 *************** *** 91,94 **** --- 91,95 ---- public void testCountByZero () throws Exception { + // NOTE: this requires use of the DefaultEvaluationExceptionHandler to suppress the exception! executeStringTemplate("#count $i from 1 to 10 step 0 { $Counter.next() }"); Integer i = (Integer) _context.get("i"); *************** *** 99,102 **** --- 100,124 ---- + public void testUndefArgs () throws Exception + { + // NOTE: this requires use of the DefaultEvaluationExceptionHandler to suppress the exception! + executeStringTemplate("#count $i from 1 to 10 step $stepUndef { $Counter.next() }"); + Integer i = (Integer) _context.get("i"); + Counter c = (Counter) _context.get("Counter"); + assertTrue(c.toString(), c.getCount() == 0); + assertTrue(i == null); + executeStringTemplate("#count $i from $startUndef to 10 step 1 { $Counter.next() }"); + i = (Integer) _context.get("i"); + c = (Counter) _context.get("Counter"); + assertTrue(c.toString(), c.getCount() == 0); + assertTrue(i == null); + executeStringTemplate("#count $i from 1 to $stopUndef step 1 { $Counter.next() }"); + i = (Integer) _context.get("i"); + c = (Counter) _context.get("Counter"); + assertTrue(c.toString(), c.getCount() == 0); + assertTrue(i == null); + } + + public void testCountForwardsWithNegativeStep () throws Exception { |
From: Keats K. <ke...@us...> - 2006-03-28 23:44:31
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1753 Modified Files: CountDirective.java Log Message: Fixed infinite loop bug when an argument was undefined. Refactored to use EEH. Index: CountDirective.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/directive/CountDirective.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CountDirective.java 1 Nov 2005 04:08:04 -0000 1.7 --- CountDirective.java 28 Mar 2006 23:44:26 -0000 1.8 *************** *** 29,32 **** --- 29,33 ---- import org.webmacro.engine.BuildContext; import org.webmacro.engine.BuildException; + import org.webmacro.engine.UndefinedMacro; import org.webmacro.engine.Variable; *************** *** 34,42 **** /** - * Allows a template to count - * according to a range. - * <pre> * #count $i from 1 to 100 [step 1] ! * </pre> * @author Eric B. Ridge (eb...@tc...) * @since 1.1b1 --- 35,40 ---- /** * #count $i from 1 to 100 [step 1] ! * * @author Eric B. Ridge (eb...@tc...) * @since 1.1b1 *************** *** 143,215 **** { int start = _start, end = _end, step = _step; ! Object tmp; ! // if necessary, do run-time evaluation of our // start, end, and step objects. ! if ((tmp = _objStart) != null) ! { ! while (tmp instanceof Macro) ! tmp = ((Macro) tmp).evaluate(context); ! if (tmp != null) ! start = Integer.parseInt(tmp.toString()); ! else ! { ! writeWarning("#count: Starting value cannot be null. Not counting", context, out); ! return; ! } ! } ! ! if ((tmp = _objEnd) != null) ! { ! while (tmp instanceof Macro) ! tmp = ((Macro) tmp).evaluate(context); ! if (tmp != null) ! end = Integer.parseInt(tmp.toString()); ! else ! { ! writeWarning("#count: Ending value cannot be null. Not counting", context, out); ! return; ! } ! } ! ! if ((tmp = _objStep) != null) ! { ! while (tmp instanceof Macro) ! tmp = ((Macro) tmp).evaluate(context); ! if (tmp != null) ! step = Integer.parseInt(tmp.toString()); ! else ! { ! writeWarning("#count: Starting value cannot be null. Not counting", context, out); ! return; ! } } ! ! // Check if no step explicitly assigned, if so auto-detect it ! if (step == Integer.MAX_VALUE ) { ! step = (start > end) ? -1 : +1; } ! if (step > 0) ! { ! for (; start <= end; start += step) ! { ! _iterator.setValue(context, new Integer(start)); ! _body.write(out, context); ! } ! } ! else if (step < 0) ! { ! for (; start >= end; start += step) ! { ! _iterator.setValue(context, new Integer(start)); ! _body.write(out, context); ! } ! } ! else { ! writeWarning("#count: step cannot be 0. Not counting", context, out); } } ! } \ No newline at end of file --- 141,227 ---- { int start = _start, end = _end, step = _step; ! boolean error = false; ! // if necessary, do run-time evaluation of our // start, end, and step objects. ! // If object is null then it has been fully resolved during build. ! try { ! if (_objStart != null) ! start = evalAsInt(context, _objStart); ! if (_objEnd != null) ! end = evalAsInt(context, _objEnd); ! if (_objStep != null) ! step = evalAsInt(context, _objStep); } ! catch (Exception e) { ! out.write(context.getEvaluationExceptionHandler().expand(_iterator, context, e)); ! error = true; } ! if (!error) { ! // Check if no step explicitly assigned, if so auto-detect it ! if (step == Integer.MAX_VALUE ) ! { ! step = (start > end) ? -1 : +1; ! } ! ! if (step > 0) ! { ! for (; start <= end; start += step) ! { ! _iterator.setValue(context, new Integer(start)); ! _body.write(out, context); ! } ! } ! else if (step < 0) ! { ! for (; start >= end; start += step) ! { ! _iterator.setValue(context, new Integer(start)); ! _body.write(out, context); ! } ! } ! else ! { ! PropertyException pe = new PropertyException.UndefinedVariableException(); ! pe.setMessage("#count: step cannot be 0."); ! out.write(context.getEvaluationExceptionHandler().expand(_iterator, context, pe)); ! } } } ! ! private int evalAsInt(Context context, Object o) throws PropertyException ! { ! if (o != null) ! { ! while (o instanceof Macro && !(o == UndefinedMacro.getInstance())) ! { ! o = ((Macro)o).evaluate(context); ! } ! if (o == UndefinedMacro.getInstance()){ ! PropertyException pe = new PropertyException.UndefinedVariableException(); ! pe.setMessage("Undefined expression in #count directive."); ! throw pe; ! } ! } ! if (o == null) ! { ! PropertyException pe = new PropertyException.UndefinedVariableException(); ! pe.setMessage("Null expression in #count directive."); ! throw pe; ! } ! if (o instanceof Number) ! return ((Number) o).intValue(); ! try { ! return Integer.parseInt(o.toString()); ! } ! catch (NumberFormatException e) ! { ! PropertyException pe = new PropertyException.UndefinedVariableException(); ! pe.setMessage("Invalid numeric expression in #count directive: [" + o + "]"); ! throw pe; ! } ! } ! } |
From: Eric B. R. <dr...@us...> - 2006-03-17 23:44:17
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12188/src/org/webmacro Modified Files: FastWriter.java Log Message: removing test file Index: FastWriter.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/FastWriter.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** FastWriter.java 16 Jul 2003 06:44:59 -0000 1.31 --- FastWriter.java 17 Mar 2006 23:44:09 -0000 1.32 *************** *** 24,33 **** package org.webmacro; - import java.io.*; - import org.webmacro.util.ByteBufferOutputStream; import org.webmacro.util.Encoder; import org.webmacro.util.EncoderProvider; /** --- 24,33 ---- package org.webmacro; import org.webmacro.util.ByteBufferOutputStream; import org.webmacro.util.Encoder; import org.webmacro.util.EncoderProvider; + import java.io.*; + /** |
From: Eric B. R. <dr...@us...> - 2006-03-17 23:44:17
|
Update of /cvsroot/webmacro/webmacro In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12188 Removed Files: test.txt Log Message: removing test file --- test.txt DELETED --- |
From: Eric B. R. <dr...@us...> - 2006-03-17 23:34:21
|
Update of /cvsroot/webmacro/webmacro In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8563 Added Files: test.txt Log Message: testing auto-mailer --- NEW FILE: test.txt --- this is a test |
From: <lan...@us...> - 2003-12-23 18:03:59
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/util In directory sc8-pr-cvs1:/tmp/cvs-serv24092/src/org/webmacro/util Modified Files: SparseProperties.java WMEval.java Log Message: Upgrades to basic functionality Index: SparseProperties.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/util/SparseProperties.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SparseProperties.java 21 Jul 2003 05:49:48 -0000 1.4 --- SparseProperties.java 23 Dec 2003 18:03:56 -0000 1.5 *************** *** 12,15 **** --- 12,16 ---- import java.util.Properties; + import java.util.Enumeration; /** *************** *** 47,50 **** --- 48,75 ---- super(defaults); this.globalDefault = globalDefault; + } + + public static SparseProperties getTemplate() + { + return getTemplate(null); + } + + public static SparseProperties getTemplate(Properties template) + { + SparseProperties p = null; + if (template == null) + { + p = new SparseProperties(); + } + else + { + p = new SparseProperties(template); + } + Enumeration e = p.keys(); + while (e.hasMoreElements()) + { + p.put(e.nextElement(), null); + } + return p; } Index: WMEval.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/util/WMEval.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** WMEval.java 16 Jul 2003 06:45:00 -0000 1.14 --- WMEval.java 23 Dec 2003 18:03:56 -0000 1.15 *************** *** 322,325 **** --- 322,338 ---- } + /** + * Evaluates the current context for the input file and writes it to the output file. + */ + public String eval (String templateResourceFile, String outputFileName, boolean append) throws Exception + { + Template t = wm.getTemplate(templateResourceFile); + String val = t.evaluateAsString(context); + OutputStream out = new FileOutputStream(outputFileName, append); + out.write(val.getBytes()); + out.close(); + return val; + } + /** |
From: <ska...@us...> - 2003-12-05 20:18:16
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/util In directory sc8-pr-cvs1:/tmp/cvs-serv21984/test/unit/org/webmacro/util Modified Files: TestHTMLEscaper.java Log Message: fixed typo for divide encoding. Fixes bug #853939 Index: TestHTMLEscaper.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/util/TestHTMLEscaper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestHTMLEscaper.java 17 Jul 2003 21:13:49 -0000 1.1 --- TestHTMLEscaper.java 5 Dec 2003 20:18:13 -0000 1.2 *************** *** 26,29 **** --- 26,30 ---- "This is a test: €€€ is better than" + "£££!" ); + assertEscape("\u00F7","÷"); } |
From: <ska...@us...> - 2003-12-05 20:18:16
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/util In directory sc8-pr-cvs1:/tmp/cvs-serv21984/src/org/webmacro/util Modified Files: HTMLEscaper.java Log Message: fixed typo for divide encoding. Fixes bug #853939 Index: HTMLEscaper.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/util/HTMLEscaper.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** HTMLEscaper.java 17 Jul 2003 21:14:24 -0000 1.8 --- HTMLEscaper.java 5 Dec 2003 20:18:13 -0000 1.9 *************** *** 188,192 **** {"\u00F5", "otilde"}, {"\u00F6", "ouml"}, ! {"\u00F7", "divid"}, {"\u00F8", "oslash"}, {"\u00F9", "ugrave"}, --- 188,192 ---- {"\u00F5", "otilde"}, {"\u00F6", "ouml"}, ! {"\u00F7", "divide"}, {"\u00F8", "oslash"}, {"\u00F9", "ugrave"}, |
From: <ska...@us...> - 2003-12-05 20:17:13
|
Update of /cvsroot/webmacro/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv21807 Modified Files: build.xml Log Message: fixed case for WebMacro.defaults.classic case matters on unix Index: build.xml =================================================================== RCS file: /cvsroot/webmacro/webmacro/build.xml,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** build.xml 3 Aug 2003 21:37:06 -0000 1.36 --- build.xml 5 Dec 2003 20:17:10 -0000 1.37 *************** *** 127,131 **** <fileset dir="${tmpdir}" includes="**/*.properties" /> </copy> ! <copy file="webmacro.defaults.${wm-style}" tofile="${classes}/WebMacro.defaults"/> <touch file="${classes}/WM-VERSION-${version}" /> --- 127,131 ---- <fileset dir="${tmpdir}" includes="**/*.properties" /> </copy> ! <copy file="WebMacro.defaults.${wm-style}" tofile="${classes}/WebMacro.defaults"/> <touch file="${classes}/WM-VERSION-${version}" /> |
From: <lan...@us...> - 2003-08-13 07:27:05
|
Update of /cvsroot/webmacro/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv10084 Added Files: WebMacro.defaults.classic WebMacro.defaults.minimal Log Message: --- NEW FILE: WebMacro.defaults.classic --- # DO NOT EDIT THIS FILE -- Edit WebMacro.properties instead! # # This file contains the DEFAULT values for WebMacro CLASSIC. You can # set the actual live values in WebMacro.properties and that will # override the settings in this file. This file also contains examples # of how to set properties, which may be commented out. # # You can override any setting in this file by setting it # in WebMacro.properties. You can remove properties that are set in this # file by setting them to a null value in WebMacro.properties. # # Search order for properties is: # default properties file (WebMacro.defaults) # application properties file (WebMacro.properties or other) # servlet context arguments (2.2 and later, prefixed with org.webmacro) # system properties (prefixed with org.webmacro) ########################################################### # # BASIC CONFIGURATION: # # Character encoding. This is ONLY the encoding that is used to # parse templates. It does not determine the encoding that is # returned to the browser. WebMacro will translate templates from # this encoding to whatever encoding the browser requests. See # the FastWriter class to learn how to control output encoding. TemplateEncoding: UTF-8 TemplateOutputEncoding: UTF-8 # # Logging # # A whitespace separated list of org.webmacro.util.LogTarget # implementations that should should receive your log output. # # WebMacro comes with a default target, LogFile, which logs # to stderr (or a file if the LogFile setting is set, see below). # You can easily create your own implementations that log to your # custom logging system or to Log4J or whatever. LogTargets: org.webmacro.util.LogFile # LogLevel can be: ALL, DEBUG, INFO, NOTICE, WARNING, ERROR, or NONE # in order of most information to least information displayed. # The top level "LogLevel" setting controls the default log level # for any log. You can set specific levels for individual log types # by declaring a value for LogLevel.type. WebMacro itself has the # following types of log messages: # # log the log system itself # wm high level WebMacro behavior # servlet the servlet framework # resource things that load other things (eg: TemplateProvider) # context setting and evaluating properties in a context # engine messages about parsing and executing a tempalte # # There may be more types than that in your system, you can learn # what they are by setting the log level for "log" to INFO. LogLevel: NOTICE #LogLevel.log: NOTICE #LogLevel.wm: NOTICE #LogLevel.servlet: NOTICE #LogLevel.resource: NOTICE #LogLevel.context: NOTICE #LogLevel.webcon: NOTICE #LogLevel.engine: NOTICE #LogLevel.directive: NOTICE #LogLevel.parser: NOTICE # LogTraceExceptions causes exception stack traces to be included in the log, # this causes exceptions to be verbose, but may point out the exact line # or method which is causing a fault. LogTraceExceptions: TRUE LogUsingServletLog: TRUE # the following 2 options are used by the org.webmacro.util.LogFile # log target. They do NOT specify system-wide logging options! # # Log format strings. This is a format string to be passed to MessageFormat. # If no format string is specified (the default, since the line below is # commented out), the string "{0,time}\t{1}\t{2}\t{3}" will be used if logging # to a file or to standard error, ,and the string "WebMacro:{1}\t{2}\t{3}" # will be used if logging to the servlet container log (if LogUsingServletLog # is true.) #LogFormat: {0,time}\t{1}\t{2}\t{3} # Use the following to log to a file rather than stderr. If your # standard error writes to a useful log already, you don't need this, # but many servlet runners simply eat standard error. #LogFile: /path/to/log/file # # Error Handling # # Set the template (relative to TemplateDirectory) used for errors. You # can edit this template to customize the way script failures appear # # This template is used by WMServlet, but you can use it for your own # servlets too. ErrorTemplate: error.wm ErrorVariable: error # Set the default ExceptionHandler, which gets control when an evaluation # exception is encountered. ExceptionHandler: org.webmacro.engine.DefaultEvaluationExceptionHandler ########################################################### # # ADVANCED CONFIGURATION # # Don't change these values unless you know what you're doing. They # allow you to fine-tune, extend, and customize WebMacro's behavior. # # Relaxed Directive Building. # # If set to true, text blocks produced by tools such as DreamWeaver # and other html editors will not choke the parse/build phase # when they introduce strings with a preceding # such as # #ffffff, #BeginDirective and #Comment. By default the property is # set to false. Therefore, WebMacro will fail fast on this type of text. RelaxedDirectiveBuilding: False # ResourceProviders are pluggable modules that are used to load # important data and code. You can create your own ResourceProviders # to add new modules to WebMacro, or replace existing modules. # They are all implementations of org.webmacro.broker.ResourceProvider Providers: Providers.template: org.webmacro.resource.TemplateProvider Providers.url: org.webmacro.resource.UrlProvider Providers.config: org.webmacro.resource.ConfigProvider Providers.directive: org.webmacro.directive.DirectiveProvider Providers.parser: org.webmacro.engine.ParserProvider Providers.encoder: org.webmacro.util.EncoderProvider # # Directives # # The DirectiveProvider uses these entries to load directives for the parser. # If you want to remove any of these, simply override the value of # Directive.xxx in your .properties file with an empty value. # You can add new directives by creating Directives.xxx values in your # Properties file, and you can also override the Directives property to # specify a list of directive classes. # Directives implement org.webmacro.directive.Directive # Directives: Directives.attribute: org.webmacro.directive.AttributeDirective Directives.const: org.webmacro.directive.AttributeDirective Directives.include: org.webmacro.directive.IncludeDirective Directives.parse: org.webmacro.directive.IncludeDirective Directives.set: org.webmacro.directive.SetDirective Directives.setblock: org.webmacro.directive.SetblockDirective Directives.macro: org.webmacro.directive.MacroDirective Directives.if: org.webmacro.directive.IfDirective Directives.text: org.webmacro.directive.TextDirective Directives.comment: org.webmacro.directive.CommentDirective Directives.foreach: org.webmacro.directive.ForeachDirective Directives.alternate: org.webmacro.directive.AlternateDirective Directives.param: org.webmacro.directive.ParamDirective Directives.type: org.webmacro.directive.TypeDirective 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 # # Directive Configuration # # # Should the #type directive be enabled? By default, yes it is. # When moving to a production environment, you should set this # to "false", so as not to incur the overhead of #type type.Enabled = true # # Configuration for #include and #parse # # NOTE: #parse has been deprecated. It is included for backwards # compatibility only. You should instead use: # #include as template "template.wm" # # # TemplateExtensions - a list of (comma-separated) file extensions # that are assumed to be templates when # #include is used without qualifing the # file type. By convention wmm is for WM macro library files. include.TemplateExtensions: .wm, .wmt, .tml, .tmpl, .wmm parse.TemplateExtensions: .wm, .wmt, .tml, .tmpl, .wmm ContextAutoLoaders.ContextTools: org.webmacro.broker.DefaultContextAutoLoader ContextAutoLoaders.WebContextTools: org.webmacro.broker.DefaultContextAutoLoader # The following are tools which are added to your WebContext. You can # customize your WebContext with special tools of your own by adding # them to this list of classes. The only requirement is that the class # be public, and have a public default constructor. The instance will # be shared betwen all instantiations of WebContext, so beware of # thread issues. If it implements the Macro interface it can gain # access to a copy of the Webcontext at runtime. The object will # appear in your WebContext as a variable named after its class, # minus the word "Tool" if it appears. So CGITool below becomes # the variable $CGI in your Template. # # The CGITool adds a $CGI variable with subproperties named after # the familiar CGI variable names, such as $CGI.QUERY_STRING, etc. # # The FormTool adds a $Form variable to your context, with subproperties # named after the available Form fieldnames. eg: $Form.Name would # return the value of HttpServletRequest.getParameterValues("Name")[0] # The FormList tool is similar, but returns the Form value as an array # rather than as a single entry (and is $FormList in the template). # # CookieTool creates a $Cookie variable which can be used to get and # set cookies by name. For example, $Cookie.Password # # SessionTool creates a $Session variable that resovles to the # HttpSession of the current request. WebContextTools: WebContextTools.CGI: org.webmacro.servlet.CGITool WebContextTools.Form: org.webmacro.servlet.FormTool WebContextTools.FormList: org.webmacro.servlet.FormListTool WebContextTools.Cookie: org.webmacro.servlet.CookieTool WebContextTools.Response: org.webmacro.servlet.ResponseTool WebContextTools.Request: org.webmacro.servlet.RequestTool WebContextTools.Session: org.webmacro.servlet.SessionTool ContextTools: ContextTools.Math: org.webmacro.servlet.MathTool ContextTools.Text: org.webmacro.servlet.TextTool ContextTools.Type: org.webmacro.servlet.TypeTool ContextTools.Variable: org.webmacro.servlet.VariableTool ContextTools.List: org.webmacro.servlet.ListTool # The following are the parsers available to WebMacro. The parser # which answers to "wm" will be used for most things, but you can # invoke a different parser by way of the #use directive, if it has # been included. These parsers all implement org.webmacro.engine.Parser Parsers: Parsers.wm: org.webmacro.parser.WMParser # # FastWriter Configuration # # Misconfiguration of these settings can cause severe performance # and resource penalties FastWriter.DefaultBufferSize = 4096 # # Template caching # CachingProvider.template.CacheManager: org.webmacro.resource.ReloadingCacheManager CachingProvider.url.CacheManager: org.webmacro.resource.ReloadingCacheManager #CachingProvider.template.CacheManager: org.webmacro.resource.GenerationalCacheManager #CachingProvider.url.CacheManager: org.webmacro.resource.GenerationalCacheManager # # Encoding caching # Encoder.*.CacheManager: org.webmacro.resource.SimpleCacheManager #Encoder.*.CacheManager: org.webmacro.resource.GenerationalCacheManager PropertyOperator.CacheManager: org.webmacro.resource.SimpleCacheManager # ReloadingCacheManager properties (if used) # - An ExpireTime of 0 (zero) means WebMacro will never cache the resource # - A positive ExpireTime means WebMacro will re-fetch the resource every # X milliseconds (ie, 10000 is 10 seconds) # - A negative ExpireTime means WebMacro will only re-fetch resources # when they change. ReloadingCacheManager.*.ExpireTime: 30000 ReloadingCacheManager.*.ReloadOnChange: true # Advanced properties: ReloadingCacheManager.*.UseSoftReferences: TRUE # CheckForReloadDelay sets, how often a cached template should # be checked for reload at maximum. 0 (which is the default) means # to check on every request. Positive values stand for a period # of time in milliseconds. Templates are only checked once in this # interval. # 60 seconds for templates requested via http #CheckForReloadDelay.http=60000 # 10 seconds for normal file templates #CheckForReloadDelay.file=10000 # GenerationalCacheManager properties (if used) # Set reloading to true since we are in development mode by default. GenerationalCacheManager.*.ReloadOnChange: true # The refresh rate for incorporating changes to the mutable image GenerationalCacheManager.*.RefreshRate: 1000 # Classes that are restricted for use in templates RestrictedClasses=java.lang.Class # Methods of the Class class that are allowed in templates RestrictedClasses.AllowedMethods.java.lang.Class=\ getName,isArray,isPrimitive,isAssignableFrom,isInstance # Where does the servlet broker look for templates? Default is the servlet # root, but you could put WEB-INF/templates here. Servlet22Broker.TemplateLocation= # Default settings for DelegatingTemplateProvider # First some template loaders TemplateLoader.default=org.webmacro.resource.FileTemplateLoader TemplateLoader.file=org.webmacro.resource.FileTemplateLoader TemplateLoader.classpath=org.webmacro.resource.ClassPathTemplateLoader TemplateLoader.broker=org.webmacro.resource.BrokerTemplateLoader TemplateLoader.webapp=org.webmacro.resource.ServletContextTemplateLoader # This makes WM backwards compatible to old TemplatePath setting DelegatingTemplateProvider.EmulateTemplatePath: true # and a template loader factory TemplateLoaderFactory=org.webmacro.resource.DefaultTemplateLoaderFactory # To use it, uncomment the following settings #Providers.template: org.webmacro.resource.DelegatingTemplateProvider #TemplateLoaderPath.1=broker: # Define global "functions" which are available to every template # Example: # Functions.myFunc=org.webmacro.SomeClass.myFunkyMethod # If the class is not static, use # Function.myFunc.type=instance # You can even pass arguments to the constructor, like # Function.myFunc.args=[1, "two", [3, 4]] # [Probably not useful, but kind of cool. :} ] Functions.HTMLEscape=org.webmacro.util.HTMLEscaper.escape Functions.URLEncode=org.webmacro.servlet.TextTool.URLEncode Functions.URLDecode=org.webmacro.servlet.TextTool.URLDecode Functions.toList=org.webmacro.servlet.ListUtil.toList Functions.toBoolean=org.webmacro.util.CastUtil.toBoolean Functions.toByte=org.webmacro.util.CastUtil.toByte Functions.toChar=org.webmacro.util.CastUtil.toChar Functions.toDouble=org.webmacro.util.CastUtil.toDouble Functions.toFloat=org.webmacro.util.CastUtil.toFloat Functions.toInt=org.webmacro.util.CastUtil.toInt Functions.toLong=org.webmacro.util.CastUtil.toLong Functions.toShort=org.webmacro.util.CastUtil.toShort Functions.mod=org.webmacro.servlet.MathTool.mod Functions.min=org.webmacro.servlet.MathTool.min Functions.max=org.webmacro.servlet.MathTool.max Functions.pow=org.webmacro.servlet.MathTool.pow Functions.abs=org.webmacro.servlet.MathTool.abs Functions.replace=org.webmacro.servlet.TextTool.replace Functions.split=org.webmacro.servlet.TextTool.split Functions.join=org.webmacro.servlet.TextTool.join Functions.eval=org.webmacro.util.Eval.eval --- NEW FILE: WebMacro.defaults.minimal --- # DO NOT EDIT THIS FILE -- Edit WebMacro.properties instead! # # This file contains the DEFAULT values for WebMacro MINIMAL. # You can set the actual live values in WebMacro.properties and that will # override the settings in this file. This file also contains examples # of how to set properties, which may be commented out. # # You can override any setting in this file by setting it # in WebMacro.properties. You can remove properties that are set in this # file by setting them to a null value in WebMacro.properties. # # Search order for properties is: # default properties file (WebMacro.defaults) # application properties file (WebMacro.properties or other) # servlet context arguments (2.2 and later, prefixed with org.webmacro) # system properties (prefixed with org.webmacro) ########################################################### # # BASIC CONFIGURATION: # # Character encoding. This is ONLY the encoding that is used to # parse templates. It does not determine the encoding that is # returned to the browser. WebMacro will translate templates from # this encoding to whatever encoding the browser requests. See # the FastWriter class to learn how to control output encoding. TemplateEncoding: UTF-8 TemplateOutputEncoding: UTF-8 # # Logging # # A whitespace separated list of org.webmacro.util.LogTarget # implementations that should should receive your log output. # # WebMacro comes with a default target, LogFile, which logs # to stderr (or a file if the LogFile setting is set, see below). # You can easily create your own implementations that log to your # custom logging system or to Log4J or whatever. LogTargets: org.webmacro.util.LogFile # LogLevel can be: ALL, DEBUG, INFO, NOTICE, WARNING, ERROR, or NONE # in order of most information to least information displayed. # The top level "LogLevel" setting controls the default log level # for any log. You can set specific levels for individual log types # by declaring a value for LogLevel.type. WebMacro itself has the # following types of log messages: # # log the log system itself # wm high level WebMacro behavior # servlet the servlet framework # resource things that load other things (eg: TemplateProvider) # context setting and evaluating properties in a context # engine messages about parsing and executing a tempalte # # There may be more types than that in your system, you can learn # what they are by setting the log level for "log" to INFO. LogLevel: NOTICE #LogLevel.log: NOTICE #LogLevel.wm: NOTICE #LogLevel.servlet: NOTICE #LogLevel.resource: NOTICE #LogLevel.context: NOTICE #LogLevel.webcon: NOTICE #LogLevel.engine: NOTICE #LogLevel.directive: NOTICE #LogLevel.parser: NOTICE # LogTraceExceptions causes exception stack traces to be included in the log, # this causes exceptions to be verbose, but may point out the exact line # or method which is causing a fault. LogTraceExceptions: TRUE LogUsingServletLog: TRUE # the following 2 options are used by the org.webmacro.util.LogFile # log target. They do NOT specify system-wide logging options! # # Log format strings. This is a format string to be passed to MessageFormat. # If no format string is specified (the default, since the line below is # commented out), the string "{0,time}\t{1}\t{2}\t{3}" will be used if logging # to a file or to standard error, ,and the string "WebMacro:{1}\t{2}\t{3}" # will be used if logging to the servlet container log (if LogUsingServletLog # is true.) #LogFormat: {0,time}\t{1}\t{2}\t{3} # Use the following to log to a file rather than stderr. If your # standard error writes to a useful log already, you don't need this, # but many servlet runners simply eat standard error. #LogFile: /path/to/log/file # # Error Handling # # Set the template (relative to TemplateDirectory) used for errors. You # can edit this template to customize the way script failures appear # # This template is used by WMServlet, but you can use it for your own # servlets too. ErrorTemplate: error.wm ErrorVariable: error # Set the default ExceptionHandler, which gets control when an evaluation # exception is encountered. ExceptionHandler: org.webmacro.engine.DefaultEvaluationExceptionHandler ########################################################### # # ADVANCED CONFIGURATION # # Don't change these values unless you know what you're doing. They # allow you to fine-tune, extend, and customize WebMacro's behavior. # # Relaxed Directive Building. # # If set to true, text blocks produced by tools such as DreamWeaver # and other html editors will not choke the parse/build phase # when they introduce strings with a preceding # such as # #ffffff, #BeginDirective and #Comment. By default the property is # set to false. Therefore, WebMacro will fail fast on this type of text. RelaxedDirectiveBuilding: False # ResourceProviders are pluggable modules that are used to load # important data and code. You can create your own ResourceProviders # to add new modules to WebMacro, or replace existing modules. # They are all implementations of org.webmacro.broker.ResourceProvider Providers: Providers.template: org.webmacro.resource.TemplateProvider Providers.url: org.webmacro.resource.UrlProvider Providers.config: org.webmacro.resource.ConfigProvider Providers.directive: org.webmacro.directive.DirectiveProvider Providers.parser: org.webmacro.engine.ParserProvider Providers.encoder: org.webmacro.util.EncoderProvider # # Directives # # The DirectiveProvider uses these entries to load directives for the parser. # If you want to remove any of these, simply override the value of # Directive.xxx in your .properties file with an empty value. # You can add new directives by creating Directives.xxx values in your # Properties file, and you can also override the Directives property to # specify a list of directive classes. # Directives implement org.webmacro.directive.Directive # Directives: Directives.attribute: org.webmacro.directive.AttributeDirective Directives.const: org.webmacro.directive.AttributeDirective Directives.include: org.webmacro.directive.IncludeDirective Directives.parse: org.webmacro.directive.IncludeDirective Directives.set: org.webmacro.directive.SetDirective Directives.setblock: org.webmacro.directive.SetblockDirective Directives.macro: org.webmacro.directive.MacroDirective Directives.if: org.webmacro.directive.IfDirective Directives.text: org.webmacro.directive.TextDirective Directives.comment: org.webmacro.directive.CommentDirective Directives.foreach: org.webmacro.directive.ForeachDirective Directives.alternate: org.webmacro.directive.AlternateDirective Directives.param: org.webmacro.directive.ParamDirective Directives.type: org.webmacro.directive.TypeDirective 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 # # Directive Configuration # # # Should the #type directive be enabled? By default, yes it is. # When moving to a production environment, you should set this # to "false", so as not to incur the overhead of #type type.Enabled = true # # Configuration for #include and #parse # # NOTE: #parse has been deprecated. It is included for backwards # compatibility only. You should instead use: # #include as template "template.wm" # # # TemplateExtensions - a list of (comma-separated) file extensions # that are assumed to be templates when # #include is used without qualifing the # file type. By convention wmm is for WM macro library files. include.TemplateExtensions: .wm, .wmt, .tml, .tmpl, .wmm parse.TemplateExtensions: .wm, .wmt, .tml, .tmpl, .wmm # There are no web or context tools in the minimal version. You supply your own context tool fault handler: ContextAutoLoaders.ContextTools: ContextAutoLoaders.WebContextTools: Parsers: Parsers.wm: org.webmacro.parser.WMParser # # FastWriter Configuration # # Misconfiguration of these settings can cause severe performance # and resource penalties FastWriter.DefaultBufferSize = 4096 # # Template caching # CachingProvider.template.CacheManager: org.webmacro.resource.ReloadingCacheManager CachingProvider.url.CacheManager: org.webmacro.resource.ReloadingCacheManager # # Encoding caching # Encoder.*.CacheManager: org.webmacro.resource.SimpleCacheManager PropertyOperator.CacheManager: org.webmacro.resource.SimpleCacheManager # ReloadingCacheManager properties (if used) # - An ExpireTime of 0 (zero) means WebMacro will never cache the resource # - A positive ExpireTime means WebMacro will re-fetch the resource every # X milliseconds (ie, 10000 is 10 seconds) # - A negative ExpireTime means WebMacro will only re-fetch resources # when they change. ReloadingCacheManager.*.ExpireTime: 30000 ReloadingCacheManager.*.ReloadOnChange: true # Advanced properties: ReloadingCacheManager.*.UseSoftReferences: TRUE # CheckForReloadDelay sets, how often a cached template should # be checked for reload at maximum. 0 (which is the default) means # to check on every request. Positive values stand for a period # of time in milliseconds. Templates are only checked once in this # interval. # 60 seconds for templates requested via http #CheckForReloadDelay.http=60000 # 10 seconds for normal file templates #CheckForReloadDelay.file=10000 # Classes that are restricted for use in templates RestrictedClasses=java.lang.Class # Methods of the Class class that are allowed in templates RestrictedClasses.AllowedMethods.java.lang.Class=\ getName,isArray,isPrimitive,isAssignableFrom,isInstance # Where does the servlet broker look for templates? Default is the servlet # root, but you could put WEB-INF/templates here. Servlet22Broker.TemplateLocation= # Default settings for DelegatingTemplateProvider # First some template loaders TemplateLoader.default=org.webmacro.resource.FileTemplateLoader TemplateLoader.file=org.webmacro.resource.FileTemplateLoader TemplateLoader.classpath=org.webmacro.resource.ClassPathTemplateLoader TemplateLoader.broker=org.webmacro.resource.BrokerTemplateLoader TemplateLoader.webapp=org.webmacro.resource.ServletContextTemplateLoader # This makes WM backwards compatible to old TemplatePath setting DelegatingTemplateProvider.EmulateTemplatePath: true # and a template loader factory TemplateLoaderFactory=org.webmacro.resource.DefaultTemplateLoaderFactory # To use it, uncomment the following settings #Providers.template: org.webmacro.resource.DelegatingTemplateProvider #TemplateLoaderPath.1=broker: # Define global "functions" which are available to every template # Example: # Functions.myFunc=org.webmacro.SomeClass.myFunkyMethod # If the class is not static, use # Function.myFunc.type=instance # You can even pass arguments to the constructor, like # Function.myFunc.args=[1, "two", [3, 4]] # [Probably not useful, but kind of cool. :} ] Functions.HTMLEscape=org.webmacro.util.HTMLEscaper.escape Functions.URLEncode=org.webmacro.servlet.TextTool.URLEncode Functions.URLDecode=org.webmacro.servlet.TextTool.URLDecode Functions.toList=org.webmacro.servlet.ListUtil.toList Functions.toBoolean=org.webmacro.util.CastUtil.toBoolean Functions.toByte=org.webmacro.util.CastUtil.toByte Functions.toChar=org.webmacro.util.CastUtil.toChar Functions.toDouble=org.webmacro.util.CastUtil.toDouble Functions.toFloat=org.webmacro.util.CastUtil.toFloat Functions.toInt=org.webmacro.util.CastUtil.toInt Functions.toLong=org.webmacro.util.CastUtil.toLong Functions.toShort=org.webmacro.util.CastUtil.toShort Functions.mod=org.webmacro.servlet.MathTool.mod Functions.min=org.webmacro.servlet.MathTool.min Functions.max=org.webmacro.servlet.MathTool.max Functions.pow=org.webmacro.servlet.MathTool.pow Functions.abs=org.webmacro.servlet.MathTool.abs Functions.replace=org.webmacro.servlet.TextTool.replace Functions.split=org.webmacro.servlet.TextTool.split Functions.join=org.webmacro.servlet.TextTool.join Functions.eval=org.webmacro.util.Eval.eval |
From: <ke...@us...> - 2003-08-08 22:32:37
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/parser In directory sc8-pr-cvs1:/tmp/cvs-serv17275 Modified Files: ParserBlockBuilder.java Log Message: Work-around for parser problem with explicit begin followed by a directive. Eg, #if ($x) #begin #set $y=0 #end Index: ParserBlockBuilder.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/parser/ParserBlockBuilder.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ParserBlockBuilder.java 12 Jun 2003 00:47:46 -0000 1.11 --- ParserBlockBuilder.java 8 Aug 2003 22:32:33 -0000 1.12 *************** *** 226,230 **** { Object o = elementAt(size() - 1); ! if (!(o instanceof String)) return true; else --- 226,237 ---- { Object o = elementAt(size() - 1); ! ! // NOTE: the test for a zero length string in the following 'if' is ! // a work-around for a bug parsing an explicit #begin followed ! // immediately by another directive, eg, ! // #if ($x) #begin #set $y=0 #end ! // This can be removed when/if this bug is fixed ! // Keats 8-Aug-2003 ! if (!(o instanceof String) || (((String)o).length() == 0)) return true; else |
From: <lan...@us...> - 2003-08-03 21:37:09
|
Update of /cvsroot/webmacro/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv22502 Modified Files: build.xml Log Message: Final updates allowing for both classic and minimal build styles. Index: build.xml =================================================================== RCS file: /cvsroot/webmacro/webmacro/build.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** build.xml 3 Aug 2003 21:01:48 -0000 1.35 --- build.xml 3 Aug 2003 21:37:06 -0000 1.36 *************** *** 44,48 **** <property name="version" value="2.0b1" /> ! <property name="wm-style" value="classic" /> <!-- can be .minimal to get webmacro.defaults.minimal --> <property name="app.name" value="webmacro" /> <property name="tmpdir" value="tmp" /> --- 44,48 ---- <property name="version" value="2.0b1" /> ! <property name="wm-style" value="classic" /> <!-- can be "minimal" to get webmacro.defaults.minimal into build--> <property name="app.name" value="webmacro" /> <property name="tmpdir" value="tmp" /> *************** *** 126,131 **** <copy todir="${classes}"> <fileset dir="${tmpdir}" includes="**/*.properties" /> - <fileset dir="." includes="WebMacro.defaults.${wm-type}"/> </copy> <touch file="${classes}/WM-VERSION-${version}" /> </target> --- 126,132 ---- <copy todir="${classes}"> <fileset dir="${tmpdir}" includes="**/*.properties" /> </copy> + <copy file="webmacro.defaults.${wm-style}" tofile="${classes}/WebMacro.defaults"/> + <touch file="${classes}/WM-VERSION-${version}" /> </target> *************** *** 204,208 **** <fileset dir="distroot" /> </copy> ! <copy file='WebMacro.defaults' todir='${dist.source}' /> <copy file='build.xml' todir='${dist.source}' /> --- 205,209 ---- <fileset dir="distroot" /> </copy> ! <copy file='WebMacro.defaults.${wm-style}' todir='${dist.source}' /> <copy file='build.xml' todir='${dist.source}' /> |
From: <lan...@us...> - 2003-08-03 21:37:09
|
Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template In directory sc8-pr-cvs1:/tmp/cvs-serv22502/test/unit/org/webmacro/template Modified Files: TestContextToolAccess.java Log Message: Final updates allowing for both classic and minimal build styles. Index: TestContextToolAccess.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestContextToolAccess.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestContextToolAccess.java 16 Jul 2003 10:49:54 -0000 1.2 --- TestContextToolAccess.java 3 Aug 2003 21:37:06 -0000 1.3 *************** *** 8,11 **** --- 8,12 ---- /** + * Note: Tests in this class must allow for the tool not to be loaded. * @author Marc Palmer (<a href="mailto:wj...@wa...">wj...@wa...</a>) */ *************** *** 20,24 **** public void testContextToolMethodCall() { ! assertStringTemplateEquals("$Text.HTMLEncode('&')", "&"); } --- 21,25 ---- public void testContextToolMethodCall() { ! assertStringTemplateEquals("#if ($Text) {$Text.HTMLEncode('&')} #else {&}", "&"); } |
From: <lan...@us...> - 2003-08-03 21:01:51
|
Update of /cvsroot/webmacro/webmacro/src-optional/org/opendoors/util In directory sc8-pr-cvs1:/tmp/cvs-serv16489/src-optional/org/opendoors/util Added Files: PostponeObservable.java Timer.java Log Message: doc improvements; moved sources to src-optional; implemented build policy: build with webmacro.defaults.classic but with a property switch be able to build with webmacro.defaults.minimal --- NEW FILE: PostponeObservable.java --- /* * Copyright Open Doors Software and Acctiva, 1996-2001. * All rights reserved. * * Software is provided according to the MPL license. * Open Doors Software and Acctiva provide this * software on an as-is basis and make no representation as * to fitness for a specific purpose. * * Direct all questions and comments to su...@op... */ package org.opendoors.util; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.Observable; import java.util.Observer; /** * PostponeObservable is the delegated instance for an observable * with the following characteristic: notification of the change arrives * after the observable has not changed for a period of n milliseconds. * <p> * This pattern solves a fundamental problem, namely thrashing. Thrashing * occurs when the same action occurs repeatedly over short periods of * time because the same event is fired, usually hundreds or thousand of * times per second. * <p> * So, for example, if a cache changes thousands of times per second during * a load or a transition to a new working set, how many times do you want * to refresh it? Once or a thousand times? An instance of PostponeObservable * allows your cache (or any changing object) to notify that it has changed * just once. * <p> * Thus, changes are deferred so that the observers * of the changes are not inundated with notifications. * <p> * Since this class implements the PropertyChangeListener interface, the class * PropertyChangeSupport may also be employed as well to notify * observers of changes. * <p> * This class is extends java.util.Observable. Observers must implement the * interface java.util.Observer. * <p><b>Note:</b> Shared instances of a PostponeObservable must implement their * own synchronizing strategy. * <p>Postponeability may be enabled/disabled at runtime. * @see java.util.Observable * @see java.util.Observer */ public class PostponeObservable extends Observable implements PropertyChangeListener { //-------public members----- /** * On property change, postpone event notification this number of millis. */ protected int postponeInterval = 120000; //2 minutes /** * While waiting to fire a notification, * reset the interval if another change comes in. */ protected boolean resetClockOnUpdate = true; //-------private and protected members----- private long timeToNotify = System.currentTimeMillis(); private Timer tick = null; //-------constructor(s)----- /** * Constructs a default observable. */ public PostponeObservable () { init(); } /** * Constructs a default observable with the following settings. * @param The interval to wait in millis between notifications. * @param Resets the clock so that changes can be aggregated * over a period of time */ public PostponeObservable (int postponeInterval, boolean resetClockOnUpdate) { this.postponeInterval = postponeInterval; this.resetClockOnUpdate = resetClockOnUpdate; init(); } /** Initializes the instance. */ protected void init () { tick = new Timer("PropertyObservable", postponeInterval, false); tick.addObserver(new TimerObserver()); } //-------public initializers/destroyers----- /** Sets the observable period. */ public void setPostponePeriod (int postponeInterval) { this.postponeInterval = postponeInterval; tick.setPeriod(postponeInterval); } /** Enables postponeability if true. */ public void enablePostponeability (boolean enable) { this.resetClockOnUpdate = enable; } //-------public event handlers----- /** * Using the property event model * propagate a change event to the observable. * @param evt The property change event which can be null. */ public void propertyChange (PropertyChangeEvent evt) { setChanged(); } /** * Call back from the timer when * the observation period has expired. */ public void timerAction () { if (hasChanged() && (timeToNotify < System.currentTimeMillis())) { notifyObservers(); } } /** * Signals that the observable has changed. * <p> * Observers will be * notified when * <pre> * current time > (time of last change + postponeInterval) * </pre> * provided postponeability is enabled. */ public void setChanged () { super.setChanged(); if (resetClockOnUpdate) { timeToNotify = (System.currentTimeMillis() + postponeInterval); } } /** Destoys this instance and the associated timer. */ public void destroy () { tick.stop(); tick = null; } /** * Class which listens to updates in the observable tick and calls * the timer notifiction method. */ class TimerObserver implements Observer { public void update (Observable o, Object arg) { timerAction(); } } } --- NEW FILE: Timer.java --- /* * Copyright Open Doors Software and Acctiva, 1996-2001. * All rights reserved. * * Software is provided according to the MPL license. * Open Doors Software and Acctiva provide this * software on an as-is basis and make no representation as * to fitness for a specific purpose. * * Direct all questions and comments to su...@op... */ package org.opendoors.util; import java.io.Serializable; import java.util.Observable; /** * This class provides timer and supporting events to client objects * by extending the Observable base class. Clients get notifications * of changes in the clock. * <p> * The interval for firing changes to observers is resetable in the event * the observer needs more frequent updates of changes. * <p> * The instance may be a one shot timer as well as a recurring timers. This * supports a one shot notification in the future. * <p> * Observable is thread-safe and supports multiple listeners to a single * observable such as an observable which fires every 24 hours. */ public class Timer extends Observable implements Runnable, Serializable { /** The timer thread. */ private transient Thread timerThread; /** Signal to stop the thread. */ private transient boolean stopThread = false; /** The name. */ private String name; /** The interval for firing. */ private int period; // in milliseconds /** Is a one shot timer. */ private boolean oneShot; /** * Public constructor to create a timer event source using factory defaults * which are 1 second timer, recurring. */ public Timer () { this("PerSecondTimer", 1000, false); } /** * Construct a timer with the certain properties set. * @param The name of the timer. * @param The period in milliseconds. * @param True if this is a oneShot instance */ public Timer (String name, int period, boolean oneShot) { super(); // Set properties this.name = name; this.period = period; this.oneShot = oneShot; // Create the clock thread timerThread = new Thread(this, name); timerThread.setDaemon(true); timerThread.start(); } /** * Stop the timer */ public void stop () { stopThread = true; } // Accessor methods /** * Gets the name of the timer. * @return The timer name. */ public String getName () { return name; } /** * Sets the name of the timer. * @param The textual name. */ public void setName (String n) { name = n; } /** * Gets the period between timer events. * @return The interval in milliseconds */ public int getPeriod () { return period; } /** * Sets the period in milliseconds. * @param The interval. */ public void setPeriod (int p) { period = p; if (timerThread != null) timerThread.interrupt(); } /** * Interrogates if this is a one-shot operation. * @return True, if a one-shot operation. */ public boolean isOneShot () { return oneShot; } /** * Set this object to be one-shot or not. * @param True, if one-shot operation desired */ public void setOneShot (boolean os) { oneShot = os; } /** * Run the timer. */ public void run () { while (timerThread != null) { // Sleep for the period try { timerThread.sleep(period); } catch (InterruptedException e) { // Restart the loop continue; } // Fire an action event setChanged(); notifyObservers(); if (oneShot || stopThread) break; } // clean up: timerThread = null; } } |
Update of /cvsroot/webmacro/webmacro/src-optional/org/opendoors/cache/immutable In directory sc8-pr-cvs1:/tmp/cvs-serv16489/src-optional/org/opendoors/cache/immutable Added Files: CacheFactory.java CacheImpl.java ChangeControl.java Depopulate.java Populate.java Log Message: doc improvements; moved sources to src-optional; implemented build policy: build with webmacro.defaults.classic but with a property switch be able to build with webmacro.defaults.minimal --- NEW FILE: CacheFactory.java --- /* * Copyright Open Doors Software and Acctiva, 1996-2001. * All rights reserved. * * Software is provided according to the MPL license. * Open Doors Software and Acctiva provide this * software on an as-is basis and make no representation as * to fitness for a specific purpose. * * Direct all questions and comments to su...@op... */ package org.opendoors.cache.immutable; import org.opendoors.cache.UpdateableCache; import java.util.Map; import java.util.Properties; /** * CacheFactory provides static and instance-specific * methods for the creation of an immutable cache. * <p> * The preferred method of using this * cache is to create an instance of it and * specify the property values for the creation * of usually several caches over the life-cycle * of an application. * <p> * create(), create(Map) and destroyCache(UpdateableCache) * are the static methods available using the default * properties. * @see org.opendoors.cache */ public class CacheFactory { /** The optional subclass controlling the cache. */ Class changeControlSubClass; /** * The factory provided refresh rate for the cache. * <p> * If the cache is out of date and idle this * amount of time in millis, it will be updated. */ int refreshRate = 1000; /** * Creates an instance of a cache factory with * text property options to control the * behavior the factory. * <p> * Use these options to customize, in other words, * the kind of caches the instance this factory * produces. The properties names, values and defaults: * <pre> * ChangeControl=Subclass.impl.of.ChangeControl * default: org.opendoors.cache.imple.ChangeControl * usage: certain cache implementors will subclass ChangeControl * to provide more granular control over the regeneration * of the immutable image of the cache. * * RefreshRate=NumberOfMilliseconds * default: 2500 milliseconds * usage: the amount of time between updates provided * the cache is idle at least this amount of time. * </pre> * @param properties If null, the above defaults will be used, * else the elements of the properties will be employed. */ public CacheFactory (Properties properties) { this(properties, null); } /** * This constructor allows you to * present factory defaults different than * those provided by VFC. */ public CacheFactory (Properties properties, Properties defaults) { String prop = getValue(properties, defaults, "ChangeControl"); if (prop != null) { try { changeControlSubClass = Class.forName(prop); } catch (Exception e) { e.printStackTrace(System.out); } } prop = getValue(properties, defaults, "RefreshRate"); if (prop != null) { refreshRate = Integer.parseInt(prop); } } /** * Initializes a cache and returns it according to the factory * properties. */ public UpdateableCache initialize (Map preload) { return new CacheImpl(preload, changeControlSubClass, refreshRate); } /** * A factory static method to provide an * empty updateable cache. */ public static UpdateableCache create () { CacheFactory f = new CacheFactory(null, null); return f.initialize(null); } /** * A factory static method to provide an * updateable cache preloaded */ public static UpdateableCache create (Map map) { CacheFactory f = new CacheFactory(null, null); return f.initialize(map); } /** A static factory method to destroy a cache. */ public static void destroyCache (UpdateableCache cache) { ((CacheImpl) cache).destroy(); } /** Destroys the instance of the cache created by the factory. */ public void destroy (UpdateableCache cache) { ((CacheImpl) cache).destroy(); } /** Get property values for the constructor. */ private String getValue (Properties values, Properties defaults, String name) { String value = null; if (values != null) value = values.getProperty(name); if (value == null && defaults != null) value = defaults.getProperty(name); return value; } } --- NEW FILE: CacheImpl.java --- /* * Copyright Open Doors Software and Acctiva, 1996-2001. * All rights reserved. * * Software is provided according to the MPL license. * Open Doors Software and Acctiva provide this * software on an as-is basis and make no representation as * to fitness for a specific purpose. * * Direct all questions and comments to su...@op... */ package org.opendoors.cache.immutable; import org.opendoors.cache.UpdateableCache; import java.util.HashMap; import java.util.Map; /** * Implements the updateable cache interface according * to the immutable / mutable * cache strategy of VFC. */ public class CacheImpl implements UpdateableCache { /** * The immutable cache with a volatile reference * so that its reference is cached in local memory. */ volatile HashMap immutable; /** The mutable cache used for updates. */ volatile HashMap mutable; /** The change control agent. */ ChangeControl changeControl; /** The change control mutex. */ Object changeControlMutex; /** The array containing the metrics. */ private long[] metrics = {0, 0, 0, 0}; /** The total number of accesses to the cache. */ public final static int AccessCount = 0; /** The total number of access hits to the immutable cache */ public final static int ImmutableHitCount = 1; /** The total number of access hits to the mutable cache. */ public final static int MutableHitCount = 2; /** The total number of access faults returning null. */ public final static int AccessFaultCount = 3; /** * Constructs and preloads the cache * and if there is a subclass of ChangeControl * it is to be used instead of the default * base class. * @param preload A map to place into the cache and it * may be null. * @param changeControlClass The class which implements change * control and this may be null in which case VFC provides * the change control mechanics. * @param refreshRate the period of time between generational * updates provided the cache is idle during the refresh period. */ CacheImpl (Map preload, Class changeControlClass, int refreshRate) { int load = 500; if (preload != null) load = preload.size() * 2; immutable = new HashMap(load, (float) 0.5); mutable = new HashMap(load, (float) 0.5); if (preload != null) { immutable.putAll(preload); mutable.putAll(preload); } if (changeControlClass == null) { changeControl = new ChangeControl(); } else { try { changeControl = (ChangeControl) changeControlClass.newInstance(); } catch (Exception e) { e.printStackTrace(System.err); changeControl = new ChangeControl(); } } changeControlMutex = changeControl.setCacheImpl(this, refreshRate); } // the interface implementations /** * Gets a value from the immutable cache. * <p> * Note: this implementation will also * search the mutable cache if the element * is not found in the mutable cache. * @param argument The key to the element in the cache. */ public Object get (Object argument) { HashMap h; synchronized (immutable) { h = immutable; } Object o = h.get(argument); if (o == null) { synchronized (changeControlMutex) { o = mutable.get(argument); } } return o; } /** * Uncomment out this method and comment the above * get to enable performance metrics on the public * variables. */ /* public Object get(Object argument) { metrics[AccessCount]++; HashMap h; synchronized (immutable) { h = immutable; } Object o = h.get(argument); if (o == null) { synchronized (changeControlMutex) { o = mutable.get(argument); if (o == null) {metrics[AccessFaultCount]++;} else {metrics[MutableHitCount]++;} } } else { metrics[ImmutableHitCount]++; } return o; } */ /** * Returns the metrics in the following order: * <pre> * [0] The total number of gets, accesses. * [1] The number of accesses which resulted in a hit to the immutable cache. * [2] The number of accesses which resulted in a hit to the mutable cache. * [3] The number of accesses which resulted in a fault and a need to * regenerate the cache entry. * </pre> */ public long[] getMetrics () { return metrics; } /** Returns the elements in the cache as an array using the current image. */ public Object[] values () { Object[] values = null; synchronized (changeControlMutex) { values = mutable.values().toArray(); } return values; } /** Returns the keys of the cache as an array. */ public Object[] keys () { Object[] keys = null; synchronized (changeControlMutex) { keys = mutable.keySet().toArray(); } return keys; } /** * Invalidates an object in the cache by removing * it from the mutable cache. On the next * regeneration, this element will no longer be in the * cache. * @param argument The key to the element in the cache. */ public void invalidate (Object argument) { changeControl.invalidate(argument); } /** * Invalidates the entire cache. */ public void invalidateAll () { changeControl.invalidateAll(); } /** * Puts an object into the cache by * enqueueing it on the immutable cache using * the change control delegate. * @param argument The key to the element in the cache. * @param value The element to place into the cache. */ public void put (Object argument, Object value) { changeControl.put(argument, value); } // management methods /** Allows for the cache to be explicitly updated. */ public void update () { changeControl.update(null, null); } /** Destroys this instance allowing for speedy GC action. */ void destroy () { changeControl.destroy(); immutable = null; mutable = null; changeControl = null; changeControlMutex = null; } } --- NEW FILE: ChangeControl.java --- /* * Copyright Open Doors Software and Acctiva, 1996-2001. * All rights reserved. * * Software is provided according to the MPL license. * Open Doors Software and Acctiva provide this * software on an as-is basis and make no representation as * to fitness for a specific purpose. * * Direct all questions and comments to su...@op... */ package org.opendoors.cache.immutable; import org.opendoors.util.PostponeObservable; import java.util.HashMap; import java.util.Observable; import java.util.Observer; /** * Default behavior for managing * the mutable and immutable cache as implemented * by CacheImpl. * <p> * Advanced implementations of the Immutable/Mutable * strategy may elect to subclass this class * and provide fine grained * change control for a specific type of cache. * <p> * For example a cluster of file caches would * possibly require a change control manager which * would sweep from time to time a disk volume and * matching files in the cache which were out * of date would be replaced in the cache. This * kind of functionality can be performed as well * by a cache manager wrapping itself around the * cache interface. * <p> * This class delegates observability of the cache to * an instance of PostponeObservable. * In this manner, updates to the immutable * cache are postponed until a sufficient period * of idle activity has elapsed before changes are * propagate to the immutable image. * @see org.opendoors.util.PostponeObservable * @see org.opendoors.cache.Cache * @see org.opendoors.cache.UpdateableCache */ public class ChangeControl implements Observer { /** The actual cache under management. */ protected CacheImpl cache; /** * The thread delegate for managing changes. * By default, 5 seconds of inactivity must occur * before pending updates are propagated * and the immutable cache is upgraded. */ protected PostponeObservable observable; /** The synch mutex. */ protected Object actionMutex = new Object(); /** * The default constructor * which does nothing. */ public ChangeControl () { } /** * Sets up the cache for change control: the cache, the refresh * rate and returns the mutex. * @param cache The cache to manage. * @param refreshRate How often in millis to refresh the cache. * @return The mutex synchronizing updates. */ protected Object setCacheImpl (CacheImpl cache, int refreshRate) { this.cache = cache; observable = new PostponeObservable(refreshRate, true); observable.addObserver(this); return actionMutex; } /** * Schedules a removal of an element from the cache. */ void invalidate (Object argument) { synchronized (actionMutex) { cache.mutable.remove(argument); observable.propertyChange(null); } } /** * Schedules a removal of everything. */ void invalidateAll () { synchronized (actionMutex) { cache.mutable.clear(); observable.setChanged(); } } /** * Schedules a put to the queue. */ void put (Object argument, Object value) { synchronized (actionMutex) { cache.mutable.put(argument, value); observable.setChanged(); } } /** * Call back for changes pending to * be implemented. * <p> * Cache has been idle for at least n seconds. * <p> * This routine implements the generational update * such that the immutable becomes identical now * to the most current image in the mutable instance. */ public void update (Observable o, Object arg) { synchronized (actionMutex) { HashMap tmp = new HashMap(cache.mutable.size() * 2, (float) 0.5); tmp.putAll(cache.mutable); cache.immutable = tmp; //System.out.println("Cache Updated. Mutable Size=" + cache.mutable.size()); //System.out.println("Cache Updated. Size=" + cache.immutable.size()); } } /** * Destroys this instance making it inoperable. */ void destroy () { synchronized (actionMutex) { cache.mutable.clear(); cache.immutable.clear(); cache = null; } observable.destroy(); observable = null; actionMutex = null; } } --- NEW FILE: Depopulate.java --- /* * Copyright Open Doors Software and Acctiva, 1996-2001. * All rights reserved. * * Software is provided according to the MPL license. * Open Doors Software and Acctiva provide this * software on an as-is basis and make no representation as * to fitness for a specific purpose. * * Direct all questions and comments to su...@op... */ package org.opendoors.cache.immutable; import org.opendoors.cache.Cache; /** * Depopulates a shared cache from integer n up to m with Integer(n <= i < m). * <p> * Use as a driver to depopulate a cache. * @see Populate */ public class Depopulate implements Runnable { private Cache cache; int n, m; /** Construct the depopulator with test parameters. */ public Depopulate (Cache cache, int n, int m) { this.cache = cache; this.n = n; this.m = m; } /** Depopulates the cache according to the instance parameters. */ public void run () { for (int value = n; value < m; value++) { Integer i = new Integer(value); cache.invalidate(i); } } } --- NEW FILE: Populate.java --- /* * Copyright Open Doors Software and Acctiva, 1996-2001. * All rights reserved. * * Software is provided according to the MPL license. * Open Doors Software and Acctiva provide this * software on an as-is basis and make no representation as * to fitness for a specific purpose. * * Direct all questions and comments to su...@op... */ package org.opendoors.cache.immutable; import org.opendoors.cache.Cache; /** * Populates a shared cache from integer n up to m with Integer(n <= i < m). * <p> * Use as a test driver to populate a cache. * @see Depopulate */ public class Populate implements Runnable { private Cache cache; int n, m; public long tet; /** Construct the populator with test parameters. */ public Populate (Cache cache, int n, int m) { this.cache = cache; this.n = n; this.m = m; } /** Populates the cache according to the instance parameters. */ public void run () { tet = System.currentTimeMillis(); for (int value = n; value < m; value++) { Integer i = new Integer(value); cache.put(i, i); } tet = System.currentTimeMillis() - tet; } } |
From: <lan...@us...> - 2003-08-03 21:01:51
|
Update of /cvsroot/webmacro/webmacro/examples/advanced In directory sc8-pr-cvs1:/tmp/cvs-serv16489/examples/advanced Modified Files: index.html Log Message: doc improvements; moved sources to src-optional; implemented build policy: build with webmacro.defaults.classic but with a property switch be able to build with webmacro.defaults.minimal Index: index.html =================================================================== RCS file: /cvsroot/webmacro/webmacro/examples/advanced/index.html,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.html 3 Jul 2001 02:00:41 -0000 1.5 --- index.html 3 Aug 2003 21:01:48 -0000 1.6 *************** *** 29,79 **** view. In most web apps, views will be linked together as logical pages. <p> <hr size=1 width=50%> - <p> - - <a href=View.java>View.java</a> An interface definition which - represents the server-side equivalent of a webmacro "skin". - During template evaluation, an instance implementing this interface provides the core - lifecylce and state management methods. A convenient and globally unique identifier - can be passed around as an http get and post parameter. Views are often chained - together to produce wizards and multi-phased input models. State is always maintained - inside the View implementation members. - - <p> - <a href=ViewFactory.java>ViewFactory.java</a> Views are instantiated by factories which return an instance implementing the View interface. - - <p> - <a href=GeneralView.java>GeneralView.java</a> A view factory which supports multiple panels in a view. - - <p> - <a href=GeneralCommitView.java>GeneralCommitView.java</a> A view factory which adds a commit view panel as the last view. - - <p> - <a href=ReferralView.java>ReferralView.java</a> A concrete view containing two panels. The first allows for the panel - to create and manage a vector of elements. The second panel is for a single element. - The last panel is for a commit/confirmation of the views. This is an excellent example of how the subclass - has been relieved of all complexity in the view management. It is focused on the application elements - of the referred parties and the referring party. - - <p> - <a href=ViewActionHandler.java>ViewActionHandler.java</a> You must add to a view one or more action handlers. The general case. - - <p> - <a href=CommitActionHandler.java>CommitActionHandler.java</a> The base handler for the proverbial "OK. Do something with this input!" - - <p> - <a href=InsertInterimBOHandler.java>InsertInterimBOHandler.java</a> A commit handler which - assembles the view elements and creates a persistent business object, an InterimBusinessObject. These - objects are persisted as elements in a <a href=http://engineering.acctiva.org>Very Large Hashtable</a>. - - <p> - - <hr size=1 width=50%> - <p> - - These are specimens contributed by Lane Sharman. Others are more than welcome to add to this file - which is maintained as index.html in cvs under the examples directory. - <p> The examples are best viewed with a text editor, not a browser. <p> --- 29,35 ---- view. In most web apps, views will be linked together as logical pages. + <center> <p> <hr size=1 width=50%> The examples are best viewed with a text editor, not a browser. <p> *************** *** 82,86 **** <p> Other example resources: ! <p> <a href=http://wiki.webmacro.org/WebMacroScriptLanguage>Scripting</a> tutorial --- 38,42 ---- <p> Other example resources: ! </center> <p> <a href=http://wiki.webmacro.org/WebMacroScriptLanguage>Scripting</a> tutorial *************** *** 97,103 **** <p> ! <a href=http://engineering.acctiva.org/jldap>jldap</a> ! Practice at Open Doors Software for creating a java language for data acquistion and presentment for ! web applications we write. --- 53,59 ---- <p> ! <a href=http://www.wangjammers.com/ignition>Ignition</a> ! For a comprehensive web builder based on WebMacro. ! |
From: <lan...@us...> - 2003-08-03 21:01:51
|
Update of /cvsroot/webmacro/webmacro/src-optional/org/opendoors/cache In directory sc8-pr-cvs1:/tmp/cvs-serv16489/src-optional/org/opendoors/cache Added Files: Cache.java UpdateableCache.java Log Message: doc improvements; moved sources to src-optional; implemented build policy: build with webmacro.defaults.classic but with a property switch be able to build with webmacro.defaults.minimal --- NEW FILE: Cache.java --- /* * Copyright Open Doors Software and Acctiva, 1996-2001. * * Software is provided according to the MPL license. * Open Doors Software and Acctiva provide this * software on an as-is basis and make no representation as * to fitness for a specific purpose. * * Direct all questions and comments to su...@op... */ package org.opendoors.cache; /** * The base interface for every cache regardless of * implementation. * <p> * The interface supports the basic semantics of * a cache inluding accessor, mutator, and invalidation. * <p> * Specific factories and cache managers will provide * this interface or contain the interface to provide * caching services to applications. * @see UpdateableCache * @author Lane Sharman */ public interface Cache { /** * Invalidate an object in the cache according * to the update strategy. */ public void invalidate (Object key); /** * Invalidates all the objects in the cache in one shot. * <p> * The action is performed according to the update strategy * of the implementation. */ public void invalidateAll (); /** * Put an object in the cache possibly * updating and replacing an existing value. * <p> * Note: some implementations elect to defer * this operation so the element may not * be immediately present. */ public void put (Object key, Object value); /** * Gets a value from the cache. * <p> * Returning null reports that the element * cannot be found or regenerate with the key * provided. */ public Object get (Object key); /** * Returns all the values in the cache. */ public Object[] values (); /** * Returns all the keys in the cache. */ public Object[] keys (); } --- NEW FILE: UpdateableCache.java --- /* * Copyright Open Doors Software and Acctiva, 1996-2001. * * Software is provided according to the MPL license. * Open Doors Software and Acctiva provide this * software on an as-is basis and make no representation as * to fitness for a specific purpose. * * Direct all questions and comments to su...@op... */ package org.opendoors.cache; /** * Some cache implementations will * expose an explicit udpate method * allowing clients to perform * pending updates to the cache which * brings the cache up-to-date with * recent mutations to the cache. */ public interface UpdateableCache extends Cache { /** * Updates the cache. * <p> * Upon completion, the cache is up to date * w/respect to all pending updates. */ public void update (); } |
From: <lan...@us...> - 2003-08-03 21:01:50
|
Update of /cvsroot/webmacro/webmacro In directory sc8-pr-cvs1:/tmp/cvs-serv16489 Modified Files: build.xml Removed Files: WebMacro.defaults Log Message: doc improvements; moved sources to src-optional; implemented build policy: build with webmacro.defaults.classic but with a property switch be able to build with webmacro.defaults.minimal Index: build.xml =================================================================== RCS file: /cvsroot/webmacro/webmacro/build.xml,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** build.xml 12 Jun 2003 00:17:48 -0000 1.34 --- build.xml 3 Aug 2003 21:01:48 -0000 1.35 *************** *** 18,22 **** Remove all temporary files created during build process compile ! Compile all source files jar Create "webmacro.jar" --- 18,24 ---- Remove all temporary files created during build process compile ! Compile all principal source files ! compile-optional ! Compiles all optional source files jar Create "webmacro.jar" *************** *** 41,45 **** </target> ! <property name="version" value="1.1final" /> <property name="app.name" value="webmacro" /> <property name="tmpdir" value="tmp" /> --- 43,48 ---- </target> ! <property name="version" value="2.0b1" /> ! <property name="wm-style" value="classic" /> <!-- can be .minimal to get webmacro.defaults.minimal --> <property name="app.name" value="webmacro" /> <property name="tmpdir" value="tmp" /> *************** *** 123,136 **** <copy todir="${classes}"> <fileset dir="${tmpdir}" includes="**/*.properties" /> ! <fileset dir="." includes="WebMacro.defaults"/> </copy> <touch file="${classes}/WM-VERSION-${version}" /> </target> <target name="compile-examples" depends="compile"> <filter token="VERSION" value="${version}" /> <filter token="BUILD_DATE" value="${TODAY}" /> <javac srcdir="${examples}" destdir="${examples}/WEB-INF/classes" - excludes="**/advanced/*.java" debug="on" optimize="off" deprecation="off"> <classpath refid="class.path" /> --- 126,150 ---- <copy todir="${classes}"> <fileset dir="${tmpdir}" includes="**/*.properties" /> ! <fileset dir="." includes="WebMacro.defaults.${wm-type}"/> </copy> <touch file="${classes}/WM-VERSION-${version}" /> </target> + <target name="compile-optional" depends="compile"> + <filter token="VERSION" value="${version}" /> + <filter token="BUILD_DATE" value="${TODAY}" /> + <copy todir="${tmpdir}" filtering="true"> + <fileset dir="src-optional" /> + </copy> + <javac srcdir="${tmpdir}" destdir="${classes}" + debug="on" optimize="off" deprecation="off"> + <classpath refid="class.path" /> + </javac> + </target> + <target name="compile-examples" depends="compile"> <filter token="VERSION" value="${version}" /> <filter token="BUILD_DATE" value="${TODAY}" /> <javac srcdir="${examples}" destdir="${examples}/WEB-INF/classes" debug="on" optimize="off" deprecation="off"> <classpath refid="class.path" /> --- WebMacro.defaults DELETED --- |
From: <lan...@us...> - 2003-08-03 20:41:36
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/resource In directory sc8-pr-cvs1:/tmp/cvs-serv12735/src/org/webmacro/resource Removed Files: GenerationalCacheManager.java Log Message: moved to src-optional --- GenerationalCacheManager.java DELETED --- |
Update of /cvsroot/webmacro/webmacro/examples/advanced In directory sc8-pr-cvs1:/tmp/cvs-serv8970/examples/advanced Removed Files: CommitActionHandler.java GeneralCommitView.java GeneralView.java InsertInterimBOHandler.java ReferralView.java View.java ViewFactory.java Log Message: examples that do not compile --- CommitActionHandler.java DELETED --- --- GeneralCommitView.java DELETED --- --- GeneralView.java DELETED --- --- InsertInterimBOHandler.java DELETED --- --- ReferralView.java DELETED --- --- View.java DELETED --- --- ViewFactory.java DELETED --- |