Hello again! i have tried to setup the pipeline another way and lokked at the compiled sitemap java code. it seems that the java code generated is far away from being complete...
are the sessionstate matcher code for the sitemap broken in cocoon 2.0.1? if so, can i change only the sessionstate code parts to avoid migrating the whole application to a newer cocoon version? thx, Chris btw: sitemap and compiled sitemap attached for interest... On Wed, Nov 06, 2002 at 02:52:15PM +0100, Christian Joelly wrote: > > i have some troubles using the sessionstate matcher in a pipeline. > I want to check for the existance of a session attribute, and when it > doesn't exist we should be redirected to a login page: > > But i got lots of errors when i call want to use this pipeline... > > <map:pipeline> > > <map:match pattern="*" type="sessionstate"> > <map:parameter name="attribute-name" value="user"/> > <map:redirect uri="login/login.xml"/> > </map:match> > > <map:match pattern="**/*.css"> > <map:read src="css/{2}.css" mime-type="text/css"/> > </map:match> > > <map:match pattern="images/**.*"> > <map:read src="images/{1}.{2}" mime-type="image/{2}"/> > </map:match> > > <map:match pattern="**/*.js"> > <map:read src="jscript/{2}.js" mime-type="text/javascript"/> > </map:match> > > <map:match pattern="applets/**"> > <map:read src="applets/{1}" mime-type="application/octet-stream"/> > </map:match> > > <map:match pattern="*/**"> > <map:mount uri-prefix="{1}" src="{1}/" check-reload="yes"/> > </map:match> > > </map:pipeline> -- KNAPP Logistics Automation http://www.knapp.com Ing. Christian Jölly Tel/FAX: (++43) 316 / 495 1926 / 495 394 Günter-Knapp-Straße 5-7 A-8075 Hart bei Graz -- Support your government, give Echelon/Carnivore something to parse -- AMTAS ATMD ATSC Abdullah Allah communist CIA DD2-N DISA DoD GRU Gregori Irak Iran KGB Kurdish LSD NATO NSTD Natasha ORD RTEM Russia STRAP Saddam Hussein TSP Yugoslavia attack bank bomb classfield cocain compromise defense democracy destroy destruct detonator directorate elections enforce extasy force foreign embassy government grass hashish heroin illegal information international military systems missile million dollars nuclear policital pot power presidental project restricted data revolution rule the world sensitive smuggle spy steal system takeover terrorist top-secret warmod warrior-T weapon weed ------------------------------------------------------------------------
<?xml version="1.0"?> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> <!-- This is the 'heart' of Cocoon. The sitemap maps URI space to resources. It consists basicly of two parts: components and pipelines. Pipelines are made out of components. There is such a vast number of components available that it would be impossible to describe them here, please refer to the accompanying documentation. For specific components, have a look also at the javadocs for them. Most pipelines are present to demonstrate some feature or technique, often they are explained in more detail in the accompanying documentation. There are some other, less important parts that deal with resources, views and action sets. For now, ignore them. --> <!-- =========================== Components ================================ --> <map:components> <!-- All pipelines consist at least of two components: a generator, that produces the content and a serialiser, that delivers the content to the client. More precisely: a generator generates SAX events and a serializer consumes these events and produces a character stream. Some things to note here: each generator has a unique name, this name is mapped to a java class, one name is declared as default generator. In addition each generator may have additional configurations as child elements. Additional attributes are targeted at the component manager. The optional "label" attribute is relevant for the view concept below. It is possible to have the same java class declared as different generators by using different names. No configuration options are shared between these instances, however. All components follow this schema. --> <map:generators default="file"> <map:generator name="file" src="org.apache.cocoon.generation.FileGenerator" label="content" pool-max="32" pool-min="16" pool-grow="4"/> <map:generator name="directory" src="org.apache.cocoon.generation.DirectoryGenerator" label="content"/> <map:generator name="imagedirectory" src="org.apache.cocoon.generation.ImageDirectoryGenerator" label="content"/> <map:generator name="serverpages" src="org.apache.cocoon.generation.ServerPagesGenerator" label="content"/> <map:generator name="request" src="org.apache.cocoon.generation.RequestGenerator"/> <map:generator name="status" src="org.apache.cocoon.generation.StatusGenerator"/> <map:generator name="extractor" src="org.apache.cocoon.generation.FragmentExtractorGenerator"/> <map:generator name="script" src="org.apache.cocoon.generation.ScriptGenerator"/> <map:generator name="velocity" src="org.apache.cocoon.generation.VelocityGenerator"/> <map:generator name="jsp" src="org.apache.cocoon.generation.JspGenerator"/> <map:generator name="stream" src="org.apache.cocoon.generation.StreamGenerator"/> <map:generator name="html" src="org.apache.cocoon.generation.HTMLGenerator" label="content"/> </map:generators> <!-- Transformers can be placed inside the pipeline between the generator and the serializer. You may have as many transformers as you like. Transformers consume SAX events and emmit SAX events. The "xslt" transformer is an example of a component with additional configuration. --> <map:transformers default="xslt"> <map:transformer name="xslt" src="org.apache.cocoon.transformation.TraxTransformer" pool-max="32" pool-min="16" pool-grow="4"> <use-request-parameters>false</use-request-parameters> <use-browser-capabilities-db>false</use-browser-capabilities-db> </map:transformer> <map:transformer name="log" src="org.apache.cocoon.transformation.LogTransformer"/> <map:transformer name="sql" src="org.apache.cocoon.transformation.SQLTransformer"/> <map:transformer name="extractor" src="org.apache.cocoon.transformation.FragmentExtractorTransformer"/> <map:transformer name="i18n" src="org.apache.cocoon.transformation.I18nTransformer"> <catalogue-name>messages</catalogue-name> <catalogue-location>translations</catalogue-location> </map:transformer> <map:transformer name="xinclude" src="org.apache.cocoon.transformation.XIncludeTransformer"/> <map:transformer name="cinclude" src="org.apache.cocoon.transformation.CIncludeTransformer"/> <map:transformer name="filter" src="org.apache.cocoon.transformation.FilterTransformer"/> <map:transformer name="writeDOMsession" src="org.apache.cocoon.transformation.WriteDOMSessionTransformer"/> <map:transformer name="readDOMsession" src="org.apache.cocoon.transformation.ReadDOMSessionTransformer"/> <map:transformer name="xt" src="org.apache.cocoon.transformation.XTTransformer"/> </map:transformers> <!-- Readers are an exception to the above rule that a pipline need to have exactly one generator and exactly one serializer. Readers circumvent the XML oriented SAX pipeline model, think of a reader being a generator and a serializer at once thus a pipeline may not contain any generator, transformer or serializer in addition to a reader. They are useful for delivering binary content like images. --> <map:readers default="resource"> <map:reader name="resource" src="org.apache.cocoon.reading.ResourceReader"/> </map:readers> <!-- Serializers consume SAX events and produce a character stream. Every pipeline needs to be terminated by a serializer. --> <map:serializers default="html"> <map:serializer name="links" src="org.apache.cocoon.serialization.LinkSerializer"/> <map:serializer name="xml" mime-type="text/xml" src="org.apache.cocoon.serialization.XMLSerializer" pool-max="32" pool-min="16" pool-grow="4"/> <map:serializer name="html" mime-type="text/html" src="org.apache.cocoon.serialization.HTMLSerializer"> <!-- Troubles mit dem TreeView im Galeon/Mozilla <doctype-public>-//W3C//DTD HTML 4.01 Transitional//EN</doctype-public> <doctype-system>http://www.w3.org/TR/html4/loose.dtd</doctype-system> --> <doctype-public>-//W3C//DTD HTML 4.0 Transitional//EN</doctype-public> <doctype-system>http://www.w3.org/TR/REC-html40/loose.dtd</doctype-system> <encoding>ISO-8859-15</encoding> <omit-xml-declaration>yes</omit-xml-declaration> </map:serializer> <map:serializer name="vrml" mime-type="model/vrml" src="org.apache.cocoon.serialization.TextSerializer"/> <map:serializer name="wap" mime-type="text/vnd.wap.wml" src="org.apache.cocoon.serialization.XMLSerializer"> <doctype-public>-//WAPFORUM//DTD WML 1.1//EN</doctype-public> <doctype-system>http://www.wapforum.org/DTD/wml_1.1.xml</doctype-system> <encoding>ASCII</encoding> <omit-xml-declaration>yes</omit-xml-declaration> </map:serializer> <map:serializer name="svgxml" mime-type="image/svg-xml" src="org.apache.cocoon.serialization.XMLSerializer"> <doctype-public>-//W3C//DTD SVG 20000303 Stylable//EN</doctype-public> <doctype-system>http://www.w3.org/TR/2000/03/WD-SVG-20000303/</doctype-system> </map:serializer> <map:serializer name="svg2jpeg" src="org.apache.cocoon.serialization.SVGSerializer" mime-type="image/jpeg"/> <map:serializer name="svg2png" src="org.apache.cocoon.serialization.SVGSerializer" mime-type="image/png"/> <map:serializer name="fo2pdf" src="org.apache.cocoon.serialization.FOPSerializer" mime-type="application/pdf"/> <map:serializer name="fo2ps" src="org.apache.cocoon.serialization.FOPSerializer" mime-type="application/postscript"/> <map:serializer name="fo2pcl" src="org.apache.cocoon.serialization.FOPSerializer" mime-type="application/vnd.hp-PCL"/> </map:serializers> <!-- Matchers are executed during pipeline setup. They decide if a pipeline fragment is used within a pipeline. Usually, the decision is based on a match on the requested URI but matchers exist, that match different things as well. Most often the fragment contained in a matcher has a generator as well as a serializer. This is not a necessity, matchers can be nested while chaining does not work. Related concepts are selectors and actions. Since this is important, let me repeat it: Matchers are executed during pipeline setup. --> <map:matchers default="wildcard"> <map:matcher name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcher"/> <map:matcher name="regexp" src="org.apache.cocoon.matching.RegexpURIMatcher"/> <map:matcher name="request" src="org.apache.cocoon.matching.RequestParamMatcher"/> <map:matcher name="sessionstate" src="org.apache.cocoon.matching.WildcardSessionAttributeMatcher"> <attribute-name>org.apache.cocoon.SessionState</attribute-name> <attribute-name>user</attribute-name> </map:matcher> <map:matcher name="next-page" src="org.apache.cocoon.matching.WildcardParameterValueMatcher"> <parameter-name>next-state</parameter-name> </map:matcher> <map:matcher name="referer-match" src="org.apache.cocoon.matching.WildcardHeaderMatcher"> <header-name>referer</header-name> </map:matcher> </map:matchers> <!-- Selectors are executed during pipeline setup. They can be used to determine which pipeline fragments should be combined. They are best compared with a switch statement in java. Matchers and actions are related concepts. Since this is important, let me repeat it: Selectors are executed during pipeline setup. --> <map:selectors default="browser"> <map:selector name="browser" src="org.apache.cocoon.selection.BrowserSelector"> <!-- # NOTE: The appearance indicates the search order. This is very important since # some words may be found in more than one browser description. (MSIE is # presented as "Mozilla/4.0 (Compatible; MSIE 4.01; ...") --> <browser name="explorer" useragent="MSIE"/> <browser name="pocketexplorer" useragent="MSPIE"/> <browser name="handweb" useragent="HandHTTP"/> <browser name="avantgo" useragent="AvantGo"/> <browser name="imode" useragent="DoCoMo"/> <browser name="opera" useragent="Opera"/> <browser name="lynx" useragent="Lynx"/> <browser name="java" useragent="Java"/> <browser name="wap" useragent="Nokia"/> <browser name="wap" useragent="UP"/> <browser name="wap" useragent="Wapalizer"/> <browser name="mozilla5" useragent="Mozilla/5"/> <browser name="mozilla5" useragent="Netscape6/"/> <browser name="netscape" useragent="Mozilla"/> </map:selector> <map:selector name="parameter" src="org.apache.cocoon.selection.ParameterSelector"/> <map:selector name="request" src="org.apache.cocoon.selection.RequestSelector"/> </map:selectors> <!-- Actions are executed during pipeline setup. Their purpose is to execute some arbitrary complex code. They are the work horses of 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. Related concepts are matchers and selectors. Since this is important, let me repeat it: Actions are executed during pipeline setup. --> <map:actions> <map:action name="add-employee" src="org.apache.cocoon.acting.DatabaseAddAction"/> <map:action name="del-employee" src="org.apache.cocoon.acting.DatabaseDeleteAction"/> <map:action name="upd-employee" src="org.apache.cocoon.acting.DatabaseUpdateAction"/> <map:action name="lang-select" src="org.apache.cocoon.acting.LangSelect"/> <map:action name="locale" src="org.apache.cocoon.acting.LocaleAction"/> <map:action name="request" src="org.apache.cocoon.acting.RequestParamAction"/> <map:action name="form-validator" src="org.apache.cocoon.acting.FormValidatorAction"/> <map:action name="session-state" src="org.apache.cocoon.acting.SessionStateAction"/> <map:action name="session-isvalid" src="org.apache.cocoon.acting.SessionIsValidAction"/> <map:action name="resource-exists" src="org.apache.cocoon.acting.ResourceExistsAction"/> </map:actions> </map:components> <!-- =========================== Pipelines ================================= --> <!-- Pipelines. The beef. Pipelines specify, how the processing of your content is done. Usually, a pipeline consists of several fragments that specify the generation, transformation, and serialization of SAX events. Processing is done in two steps: 1) The top level elements are executed in order of appearance until one signals success. These top level elements are usually matchers. AFAIK other components are not supported for this. Other components are called depth-first to determine what fragments make up the processing pipeline. When a component fails, no nested components are called but the next component on the same level. 2) Once it is determined which generator, which transformers and wich serializer is used, these components are executed. During this, the pipeline may not be changed. 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. --> <map:pipelines> <!-- Utility for viewing source xml or html--> <map:pipeline> <map:match pattern="**.source"> <map:generate src="cocoon:/{1}" /> <map:transform src="stylesheets/simple-xml2html.xsl"/> <map:serialize/> </map:match> </map:pipeline> <!-- "automount" setup This causes directories added under "mount" (even with Cocoon already running) to be activated automagically if they contain a sitemap.xmap, without having to modify the main sitemap.xmap --> <map:pipeline> <map:match pattern="mount/*/**"> <map:mount uri-prefix="mount/{1}" src="mount/{1}/" check-reload="yes"/> </map:match> </map:pipeline> <!-- Pipeline for KNAPP Web more specific matchers must go first, then the matcher */** should be defined to process sub sitemaps --> <map:pipeline> <map:match pattern="*"> <map:match pattern="*" type="sessionstate"> <map:parameter name="attribute-name" value="user"/> <map:match pattern="**/*.css"> <map:read src="css/{2}.css" mime-type="text/css"/> </map:match> <map:match pattern="images/**.*"> <map:read src="images/{1}.{2}" mime-type="image/{2}"/> </map:match> <map:match pattern="**/*.js"> <map:read src="jscript/{2}.js" mime-type="text/javascript"/> </map:match> <map:match pattern="applets/**"> <map:read src="applets/{1}" mime-type="application/octet-stream"/> </map:match> <map:match pattern="*/**"> <map:mount uri-prefix="{1}" src="{1}/" check-reload="yes"/> </map:match> </map:match> <map:redirect uri="login/login.xml"/> </map:match> </map:pipeline> </map:pipelines> </map:sitemap> <!-- end of file -->
/*****************************************************************************/ /* Copyright (C) The Apache Software Foundation. All rights reserved. */ /* _________________________________________________________________________ */ /* This software is published under the terms of the Apache Software License */ /* version 1.1, a copy of which has been included with this distribution in */ /* the LICENSE file. */ /*****************************************************************************/ package org.apache.cocoon.www; import java.io.OutputStream; import java.io.IOException; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.Stack; import java.util.StringTokenizer; import org.apache.avalon.framework.component.Component; import org.apache.avalon.framework.configuration.Configurable; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.configuration.DefaultConfiguration; import org.apache.avalon.framework.parameters.Parameters; import org.apache.cocoon.Constants; import org.apache.cocoon.ProcessingException; import org.apache.cocoon.ResourceNotFoundException; import org.apache.cocoon.ConnectionResetException; import org.apache.cocoon.acting.Action; import org.apache.cocoon.environment.Environment; import org.apache.cocoon.environment.Redirector; import org.apache.cocoon.matching.Matcher; import org.apache.cocoon.matching.PreparableMatcher; import org.apache.cocoon.selection.Selector; import org.apache.cocoon.sitemap.AbstractSitemap; import org.apache.cocoon.components.pipeline.StreamPipeline; import org.apache.cocoon.components.pipeline.EventPipeline; import org.apache.cocoon.sitemap.Sitemap; import org.apache.cocoon.sitemap.NotifyingGenerator; import org.apache.cocoon.sitemap.ContentAggregator; import org.apache.cocoon.sitemap.Manager; import org.apache.cocoon.sitemap.SitemapRedirector; import org.apache.cocoon.components.language.markup.xsp.XSPRequestHelper; import org.apache.cocoon.components.language.markup.xsp.XSPResponseHelper; import org.apache.cocoon.components.notification.NotifyingBuilder; import org.apache.cocoon.components.notification.Notifying; import org.apache.cocoon.components.notification.SimpleNotifyingBean; /** * This is the automatically generated class from the sitemap definitions * * @author <a href="mailto:giacomo@;apache.org">Giacomo Pati</a> * @author <a href="mailto:bloritsch@;apache.org">Berin Loritsch</a> * @author <a href="mailto:barozzi@;nicolaken.com">Nicola Ken Barozzi</a> * @author <a href="mailto:proyal@;managingpartners.com">Peter Royal</a> * @version CVS $Id: sitemap.xsl,v 1.5 2002/01/17 03:51:38 vgritsenko Exp $ */ public class sitemap_xmap extends AbstractSitemap { static final String LOCATION = "org.apache.cocoon.www.sitemap_xmap"; static { dateCreated = 1036594624024L; } /** HashMap relating labels to view names */ private HashMap view_label_map = new HashMap(0); // Pattern for "**.source" (either String or prepared pattern) private Object matcher_N10191_expr; // Pattern for "mount/*/**" (either String or prepared pattern) private Object matcher_N101A0_expr; // Pattern for "*" (either String or prepared pattern) private Object matcher_N101AC_expr; // Pattern for "*" (either String or prepared pattern) private Object matcher_N101AF_expr; // Pattern for "**/*.css" (either String or prepared pattern) private Object matcher_N101B7_expr; // Pattern for "images/**.*" (either String or prepared pattern) private Object matcher_N101BF_expr; // Pattern for "**/*.js" (either String or prepared pattern) private Object matcher_N101C7_expr; // Pattern for "applets/**" (either String or prepared pattern) private Object matcher_N101CF_expr; // Pattern for "*/**" (either String or prepared pattern) private Object matcher_N101D7_expr; /** * Method that handles selectors. */ private boolean isSelected(String hint, String testValue, Parameters params, Map objectModel) throws Exception { Selector selector = (Selector) this.selectors.select(hint); try { return selector.select(testValue, objectModel, params); } finally { this.selectors.release(selector); } } /** * Method that handles matchers. */ private Map matches(String hint, Object preparedPattern, String pattern, Parameters params, Map objectModel) throws Exception { Component matcher = (Component) this.matchers.select(hint); try { if (preparedPattern == null) { return ((Matcher) matcher).match(pattern, objectModel, params); } else { return ((PreparableMatcher) matcher).preparedMatch( preparedPattern, objectModel, params); } } finally { this.matchers.release(matcher); } } /** * Pass a <code>Configuration</code> instance to this * <code>Configurable</code> class. */ public void configure(Configuration conf) throws ConfigurationException { this.sitemapManager = new Manager(); this.sitemapManager.setLogger(getLogger()); this.sitemapManager.compose(this.manager); this.sitemapManager.configure(conf); try { load_component (Sitemap.GENERATOR, "!notifying-generator!", "org.apache.cocoon.sitemap.NotifyingGenerator", new DefaultConfiguration("", LOCATION), null); load_component (Sitemap.GENERATOR, "!content-aggregator!", "org.apache.cocoon.sitemap.ContentAggregator", new DefaultConfiguration("", LOCATION), null); load_component (Sitemap.TRANSFORMER, "!link-translator!", "org.apache.cocoon.sitemap.LinkTranslator", new DefaultConfiguration("", LOCATION), null); Configurer configurer = new Configurer(this, LOCATION); configurer.configGenerators(); configurer.configTransformers(); configurer.configReaders(); configurer.configSerializers(); configurer.configMatchers(); configurer.configSelectors(); configurer.configActions(); configurer = null; this.generators.initialize(); this.transformers.initialize(); this.serializers.initialize(); this.readers.initialize(); this.actions.initialize(); this.matchers.initialize(); this.prepareMatchers(); this.selectors.initialize(); this.manager.initialize(); /* catch any exception thrown by a component during configuration */ } catch (Exception e) { getLogger().warn(e.getMessage(), e); throw new ConfigurationException ( "Error in sitemap configuration : " + e.getMessage(), e); } } class Configurer { sitemap_xmap sitemap; String LOCATION; public Configurer (sitemap_xmap sitemap, String location) { this.sitemap = sitemap; this.LOCATION = location; } /** Configure generators */ public void configGenerators() throws Exception { //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("file", LOCATION); cconf1.addAttribute ("name", "file"); cconf1.addAttribute ("src", "org.apache.cocoon.generation.FileGenerator"); cconf1.addAttribute ("label", "content"); cconf1.addAttribute ("pool-max", "32"); cconf1.addAttribute ("pool-min", "16"); cconf1.addAttribute ("pool-grow", "4"); sitemap.load_component (Sitemap.GENERATOR, "file", "org.apache.cocoon.generation.FileGenerator", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("directory", LOCATION); cconf1.addAttribute ("name", "directory"); cconf1.addAttribute ("src", "org.apache.cocoon.generation.DirectoryGenerator"); cconf1.addAttribute ("label", "content"); sitemap.load_component (Sitemap.GENERATOR, "directory", "org.apache.cocoon.generation.DirectoryGenerator", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("imagedirectory", LOCATION); cconf1.addAttribute ("name", "imagedirectory"); cconf1.addAttribute ("src", "org.apache.cocoon.generation.ImageDirectoryGenerator"); cconf1.addAttribute ("label", "content"); sitemap.load_component (Sitemap.GENERATOR, "imagedirectory", "org.apache.cocoon.generation.ImageDirectoryGenerator", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("serverpages", LOCATION); cconf1.addAttribute ("name", "serverpages"); cconf1.addAttribute ("src", "org.apache.cocoon.generation.ServerPagesGenerator"); cconf1.addAttribute ("label", "content"); sitemap.load_component (Sitemap.GENERATOR, "serverpages", "org.apache.cocoon.generation.ServerPagesGenerator", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("request", LOCATION); cconf1.addAttribute ("name", "request"); cconf1.addAttribute ("src", "org.apache.cocoon.generation.RequestGenerator"); sitemap.load_component (Sitemap.GENERATOR, "request", "org.apache.cocoon.generation.RequestGenerator", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("status", LOCATION); cconf1.addAttribute ("name", "status"); cconf1.addAttribute ("src", "org.apache.cocoon.generation.StatusGenerator"); sitemap.load_component (Sitemap.GENERATOR, "status", "org.apache.cocoon.generation.StatusGenerator", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("extractor", LOCATION); cconf1.addAttribute ("name", "extractor"); cconf1.addAttribute ("src", "org.apache.cocoon.generation.FragmentExtractorGenerator"); sitemap.load_component (Sitemap.GENERATOR, "extractor", "org.apache.cocoon.generation.FragmentExtractorGenerator", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("script", LOCATION); cconf1.addAttribute ("name", "script"); cconf1.addAttribute ("src", "org.apache.cocoon.generation.ScriptGenerator"); sitemap.load_component (Sitemap.GENERATOR, "script", "org.apache.cocoon.generation.ScriptGenerator", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("velocity", LOCATION); cconf1.addAttribute ("name", "velocity"); cconf1.addAttribute ("src", "org.apache.cocoon.generation.VelocityGenerator"); sitemap.load_component (Sitemap.GENERATOR, "velocity", "org.apache.cocoon.generation.VelocityGenerator", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("jsp", LOCATION); cconf1.addAttribute ("name", "jsp"); cconf1.addAttribute ("src", "org.apache.cocoon.generation.JspGenerator"); sitemap.load_component (Sitemap.GENERATOR, "jsp", "org.apache.cocoon.generation.JspGenerator", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("stream", LOCATION); cconf1.addAttribute ("name", "stream"); cconf1.addAttribute ("src", "org.apache.cocoon.generation.StreamGenerator"); sitemap.load_component (Sitemap.GENERATOR, "stream", "org.apache.cocoon.generation.StreamGenerator", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("html", LOCATION); cconf1.addAttribute ("name", "html"); cconf1.addAttribute ("src", "org.apache.cocoon.generation.HTMLGenerator"); cconf1.addAttribute ("label", "content"); sitemap.load_component (Sitemap.GENERATOR, "html", "org.apache.cocoon.generation.HTMLGenerator", cconf1, null); } } /** Configure transformers */ public void configTransformers() throws Exception { //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("xslt", LOCATION); cconf1.addAttribute ("name", "xslt"); cconf1.addAttribute ("src", "org.apache.cocoon.transformation.TraxTransformer"); cconf1.addAttribute ("pool-max", "32"); cconf1.addAttribute ("pool-min", "16"); cconf1.addAttribute ("pool-grow", "4"); //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("use-request-parameters", LOCATION); cconf2.appendValueData("false"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("use-browser-capabilities-db", LOCATION); cconf2.appendValueData("false"); cconf1.addChild(cconf2); } sitemap.load_component (Sitemap.TRANSFORMER, "xslt", "org.apache.cocoon.transformation.TraxTransformer", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("log", LOCATION); cconf1.addAttribute ("name", "log"); cconf1.addAttribute ("src", "org.apache.cocoon.transformation.LogTransformer"); sitemap.load_component (Sitemap.TRANSFORMER, "log", "org.apache.cocoon.transformation.LogTransformer", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("sql", LOCATION); cconf1.addAttribute ("name", "sql"); cconf1.addAttribute ("src", "org.apache.cocoon.transformation.SQLTransformer"); sitemap.load_component (Sitemap.TRANSFORMER, "sql", "org.apache.cocoon.transformation.SQLTransformer", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("extractor", LOCATION); cconf1.addAttribute ("name", "extractor"); cconf1.addAttribute ("src", "org.apache.cocoon.transformation.FragmentExtractorTransformer"); sitemap.load_component (Sitemap.TRANSFORMER, "extractor", "org.apache.cocoon.transformation.FragmentExtractorTransformer", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("i18n", LOCATION); cconf1.addAttribute ("name", "i18n"); cconf1.addAttribute ("src", "org.apache.cocoon.transformation.I18nTransformer"); //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("catalogue-name", LOCATION); cconf2.appendValueData("messages"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("catalogue-location", LOCATION); cconf2.appendValueData("translations"); cconf1.addChild(cconf2); } sitemap.load_component (Sitemap.TRANSFORMER, "i18n", "org.apache.cocoon.transformation.I18nTransformer", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("xinclude", LOCATION); cconf1.addAttribute ("name", "xinclude"); cconf1.addAttribute ("src", "org.apache.cocoon.transformation.XIncludeTransformer"); sitemap.load_component (Sitemap.TRANSFORMER, "xinclude", "org.apache.cocoon.transformation.XIncludeTransformer", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("cinclude", LOCATION); cconf1.addAttribute ("name", "cinclude"); cconf1.addAttribute ("src", "org.apache.cocoon.transformation.CIncludeTransformer"); sitemap.load_component (Sitemap.TRANSFORMER, "cinclude", "org.apache.cocoon.transformation.CIncludeTransformer", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("filter", LOCATION); cconf1.addAttribute ("name", "filter"); cconf1.addAttribute ("src", "org.apache.cocoon.transformation.FilterTransformer"); sitemap.load_component (Sitemap.TRANSFORMER, "filter", "org.apache.cocoon.transformation.FilterTransformer", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("writeDOMsession", LOCATION); cconf1.addAttribute ("name", "writeDOMsession"); cconf1.addAttribute ("src", "org.apache.cocoon.transformation.WriteDOMSessionTransformer"); sitemap.load_component (Sitemap.TRANSFORMER, "writeDOMsession", "org.apache.cocoon.transformation.WriteDOMSessionTransformer", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("readDOMsession", LOCATION); cconf1.addAttribute ("name", "readDOMsession"); cconf1.addAttribute ("src", "org.apache.cocoon.transformation.ReadDOMSessionTransformer"); sitemap.load_component (Sitemap.TRANSFORMER, "readDOMsession", "org.apache.cocoon.transformation.ReadDOMSessionTransformer", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("xt", LOCATION); cconf1.addAttribute ("name", "xt"); cconf1.addAttribute ("src", "org.apache.cocoon.transformation.XTTransformer"); sitemap.load_component (Sitemap.TRANSFORMER, "xt", "org.apache.cocoon.transformation.XTTransformer", cconf1, null); } } /** Configure readers */ public void configReaders() throws Exception { //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("resource", LOCATION); cconf1.addAttribute ("name", "resource"); cconf1.addAttribute ("src", "org.apache.cocoon.reading.ResourceReader"); sitemap.load_component (Sitemap.READER, "resource", "org.apache.cocoon.reading.ResourceReader", cconf1, null); } } /* Configure serializers */ public void configSerializers() throws Exception { //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("links", LOCATION); cconf1.addAttribute ("name", "links"); cconf1.addAttribute ("src", "org.apache.cocoon.serialization.LinkSerializer"); sitemap.load_component (Sitemap.SERIALIZER, "links", "org.apache.cocoon.serialization.LinkSerializer", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("xml", LOCATION); cconf1.addAttribute ("name", "xml"); cconf1.addAttribute ("mime-type", "text/xml"); cconf1.addAttribute ("src", "org.apache.cocoon.serialization.XMLSerializer"); cconf1.addAttribute ("pool-max", "32"); cconf1.addAttribute ("pool-min", "16"); cconf1.addAttribute ("pool-grow", "4"); sitemap.load_component (Sitemap.SERIALIZER, "xml", "org.apache.cocoon.serialization.XMLSerializer", cconf1, "text/xml"); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("html", LOCATION); cconf1.addAttribute ("name", "html"); cconf1.addAttribute ("mime-type", "text/html"); cconf1.addAttribute ("src", "org.apache.cocoon.serialization.HTMLSerializer"); //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("doctype-public", LOCATION); cconf2.appendValueData("-//W3C//DTD HTML 4.0 Transitional//EN"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("doctype-system", LOCATION); cconf2.appendValueData("http://www.w3.org/TR/REC-html40/loose.dtd"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("encoding", LOCATION); cconf2.appendValueData("ISO-8859-15"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("omit-xml-declaration", LOCATION); cconf2.appendValueData("yes"); cconf1.addChild(cconf2); } sitemap.load_component (Sitemap.SERIALIZER, "html", "org.apache.cocoon.serialization.HTMLSerializer", cconf1, "text/html"); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("vrml", LOCATION); cconf1.addAttribute ("name", "vrml"); cconf1.addAttribute ("mime-type", "model/vrml"); cconf1.addAttribute ("src", "org.apache.cocoon.serialization.TextSerializer"); sitemap.load_component (Sitemap.SERIALIZER, "vrml", "org.apache.cocoon.serialization.TextSerializer", cconf1, "model/vrml"); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("wap", LOCATION); cconf1.addAttribute ("name", "wap"); cconf1.addAttribute ("mime-type", "text/vnd.wap.wml"); cconf1.addAttribute ("src", "org.apache.cocoon.serialization.XMLSerializer"); //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("doctype-public", LOCATION); cconf2.appendValueData("-//WAPFORUM//DTD WML 1.1//EN"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("doctype-system", LOCATION); cconf2.appendValueData("http://www.wapforum.org/DTD/wml_1.1.xml"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("encoding", LOCATION); cconf2.appendValueData("ASCII"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("omit-xml-declaration", LOCATION); cconf2.appendValueData("yes"); cconf1.addChild(cconf2); } sitemap.load_component (Sitemap.SERIALIZER, "wap", "org.apache.cocoon.serialization.XMLSerializer", cconf1, "text/vnd.wap.wml"); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("svgxml", LOCATION); cconf1.addAttribute ("name", "svgxml"); cconf1.addAttribute ("mime-type", "image/svg-xml"); cconf1.addAttribute ("src", "org.apache.cocoon.serialization.XMLSerializer"); //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("doctype-public", LOCATION); cconf2.appendValueData("-//W3C//DTD SVG 20000303 Stylable//EN"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("doctype-system", LOCATION); cconf2.appendValueData("http://www.w3.org/TR/2000/03/WD-SVG-20000303/"); cconf1.addChild(cconf2); } sitemap.load_component (Sitemap.SERIALIZER, "svgxml", "org.apache.cocoon.serialization.XMLSerializer", cconf1, "image/svg-xml"); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("svg2jpeg", LOCATION); cconf1.addAttribute ("name", "svg2jpeg"); cconf1.addAttribute ("src", "org.apache.cocoon.serialization.SVGSerializer"); cconf1.addAttribute ("mime-type", "image/jpeg"); sitemap.load_component (Sitemap.SERIALIZER, "svg2jpeg", "org.apache.cocoon.serialization.SVGSerializer", cconf1, "image/jpeg"); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("svg2png", LOCATION); cconf1.addAttribute ("name", "svg2png"); cconf1.addAttribute ("src", "org.apache.cocoon.serialization.SVGSerializer"); cconf1.addAttribute ("mime-type", "image/png"); sitemap.load_component (Sitemap.SERIALIZER, "svg2png", "org.apache.cocoon.serialization.SVGSerializer", cconf1, "image/png"); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("fo2pdf", LOCATION); cconf1.addAttribute ("name", "fo2pdf"); cconf1.addAttribute ("src", "org.apache.cocoon.serialization.FOPSerializer"); cconf1.addAttribute ("mime-type", "application/pdf"); sitemap.load_component (Sitemap.SERIALIZER, "fo2pdf", "org.apache.cocoon.serialization.FOPSerializer", cconf1, "application/pdf"); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("fo2ps", LOCATION); cconf1.addAttribute ("name", "fo2ps"); cconf1.addAttribute ("src", "org.apache.cocoon.serialization.FOPSerializer"); cconf1.addAttribute ("mime-type", "application/postscript"); sitemap.load_component (Sitemap.SERIALIZER, "fo2ps", "org.apache.cocoon.serialization.FOPSerializer", cconf1, "application/postscript"); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("fo2pcl", LOCATION); cconf1.addAttribute ("name", "fo2pcl"); cconf1.addAttribute ("src", "org.apache.cocoon.serialization.FOPSerializer"); cconf1.addAttribute ("mime-type", "application/vnd.hp-PCL"); sitemap.load_component (Sitemap.SERIALIZER, "fo2pcl", "org.apache.cocoon.serialization.FOPSerializer", cconf1, "application/vnd.hp-PCL"); } } /** Configure matchers */ public void configMatchers() throws Exception { //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("wildcard", LOCATION); cconf1.addAttribute ("name", "wildcard"); cconf1.addAttribute ("src", "org.apache.cocoon.matching.WildcardURIMatcher"); sitemap.load_component (Sitemap.MATCHER, "wildcard", "org.apache.cocoon.matching.WildcardURIMatcher", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("regexp", LOCATION); cconf1.addAttribute ("name", "regexp"); cconf1.addAttribute ("src", "org.apache.cocoon.matching.RegexpURIMatcher"); sitemap.load_component (Sitemap.MATCHER, "regexp", "org.apache.cocoon.matching.RegexpURIMatcher", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("request", LOCATION); cconf1.addAttribute ("name", "request"); cconf1.addAttribute ("src", "org.apache.cocoon.matching.RequestParamMatcher"); sitemap.load_component (Sitemap.MATCHER, "request", "org.apache.cocoon.matching.RequestParamMatcher", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("sessionstate", LOCATION); cconf1.addAttribute ("name", "sessionstate"); cconf1.addAttribute ("src", "org.apache.cocoon.matching.WildcardSessionAttributeMatcher"); //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("attribute-name", LOCATION); cconf2.appendValueData("org.apache.cocoon.SessionState"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("attribute-name", LOCATION); cconf2.appendValueData("user"); cconf1.addChild(cconf2); } sitemap.load_component (Sitemap.MATCHER, "sessionstate", "org.apache.cocoon.matching.WildcardSessionAttributeMatcher", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("next_page", LOCATION); cconf1.addAttribute ("name", "next-page"); cconf1.addAttribute ("src", "org.apache.cocoon.matching.WildcardParameterValueMatcher"); //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("parameter-name", LOCATION); cconf2.appendValueData("next-state"); cconf1.addChild(cconf2); } sitemap.load_component (Sitemap.MATCHER, "next-page", "org.apache.cocoon.matching.WildcardParameterValueMatcher", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("referer_match", LOCATION); cconf1.addAttribute ("name", "referer-match"); cconf1.addAttribute ("src", "org.apache.cocoon.matching.WildcardHeaderMatcher"); //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("header-name", LOCATION); cconf2.appendValueData("referer"); cconf1.addChild(cconf2); } sitemap.load_component (Sitemap.MATCHER, "referer-match", "org.apache.cocoon.matching.WildcardHeaderMatcher", cconf1, null); } } /** Configure selectors */ public void configSelectors() throws Exception { //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("browser", LOCATION); cconf1.addAttribute ("name", "browser"); cconf1.addAttribute ("src", "org.apache.cocoon.selection.BrowserSelector"); //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("browser", LOCATION); cconf2.addAttribute ("name", "explorer"); cconf2.addAttribute ("useragent", "MSIE"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("browser", LOCATION); cconf2.addAttribute ("name", "pocketexplorer"); cconf2.addAttribute ("useragent", "MSPIE"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("browser", LOCATION); cconf2.addAttribute ("name", "handweb"); cconf2.addAttribute ("useragent", "HandHTTP"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("browser", LOCATION); cconf2.addAttribute ("name", "avantgo"); cconf2.addAttribute ("useragent", "AvantGo"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("browser", LOCATION); cconf2.addAttribute ("name", "imode"); cconf2.addAttribute ("useragent", "DoCoMo"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("browser", LOCATION); cconf2.addAttribute ("name", "opera"); cconf2.addAttribute ("useragent", "Opera"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("browser", LOCATION); cconf2.addAttribute ("name", "lynx"); cconf2.addAttribute ("useragent", "Lynx"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("browser", LOCATION); cconf2.addAttribute ("name", "java"); cconf2.addAttribute ("useragent", "Java"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("browser", LOCATION); cconf2.addAttribute ("name", "wap"); cconf2.addAttribute ("useragent", "Nokia"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("browser", LOCATION); cconf2.addAttribute ("name", "wap"); cconf2.addAttribute ("useragent", "UP"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("browser", LOCATION); cconf2.addAttribute ("name", "wap"); cconf2.addAttribute ("useragent", "Wapalizer"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("browser", LOCATION); cconf2.addAttribute ("name", "mozilla5"); cconf2.addAttribute ("useragent", "Mozilla/5"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("browser", LOCATION); cconf2.addAttribute ("name", "mozilla5"); cconf2.addAttribute ("useragent", "Netscape6/"); cconf1.addChild(cconf2); } //line numbers not supported with xalan { DefaultConfiguration cconf2 = new DefaultConfiguration("browser", LOCATION); cconf2.addAttribute ("name", "netscape"); cconf2.addAttribute ("useragent", "Mozilla"); cconf1.addChild(cconf2); } sitemap.load_component (Sitemap.SELECTOR, "browser", "org.apache.cocoon.selection.BrowserSelector", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("parameter", LOCATION); cconf1.addAttribute ("name", "parameter"); cconf1.addAttribute ("src", "org.apache.cocoon.selection.ParameterSelector"); sitemap.load_component (Sitemap.SELECTOR, "parameter", "org.apache.cocoon.selection.ParameterSelector", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("request", LOCATION); cconf1.addAttribute ("name", "request"); cconf1.addAttribute ("src", "org.apache.cocoon.selection.RequestSelector"); sitemap.load_component (Sitemap.SELECTOR, "request", "org.apache.cocoon.selection.RequestSelector", cconf1, null); } } /** Configure actions */ public void configActions() throws Exception { //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("add_employee", LOCATION); cconf1.addAttribute ("name", "add-employee"); cconf1.addAttribute ("src", "org.apache.cocoon.acting.DatabaseAddAction"); sitemap.load_component (Sitemap.ACTION, "add-employee", "org.apache.cocoon.acting.DatabaseAddAction", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("del_employee", LOCATION); cconf1.addAttribute ("name", "del-employee"); cconf1.addAttribute ("src", "org.apache.cocoon.acting.DatabaseDeleteAction"); sitemap.load_component (Sitemap.ACTION, "del-employee", "org.apache.cocoon.acting.DatabaseDeleteAction", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("upd_employee", LOCATION); cconf1.addAttribute ("name", "upd-employee"); cconf1.addAttribute ("src", "org.apache.cocoon.acting.DatabaseUpdateAction"); sitemap.load_component (Sitemap.ACTION, "upd-employee", "org.apache.cocoon.acting.DatabaseUpdateAction", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("lang_select", LOCATION); cconf1.addAttribute ("name", "lang-select"); cconf1.addAttribute ("src", "org.apache.cocoon.acting.LangSelect"); sitemap.load_component (Sitemap.ACTION, "lang-select", "org.apache.cocoon.acting.LangSelect", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("locale", LOCATION); cconf1.addAttribute ("name", "locale"); cconf1.addAttribute ("src", "org.apache.cocoon.acting.LocaleAction"); sitemap.load_component (Sitemap.ACTION, "locale", "org.apache.cocoon.acting.LocaleAction", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("request", LOCATION); cconf1.addAttribute ("name", "request"); cconf1.addAttribute ("src", "org.apache.cocoon.acting.RequestParamAction"); sitemap.load_component (Sitemap.ACTION, "request", "org.apache.cocoon.acting.RequestParamAction", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("form_validator", LOCATION); cconf1.addAttribute ("name", "form-validator"); cconf1.addAttribute ("src", "org.apache.cocoon.acting.FormValidatorAction"); sitemap.load_component (Sitemap.ACTION, "form-validator", "org.apache.cocoon.acting.FormValidatorAction", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("session_state", LOCATION); cconf1.addAttribute ("name", "session-state"); cconf1.addAttribute ("src", "org.apache.cocoon.acting.SessionStateAction"); sitemap.load_component (Sitemap.ACTION, "session-state", "org.apache.cocoon.acting.SessionStateAction", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("session_isvalid", LOCATION); cconf1.addAttribute ("name", "session-isvalid"); cconf1.addAttribute ("src", "org.apache.cocoon.acting.SessionIsValidAction"); sitemap.load_component (Sitemap.ACTION, "session-isvalid", "org.apache.cocoon.acting.SessionIsValidAction", cconf1, null); } //line numbers not supported with xalan { DefaultConfiguration cconf1 = new DefaultConfiguration("resource_exists", LOCATION); cconf1.addAttribute ("name", "resource-exists"); cconf1.addAttribute ("src", "org.apache.cocoon.acting.ResourceExistsAction"); sitemap.load_component (Sitemap.ACTION, "resource-exists", "org.apache.cocoon.acting.ResourceExistsAction", cconf1, null); } } } public Object preparePattern(String type, String pattern) throws Exception { Component matcher = this.matchers.select(type); try { if (matcher instanceof PreparableMatcher) { // Prepare pattern ('{' have been unescaped) return ((PreparableMatcher) matcher).preparePattern(pattern); } else { // Return null : regular Matcher will be used. return null; } } finally { this.matchers.release(matcher); } } /** Prepare patterns of PreparableMatchers. */ public void prepareMatchers() throws Exception { // Prepare the pattern for "**.source" this.matcher_N10191_expr = this.preparePattern("wildcard", "**.source"); // Prepare the pattern for "mount/*/**" this.matcher_N101A0_expr = this.preparePattern("wildcard", "mount/*/**"); // Prepare the pattern for "*" this.matcher_N101AC_expr = this.preparePattern("wildcard", "*"); // Prepare the pattern for "*" this.matcher_N101AF_expr = this.preparePattern("sessionstate", "*"); // Prepare the pattern for "**/*.css" this.matcher_N101B7_expr = this.preparePattern("wildcard", "**/*.css"); // Prepare the pattern for "images/**.*" this.matcher_N101BF_expr = this.preparePattern("wildcard", "images/**.*"); // Prepare the pattern for "**/*.js" this.matcher_N101C7_expr = this.preparePattern("wildcard", "**/*.js"); // Prepare the pattern for "applets/**" this.matcher_N101CF_expr = this.preparePattern("wildcard", "applets/**"); // Prepare the pattern for "*/**" this.matcher_N101D7_expr = this.preparePattern("wildcard", "*/**"); } private final String contains_view(String labels, String cocoon_view) { final boolean debug_enabled = getLogger().isDebugEnabled(); if (debug_enabled) getLogger().debug("contains_view(\"" + labels + "\", \"" + cocoon_view + "\")"); StringTokenizer st = new StringTokenizer(labels, " ,", false); while (st.hasMoreTokens()) { String token = st.nextToken(); String view = (String) view_label_map.get(token); if (debug_enabled) getLogger().debug("contains_view: examining token \"" + token + "\" against view \"" + view + "\""); if (view != null && view.equals(cocoon_view)) { if (debug_enabled) getLogger().debug("contains_view: view \"" + view + "\" selected"); return view; } } return null; } private final boolean call_view(String view_name, StreamPipeline pipeline, EventPipeline eventPipeline, List listOfMaps, Environment environment, boolean internalRequest) throws Exception { if (getLogger().isDebugEnabled()) getLogger().debug("call_view(\"" + view_name + "\")"); return internalRequest; } /** * Process to producing the output to the specified <code>OutputStream</code>. */ public final boolean process(Environment environment) throws Exception { /* the <code>EventPipeline</code> is used to collect the xml producing sitemap components and the <code>StreamPipeline</code> to produce the requested resource */ EventPipeline eventPipeline = null; StreamPipeline pipeline = null; boolean result = false; try { try { eventPipeline = (EventPipeline) this.manager.lookup( EventPipeline.ROLE); pipeline = (StreamPipeline) this.manager.lookup( StreamPipeline.ROLE); pipeline.setEventPipeline(eventPipeline); } catch (Exception e) { getLogger().error("Processing of resource failed", e); throw e; } result = process (environment, pipeline, eventPipeline, false); } finally { if (eventPipeline != null) this.manager.release(eventPipeline); if (pipeline != null) this.manager.release(pipeline); } return result; } /** * Process to producing the output to the specified <code>OutputStream</code>. */ public final boolean process(Environment environment, StreamPipeline pipeline, EventPipeline eventPipeline) throws Exception { getLogger().debug("Processing internal sitemap request"); return process (environment, pipeline, eventPipeline, true); } /** * Process to producing the output to the specified <code>OutputStream</code>. */ private final boolean process(Environment environment, StreamPipeline pipeline, EventPipeline eventPipeline, boolean internalRequest) throws Exception { // set the correct component manager pipeline.recompose(this.manager); eventPipeline.recompose(this.manager); /* the <code>List</code> objects to hold the replacement values delivered from matchers and selectors to replace occurences of XPath kind expressions in values of src attribute used with generate and transform elements */ List listOfMaps = (List) new ArrayList(); Map map; Map objectModel = environment.getObjectModel(); String cocoon_view = environment.getView(); String cocoon_action = environment.getAction(); final boolean debug_enabled = getLogger().isDebugEnabled(); //Adds Constants.NOTIFYING_OBJECT to ObjectModel //NKB FIXME add to ObjectModel? objectModel.put(Constants.NOTIFYING_OBJECT, new SimpleNotifyingBean(this)); SitemapRedirector redirector = new SitemapRedirector(environment); //line numbers not supported with xalan try { // method for handling "**.source" if (matchN10191(redirector, environment, pipeline, eventPipeline, internalRequest, listOfMaps)) return true; } catch (ConnectionResetException cre) { // Will be reported by CocoonServlet, rethrowing throw cre; } catch (ResourceNotFoundException e) { // Will be reported by CocoonServlet, rethrowing if (true) throw e; } catch (Exception e) { if (getLogger().isErrorEnabled()) getLogger().error("Sitemap", e); if (true) throw e; } //line numbers not supported with xalan try { // method for handling "mount/*/**" if (matchN101A0(redirector, environment, pipeline, eventPipeline, internalRequest, listOfMaps)) return true; } catch (ConnectionResetException cre) { // Will be reported by CocoonServlet, rethrowing throw cre; } catch (ResourceNotFoundException e) { // Will be reported by CocoonServlet, rethrowing if (true) throw e; } catch (Exception e) { if (getLogger().isErrorEnabled()) getLogger().error("Sitemap", e); if (true) throw e; } //line numbers not supported with xalan try { // method for handling "*" if (matchN101AC(redirector, environment, pipeline, eventPipeline, internalRequest, listOfMaps)) return true; throw new ResourceNotFoundException( "No pipeline matched request: " + environment.getURIPrefix() + '/'+environment.getURI()); } catch (ConnectionResetException cre) { // Will be reported by CocoonServlet, rethrowing throw cre; } catch (ResourceNotFoundException e) { // Will be reported by CocoonServlet, rethrowing if (true) throw e; } catch (Exception e) { if (getLogger().isErrorEnabled()) getLogger().error("Sitemap", e); if (true) throw e; } return false; } //line numbers not supported with xalan// method for handling "**.source" private final boolean matchN10191(SitemapRedirector redirector, Environment environment, StreamPipeline pipeline, EventPipeline eventPipeline, boolean internalRequest, List listOfMaps) throws ConnectionResetException, ResourceNotFoundException, Exception { Map map; Parameters param; Map objectModel = environment.getObjectModel(); String cocoon_view = environment.getView(); String cocoon_action = environment.getAction(); final boolean debug_enabled = getLogger().isDebugEnabled(); if ((map = matches("wildcard", matcher_N10191_expr, "**.source", Parameters.EMPTY_PARAMETERS, objectModel)) != null) { if (debug_enabled) getLogger().debug("Matched wildcard pattern **.source"); listOfMaps.add (map); this.dumpParameters(listOfMaps); getLogger().debug("Component generator:file(Parameters.EMPTY_PARAMETERS)"); if (debug_enabled) getLogger().debug("Source= " + substitute(listOfMaps, "cocoon:/{1}")); eventPipeline.setGenerator ("file", substitute(listOfMaps, "cocoon:/{1}"), Parameters.EMPTY_PARAMETERS); { String view_name = null; if ((view_name = contains_view("content", cocoon_view)) != null) { return call_view(view_name, pipeline, eventPipeline, listOfMaps, environment, internalRequest); } } getLogger().debug("Component transformer:xslt(Parameters.EMPTY_PARAMETERS)"); if (debug_enabled) getLogger().debug("Source= " + "stylesheets/simple-xml2html.xsl"); eventPipeline.addTransformer ("xslt", "stylesheets/simple-xml2html.xsl", Parameters.EMPTY_PARAMETERS); // performing link translation if (environment.getObjectModel().containsKey( Constants.LINK_OBJECT)) { eventPipeline.addTransformer ("!link-translator!", null, Parameters.EMPTY_PARAMETERS); } getLogger().debug("Component serializer:html(Parameters.EMPTY_PARAMETERS)"); pipeline.setSerializer ("html", null, Parameters.EMPTY_PARAMETERS); if (!internalRequest) { return pipeline.process(environment); } if (true) return true; listOfMaps.remove (listOfMaps.size() - 1); this.dumpParameters(listOfMaps); } return false; } //line numbers not supported with xalan// method for handling "mount/*/**" private final boolean matchN101A0(SitemapRedirector redirector, Environment environment, StreamPipeline pipeline, EventPipeline eventPipeline, boolean internalRequest, List listOfMaps) throws ConnectionResetException, ResourceNotFoundException, Exception { Map map; Parameters param; Map objectModel = environment.getObjectModel(); String cocoon_view = environment.getView(); String cocoon_action = environment.getAction(); final boolean debug_enabled = getLogger().isDebugEnabled(); if ((map = matches("wildcard", matcher_N101A0_expr, "mount/*/**", Parameters.EMPTY_PARAMETERS, objectModel)) != null) { if (debug_enabled) getLogger().debug("Matched wildcard pattern mount/*/**"); listOfMaps.add (map); this.dumpParameters(listOfMaps); if (internalRequest) return sitemapManager.invoke (this.manager, environment, substitute(listOfMaps, "mount/{1}"), substitute(listOfMaps, "mount/{1}/"), true, true, pipeline, eventPipeline); else if (true) return sitemapManager.invoke (this.manager, environment, substitute(listOfMaps, "mount/{1}"), substitute(listOfMaps, "mount/{1}/"), true, true); listOfMaps.remove (listOfMaps.size() - 1); this.dumpParameters(listOfMaps); } return false; } //line numbers not supported with xalan// method for handling "*" private final boolean matchN101AC(SitemapRedirector redirector, Environment environment, StreamPipeline pipeline, EventPipeline eventPipeline, boolean internalRequest, List listOfMaps) throws ConnectionResetException, ResourceNotFoundException, Exception { Map map; Parameters param; Map objectModel = environment.getObjectModel(); String cocoon_view = environment.getView(); String cocoon_action = environment.getAction(); final boolean debug_enabled = getLogger().isDebugEnabled(); if ((map = matches("wildcard", matcher_N101AC_expr, "*", Parameters.EMPTY_PARAMETERS, objectModel)) != null) { if (debug_enabled) getLogger().debug("Matched wildcard pattern *"); listOfMaps.add (map); this.dumpParameters(listOfMaps); param = new Parameters (); param.setParameter ("attribute-name", "user"); // handling "*" if ((map = matches("sessionstate", matcher_N101AF_expr, "*", param, objectModel)) != null) { if (debug_enabled) getLogger().debug("Matched sessionstate pattern *"); listOfMaps.add (map); this.dumpParameters(listOfMaps); // handling "**/*.css" if ((map = matches("wildcard", matcher_N101B7_expr, "**/*.css", Parameters.EMPTY_PARAMETERS, objectModel)) != null) { if (debug_enabled) getLogger().debug("Matched wildcard pattern **/*.css"); listOfMaps.add (map); this.dumpParameters(listOfMaps); getLogger().debug("Component reader:resource(Parameters.EMPTY_PARAMETERS)"); if (debug_enabled) getLogger().debug("Source= " + substitute(listOfMaps, "css/{2}.css")); getLogger().debug("Mime-type= text/css"); pipeline.setReader ("resource", substitute(listOfMaps, "css/{2}.css"), Parameters.EMPTY_PARAMETERS, "text/css"); if (!internalRequest) { return pipeline.process(environment); } if (true) return true; listOfMaps.remove (listOfMaps.size() - 1); this.dumpParameters(listOfMaps); } // handling "images/**.*" if ((map = matches("wildcard", matcher_N101BF_expr, "images/**.*", Parameters.EMPTY_PARAMETERS, objectModel)) != null) { if (debug_enabled) getLogger().debug("Matched wildcard pattern images/**.*"); listOfMaps.add (map); this.dumpParameters(listOfMaps); getLogger().debug("Component reader:resource(Parameters.EMPTY_PARAMETERS)"); if (debug_enabled) getLogger().debug("Source= " + substitute(listOfMaps, "images/{1}.{2}")); getLogger().debug("Mime-type= image/{2}"); pipeline.setReader ("resource", substitute(listOfMaps, "images/{1}.{2}"), Parameters.EMPTY_PARAMETERS, "image/{2}"); if (!internalRequest) { return pipeline.process(environment); } if (true) return true; listOfMaps.remove (listOfMaps.size() - 1); this.dumpParameters(listOfMaps); } // handling "**/*.js" if ((map = matches("wildcard", matcher_N101C7_expr, "**/*.js", Parameters.EMPTY_PARAMETERS, objectModel)) != null) { if (debug_enabled) getLogger().debug("Matched wildcard pattern **/*.js"); listOfMaps.add (map); this.dumpParameters(listOfMaps); getLogger().debug("Component reader:resource(Parameters.EMPTY_PARAMETERS)"); if (debug_enabled) getLogger().debug("Source= " + substitute(listOfMaps, "jscript/{2}.js")); getLogger().debug("Mime-type= text/javascript"); pipeline.setReader ("resource", substitute(listOfMaps, "jscript/{2}.js"), Parameters.EMPTY_PARAMETERS, "text/javascript"); if (!internalRequest) { return pipeline.process(environment); } if (true) return true; listOfMaps.remove (listOfMaps.size() - 1); this.dumpParameters(listOfMaps); } // handling "applets/**" if ((map = matches("wildcard", matcher_N101CF_expr, "applets/**", Parameters.EMPTY_PARAMETERS, objectModel)) != null) { if (debug_enabled) getLogger().debug("Matched wildcard pattern applets/**"); listOfMaps.add (map); this.dumpParameters(listOfMaps); getLogger().debug("Component reader:resource(Parameters.EMPTY_PARAMETERS)"); if (debug_enabled) getLogger().debug("Source= " + substitute(listOfMaps, "applets/{1}")); getLogger().debug("Mime-type= application/octet-stream"); pipeline.setReader ("resource", substitute(listOfMaps, "applets/{1}"), Parameters.EMPTY_PARAMETERS, "application/octet-stream"); if (!internalRequest) { return pipeline.process(environment); } if (true) return true; listOfMaps.remove (listOfMaps.size() - 1); this.dumpParameters(listOfMaps); } // handling "*/**" if ((map = matches("wildcard", matcher_N101D7_expr, "*/**", Parameters.EMPTY_PARAMETERS, objectModel)) != null) { if (debug_enabled) getLogger().debug("Matched wildcard pattern */**"); listOfMaps.add (map); this.dumpParameters(listOfMaps); if (internalRequest) return sitemapManager.invoke (this.manager, environment, substitute(listOfMaps, "{1}"), substitute(listOfMaps, "{1}/"), true, true, pipeline, eventPipeline); else if (true) return sitemapManager.invoke (this.manager, environment, substitute(listOfMaps, "{1}"), substitute(listOfMaps, "{1}/"), true, true); listOfMaps.remove (listOfMaps.size() - 1); this.dumpParameters(listOfMaps); } listOfMaps.remove (listOfMaps.size() - 1); this.dumpParameters(listOfMaps); }
msg20206/pgp00000.pgp
Description: PGP signature