home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / flow.xmap < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  4.3 KB  |  122 lines

  1. <?xml version="1.0"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17.  
  18. <!--+
  19.     | Authentication (with flow) block samples sitemap.
  20.     |
  21.     | CVS $Id: flow.xmap,v 1.6 2004/03/06 02:26:17 antonio Exp $
  22.     +-->
  23.  
  24. <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
  25.  
  26.   <map:flow language="javascript">
  27.      <map:script src="flow/sample.js"/>
  28.   </map:flow>
  29.  
  30. <!-- =========================== Pipelines ================================= -->
  31.   <map:pipelines>
  32.     <map:component-configurations>
  33.       <authentication-manager>
  34.         <handlers>
  35.           <handler name="flowdemohandler">
  36.             <redirect-to uri="cocoon:/login"/>
  37.             <authentication uri="cocoon:raw:/authenticate"/>
  38.           </handler>
  39.         </handlers>
  40.       </authentication-manager>
  41.     </map:component-configurations>
  42.  
  43.     <map:pipeline>
  44.       <map:match pattern="">
  45.         <map:redirect-to uri="login" session="true"/>
  46.       </map:match>
  47.  
  48.       <!-- ================= -->
  49.       <!-- Simple login page -->
  50.       <!-- ================= -->
  51.       <map:match pattern="login">
  52.         <map:call function="isLoggedIn">
  53.           <map:parameter name="handler" value="flowdemohandler"/>
  54.           <map:parameter name="protected-redirect" value="protected"/>
  55.           <map:parameter name="failure-internal" value="internal/login"/>
  56.         </map:call>
  57.       </map:match>
  58.  
  59.       <!-- ========================================= -->
  60.       <!-- Form target which performs auth service   -->
  61.       <!-- ========================================= -->
  62.       <map:match pattern="do-login">
  63.         <!-- try to login -->
  64.         <map:call function="login">
  65.           <map:parameter name="handler" value="flowdemohandler"/>
  66.           <map:parameter name="parameter_name" value="{request-param:username}"/>
  67.           <map:parameter name="protected-redirect" value="protected"/>
  68.           <map:parameter name="failure-redirect" value="login"/>
  69.         </map:call>
  70.       </map:match>
  71.  
  72.       <!-- ================ -->
  73.       <!-- Protected area   -->
  74.       <!-- ================ -->
  75.       <map:match pattern="protected">
  76.         <map:call function="protect">
  77.           <map:parameter name="handler" value="flowdemohandler"/>
  78.           <map:parameter name="protected-internal" value="internal/protected"/>
  79.           <map:parameter name="failure-redirect" value="login"/>
  80.         </map:call>
  81.       </map:match>
  82.  
  83.       <!-- ========================================= -->
  84.       <!-- Logout link which invalidates the session -->
  85.       <!-- ========================================= -->
  86.       <map:match pattern="do-logout">
  87.         <map:call function="logout">
  88.           <map:parameter name="handler" value="flowdemohandler"/>
  89.           <map:parameter name="failure-redirect" value="login"/>
  90.         </map:call>
  91.       </map:match>
  92.     </map:pipeline>
  93.  
  94.     <map:pipeline internal-only="true">
  95.       <!-- This is the authentication resource -->
  96.       <map:match pattern="authenticate">
  97.         <map:generate src="docs/userlist.xml"/>
  98.         <map:transform src="stylesheets/authenticate.xsl">
  99.           <map:parameter name="use-request-parameters" value="true"/>
  100.         </map:transform>
  101.         <map:serialize type="xml"/>
  102.       </map:match>
  103.  
  104.       <map:match pattern="internal/login">
  105.         <map:generate src="docs/login.xml"/>
  106.         <map:transform src="stylesheets/simple-page2html.xsl"/>
  107.         <map:transform type="encodeURL"/>
  108.         <map:serialize/>
  109.       </map:match>
  110.       
  111.       <map:match pattern="internal/protected">
  112.         <map:generate src="docs/protected.xml"/>
  113.         <map:transform type="session"/>
  114.         <map:transform src="stylesheets/simple-page2html.xsl"/>
  115.         <map:transform type="encodeURL"/>
  116.         <map:serialize/>
  117.       </map:match>
  118.     </map:pipeline>  
  119.  
  120.   </map:pipelines>
  121. </map:sitemap>
  122.