Hello!

thanks for your answer. I'd prefer to use the version 2.0.1 for this
application, because maybe there are some other problems rising when i
switch the cocoon version during development... ;-)

i have attached the error message, the sitemap and the compiled sitemap.
i have also to tell that im not a very indepth cocoon developer so the
error messages are looking very strange to me :o)

thx, Chris

btw: if i want to use newer matchers where are the directories in which
i find the nessesary files to change? is the stuff in
org/apache/cocoon/matching the right place to change the class files?

On Wed, Nov 06, 2002 at 07:45:51PM +0100, Christian Haul wrote:
> 
> On 06.Nov.2002 -- 02:52 PM, Christian Joelly wrote:
> > Hello all!
> > 
> > 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:
> 
> Hi. Without the exact error message it is difficult to help. You say
> you're on 2.0.1 and can't go to 2.0.3. Try copying the java class from
> a newer version and rebuild. AFAIR it is rather self-contained. It
> might be necessary to copy all matchers if your version still uses
> matcher factories.
> 
> With the upcoming 2.0.4 version we have a better way to match for
> session attributes. You should really consider that.

-- 
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
------------------------------------------------------------------------

2002-11-06 18:06:19 - path="/knapp" :DEBUG   (2002-11-06) 18:06.19:272   [cocoon  ] 
(/knapp/reports/) Thread-37/LogKitLogger: Returning a 
org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage to the pool

2002-11-06 18:06:19 - path="/knapp" :ERROR   (2002-11-06) 18:06.19:278   [root    ] 
(/knapp/reports/) Thread-37/CocoonServlet: Problem with servlet
org.apache.cocoon.ProcessingException: Language Exception: 
org.apache.cocoon.components.language.LanguageException: Error compiling sitemap_xmap:
Line 1704, column 78: 
Line 1703, column 7: 
Line 1487, column 76: 
Line 1486, column 5: 
Line 1478, column 40: 
Line 62, column 51: 
        at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.createResource(ProgramGeneratorImpl.java:285)
        at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:196)
        at org.apache.cocoon.sitemap.Handler.run(Handler.java:228)
        at java.lang.Thread.run(Thread.java:484)
org.apache.cocoon.components.language.LanguageException: Error compiling sitemap_xmap:
Line 1704, column 78: 
Line 1703, column 7: 
Line 1487, column 76: 
Line 1486, column 5: 
Line 1478, column 40: 
Line 62, column 51: 
        at 
org.apache.cocoon.components.language.programming.java.JavaLanguage.compile(JavaLanguage.java:205)
        at 
org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:140)
        at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:332)
        at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.createResource(ProgramGeneratorImpl.java:282)
        at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:196)
        at org.apache.cocoon.sitemap.Handler.run(Handler.java:228)
        at java.lang.Thread.run(Thread.java:484)
org.apache.cocoon.components.language.LanguageException: Error compiling sitemap_xmap:
Line 1704, column 78: 
Line 1703, column 7: 
Line 1487, column 76: 
Line 1486, column 5: 
Line 1478, column 40: 
Line 62, column 51: 
        at 
org.apache.cocoon.components.language.programming.java.JavaLanguage.compile(JavaLanguage.java:205)
        at 
org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage.load(CompiledProgrammingLanguage.java:140)
        at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.generateResource(ProgramGeneratorImpl.java:332)
        at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.createResource(ProgramGeneratorImpl.java:282)
        at 
org.apache.cocoon.components.language.generator.ProgramGeneratorImpl.load(ProgramGeneratorImpl.java:196)
        at org.apache.cocoon.sitemap.Handler.run(Handler.java:228)
        at java.lang.Thread.run(Thread.java:484)

2002-11-06 18:06:19 - path="/knapp" :INFO    (2002-11-06) 18:06.19:447   [root    ] 
(/knapp/reports/) Thread-37/CocoonServlet: 'reports/' Processed by Apache Cocoon 2.0.1 
in 23.136 seconds.
<?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>
   </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:match pattern="**">
                <map:redirect uri="login/login.xml"/>
          </map:match>
        </map:match>

  </map:pipeline>

 </map:pipelines>

</map:sitemap>

<!-- end of file -->

Attachment: sitemap_xmap.java.gz
Description: Binary data

Attachment: msg20227/pgp00000.pgp
Description: PGP signature

Reply via email to