reinhard 2003/09/06 06:45:49
Added: src/blocks/scratchpad/samples/intercepted-flow aspects1.js
aspects2.js basescript.js sitemap.xmap
src/blocks/scratchpad/samples/intercepted-flow/screens
info.xsp
Log:
- inititial commit of intercepted flowscript samples
Revision Changes Path
1.1
cocoon-2.1/src/blocks/scratchpad/samples/intercepted-flow/aspects1.js
Index: aspects1.js
===================================================================
function call*() {
before(): {
cocoon.log.info( "before:call*" );
}
after(): {
cocoon.log.info( "after:call*" );
}
}
1.1
cocoon-2.1/src/blocks/scratchpad/samples/intercepted-flow/aspects2.js
Index: aspects2.js
===================================================================
function interception* {
before(): {
cocoon.log.info( "before:interception*" );
}
}
1.1
cocoon-2.1/src/blocks/scratchpad/samples/intercepted-flow/basescript.js
Index: basescript.js
===================================================================
// the applied scripts are called in the order found at the basescript
cocoon.apply( "aspects1.js" );
cocoon.apply( "aspects2.js" );
function interceptionTest() {
var uri = "page/info";
cocoon.log.error ( "interceptionTest - baseScript" );
callAnotherFunction();
cocoon.sendPageAndWait(uri, { });
}
function callAnotherFunction() {
cocoon.log.error ( "callAnotherFunction() - baseScript" );
}
1.1
cocoon-2.1/src/blocks/scratchpad/samples/intercepted-flow/sitemap.xmap
Index: sitemap.xmap
===================================================================
<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<!-- indicates what flowscript to attach to this sitemap -->
<map:flow language="intercepted-javascript">
<map:script src="basescript.js"/>
</map:flow>
<map:pipelines>
<map:pipeline>
<!--+
| produces the screens called by the flowscript
+-->
<map:match pattern="page/*">
<map:generate type="serverpages" src="screens/{1}.xsp"/>
<map:transform
src="context://samples/common/style/xsl/html/simple-page2html.xsl">
<map:parameter name="servletPath" value="{request:servletPath}"/>
<map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
<map:parameter name="contextPath" value="{request:contextPath}"/>
<map:parameter name="remove" value="{0}"/>
</map:transform>
<map:serialize/>
</map:match>
</map:pipeline>
<map:pipeline>
<map:match pattern="">
<map:call function="interceptionTest"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
1.1
cocoon-2.1/src/blocks/scratchpad/samples/intercepted-flow/screens/info.xsp
Index: info.xsp
===================================================================
<?xml version="1.0"?>
<!--+
| CVS: $Id: info.xsp,v 1.1 2003/09/06 13:45:49 reinhard Exp $
| Author: Reinhard Poetz "reinhard (at) apache.org"
| Date: March 23, 2002
+-->
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:jpath="http://apache.org/xsp/jpath/1.0">
<page>
<resources>
<resource type="file"
href="/samples/flow/calc/calc.js">Flowscript</resource>
</resources>
<title>Intercepted Flow</title>
<content>
<p>
Intercepted Flow. Check the flow logs (WEB-INF/log/flow.log) for the
result flowscript.
</p>
</content>
</page>
</xsp:page>