Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 76850 invoked by uid 500); 26 Nov 2001 09:36:05 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 76835 invoked by uid 500); 26 Nov 2001 09:36:05 -0000 Delivered-To: apmail-xml-cocoon2-cvs@apache.org Date: 26 Nov 2001 09:19:51 -0000 Message-ID: <20011126091951.96386.qmail@icarus.apache.org> From: haul@apache.org To: xml-cocoon2-cvs@apache.org Subject: cvs commit: xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java sitemap.xsl X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N haul 01/11/26 01:19:51 Modified: webapp sitemap.xmap src/org/apache/cocoon/sitemap AbstractSitemap.java src/org/apache/cocoon/matching WildcardSessionAttributeMatcher.java src/org/apache/cocoon/matching/helpers WildcardHelper.java WildcardURIMatcher.java src/org/apache/cocoon/components/language/markup/sitemap/java sitemap.xsl Log: - Fixed stateful examples - WildcardSessionAttributeMatcher hasn't declared to implement configurable (fixed) - Added complete string in {0} for Wildcard(URI)?Matcher in addition to matches in {1}... - Added in sitemap + method in AbstractSitemap to print out current sitemap parameters to log. Nice for debugging sitemaps + educational. Revision Changes Path 1.63 +29 -14 xml-cocoon2/webapp/sitemap.xmap Index: sitemap.xmap =================================================================== RCS file: /home/cvs/xml-cocoon2/webapp/sitemap.xmap,v retrieving revision 1.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- sitemap.xmap 2001/11/23 09:25:55 1.62 +++ sitemap.xmap 2001/11/26 09:19:51 1.63 @@ -143,7 +143,7 @@ necessity, matchers can be nested while chaining does not work. Related concepts are selectors and actions. - Since this is important, let me repeat it: Selectors are executed + Since this is important, let me repeat it: Matchers are executed during pipeline setup. --> @@ -203,7 +203,11 @@ pipelines. Use them to update databases, check external resources etc. The execution may fail or complete successfully. Only if the execution was successful, the pipeline fragment contained inside is - used within the pipeline. + used within the pipeline. Related concepts are matchers and + selectors. + + Since this is important, let me repeat it: Actions are executed + during pipeline setup. --> @@ -268,9 +272,20 @@ + + - - + + + + @@ -332,7 +347,7 @@ You may have as many pipelines in your sitemap as you like. However, it seems that the only purposes would be to specify different error - handlers or mount subsitemaps. + handlers. --> @@ -770,6 +785,7 @@ + @@ -866,32 +882,31 @@ - + - - + + - + - + - + 1.20 +27 -1 xml-cocoon2/src/org/apache/cocoon/sitemap/AbstractSitemap.java Index: AbstractSitemap.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/AbstractSitemap.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- AbstractSitemap.java 2001/10/11 07:28:23 1.19 +++ AbstractSitemap.java 2001/11/26 09:19:51 1.20 @@ -42,12 +42,13 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Iterator; /** * Base class for generated Sitemap classes * * @author Giacomo Pati - * @version CVS $Revision: 1.19 $ $Date: 2001/10/11 07:28:23 $ + * @version CVS $Revision: 1.20 $ $Date: 2001/11/26 09:19:51 $ */ public abstract class AbstractSitemap extends AbstractLoggable implements Sitemap, Disposable, ThreadSafe { private Context context; @@ -319,6 +320,31 @@ getLogger().error("AbstractSitemap:substitute()", e); throw new PatternException("error occurred during evaluation of expression \"" + expr + "\" at position " + (i + 1) + "\n" + e.getMessage()); + } + } + + /** + * Dumps all sitemap parameters to log + */ + protected void dumpParameters(List list) { + if (getLogger().isDebugEnabled()) { + StringBuffer sb=new StringBuffer(); + if (!list.isEmpty()) { + sb.append("\nCurrent Sitemap Parameters:\n"); + String path=""; + for (int i=list.size()-1; i>=0; i--) { + Map map=(Map)list.get(i); + Iterator keys = map.keySet().iterator(); + while (keys.hasNext()) { + String key = (String)keys.next(); + sb.append(path) + .append("PARAM: '").append(key) + .append("' VALUE: '").append(map.get(key)).append("'\n"); + } + path="../"+path; + } + } + getLogger().debug(sb.toString()); } } 1.3 +6 -2 xml-cocoon2/src/org/apache/cocoon/matching/WildcardSessionAttributeMatcher.java Index: WildcardSessionAttributeMatcher.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/WildcardSessionAttributeMatcher.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- WildcardSessionAttributeMatcher.java 2001/10/22 10:17:46 1.2 +++ WildcardSessionAttributeMatcher.java 2001/11/26 09:19:51 1.3 @@ -26,15 +26,19 @@ * * @author Christian Haul * @author Sylvain Wallez - * @version CVS $Revision: 1.2 $ $Date: 2001/10/22 10:17:46 $ + * @version CVS $Revision: 1.3 $ $Date: 2001/11/26 09:19:51 $ */ -public class WildcardSessionAttributeMatcher extends WildcardURIMatcher { +public class WildcardSessionAttributeMatcher + extends WildcardURIMatcher + implements Configurable +{ private String defaultParam; public void configure(Configuration config) throws ConfigurationException { this.defaultParam = config.getChild("attribute-name").getValue(null); + getLogger().debug("attribute-name is = '"+this.defaultParam+"'"); } protected String getMatchString(Map objectModel, Parameters parameters) { 1.2 +4 -1 xml-cocoon2/src/org/apache/cocoon/matching/helpers/WildcardHelper.java Index: WildcardHelper.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/helpers/WildcardHelper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- WildcardHelper.java 2001/10/19 15:28:45 1.1 +++ WildcardHelper.java 2001/11/26 09:19:51 1.2 @@ -18,7 +18,7 @@ * @author Giacomo Pati * @author Stefano Mazzocchi * @author Berin Loritsch - * @version CVS $Revision: 1.1 $ $Date: 2001/10/19 15:28:45 $ + * @version CVS $Revision: 1.2 $ $Date: 2001/11/26 09:19:51 $ */ public class WildcardHelper { @@ -152,6 +152,9 @@ // The matching count int mcount = 0; + + // We want the complete data be in {0} + map.put(Integer.toString(mcount),data); // First check for MATCH_BEGIN boolean matchBegin = false; 1.3 +4 -1 xml-cocoon2/src/org/apache/cocoon/matching/helpers/WildcardURIMatcher.java Index: WildcardURIMatcher.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/matching/helpers/WildcardURIMatcher.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- WildcardURIMatcher.java 2001/10/19 15:28:45 1.2 +++ WildcardURIMatcher.java 2001/11/26 09:19:51 1.3 @@ -17,7 +17,7 @@ * (Apache Software Foundation, Exoffice Technologies) * @author Giacomo Pati * @author Stefano Mazzocchi - * @version CVS $Revision: 1.2 $ $Date: 2001/10/19 15:28:45 $ + * @version CVS $Revision: 1.3 $ $Date: 2001/11/26 09:19:51 $ * @deprecated renamed to WildcardHelper */ public class WildcardURIMatcher { @@ -64,6 +64,9 @@ // The matching count int mcount = 0; + + // We want the complete data be in {0} + map.put(Integer.toString(mcount),data); // First check for MATCH_BEGIN boolean matchBegin = false; 1.48 +7 -1 xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl Index: sitemap.xsl =================================================================== RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- sitemap.xsl 2001/11/14 22:43:43 1.47 +++ sitemap.xsl 2001/11/26 09:19:51 1.48 @@ -126,7 +126,7 @@ * * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a> * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a> - * @version CVS $Id: sitemap.xsl,v 1.47 2001/11/14 22:43:43 giacomo Exp $ + * @version CVS $Id: sitemap.xsl,v 1.48 2001/11/26 09:19:51 haul Exp $ */ public class extends AbstractSitemap { static final String LOCATION = "."; @@ -1614,6 +1614,12 @@ } + + + + this.dumpParameters(listOfMaps); + + ---------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: cocoon-cvs-help@xml.apache.org