stephan 2002/09/25 02:02:51 Modified: . build.xml changes.xml module.xml properties.xml src/scratchpad/webapp/samples/slide login-failed.html login.html principal2auth.xsl sitemap.xmap Added: src/blocks/jfor/conf jfor.xmap src/blocks/jfor/java/org/apache/cocoon/serialization RTFSerializer.java src/blocks/swf/conf swf.xmap src/blocks/swf/java/org/apache/cocoon/serialization SWFSerializer.java Removed: src/java/org/apache/cocoon/serialization RTFSerializer.java SWFSerializer.java jfor.xmap swf.xmap src/scratchpad/lib jta.jar Log: Enabled the RTF and SWF Serializer as blocks. Removed the Java Transaction lib, because the SUN licence isn't compatible with the Apache licence. So I made the Slide classes optional. Also changed some thing on login part of the Slide examples, which doesn't work anymore. Why? ... I don't know :-/ Revision Changes Path 1.266 +21 -1 xml-cocoon2/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/build.xml,v retrieving revision 1.265 retrieving revision 1.266 diff -u -r1.265 -r1.266 --- build.xml 23 Sep 2002 08:18:16 -0000 1.265 +++ build.xml 25 Sep 2002 09:02:50 -0000 1.266 @@ -462,6 +462,10 @@ <available classpathref="classpath" property="activation.present" classname="javax.activation.DataSource"/> + + <available classpathref="classpath" + property="transaction.present" + classname="javax.transaction.Transaction"/> </target> <target name="prepare-jdbc" depends="filter-jdbc,nofilter-jdbc"/> @@ -751,11 +755,22 @@ </antcall> </target> + <!-- Outputs a warning if javax.transaction.* classes are missing during compilation --> + <target name="transaction-warn" unless="transaction.present" depends="optional-tests"> + <antcall target="op-warning"> + <param name="thing" value="Transaction"/> + <param name="recovery" + value="Get the SUN Java Transaction package and place the jar in the lib/local dir"/> + <param name="message" + value="The SUN Java Transaction package is required for the Slide classes"/> + </antcall> + </target> + <!-- =================================================================== --> <!-- Print out warnings for optional components --> <!-- =================================================================== --> <target name="optional-warnings" - depends="bsf-warn, rhino-warn, jfor-warn, xmldb-warn, php-warn, naming-warn, svg-warn, tidy-warn, maybeupload-warn, lucene-warn, deli-warn, velocity-warn, hsqldb-warn, resolver-warn, jisp-warn, pizza-warn, poi-warn, commons-logging-warn, jxpath-warn, httpclient-warn, activation-warn"> + depends="bsf-warn, rhino-warn, jfor-warn, xmldb-warn, php-warn, naming-warn, svg-warn, tidy-warn, maybeupload-warn, lucene-warn, deli-warn, velocity-warn, hsqldb-warn, resolver-warn, jisp-warn, pizza-warn, poi-warn, commons-logging-warn, jxpath-warn, httpclient-warn, activation-warn, transaction-warn"> </target> @@ -908,6 +923,9 @@ <exclude name="**/components/axis/**" unless="activation.present"/> <exclude name="**/reading/AxisRPCReader.java" unless="activation.present"/> <exclude name="**/webservices/**" unless="activation.present"/> + + <exclude name="**/Slide*" unless="transaction.present"/> + <exclude name="**/slide*" unless="transaction.present"/> </fileset> </copy> </target> @@ -1355,6 +1373,8 @@ <fileset dir="${scratchpad.lib}"> <include name="*.jar"/> <exclude name="servlet*.jar"/> + + <exclude name="slide*.jar" unless="transaction.present"/> </fileset> </copy> </target> 1.259 +4 -1 xml-cocoon2/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/changes.xml,v retrieving revision 1.258 retrieving revision 1.259 diff -u -r1.258 -r1.259 --- changes.xml 25 Sep 2002 07:37:36 -0000 1.258 +++ changes.xml 25 Sep 2002 09:02:50 -0000 1.259 @@ -40,6 +40,9 @@ </devs> <release version="@version@" date="@date@"> + <action dev="SMS" type="update" fixes-bug="12799" due-to="Philipp Schmidt" due-to-email="[EMAIL PROTECTED]"> + Enabled the RTF serializer and SWF serializer as block. + </action> <action dev="CZ" type="fix"> Fixed prefix mapping for the sql transformer. </action> 1.5 +40 -0 xml-cocoon2/module.xml Index: module.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/module.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- module.xml 17 Sep 2002 12:07:44 -0000 1.4 +++ module.xml 25 Sep 2002 09:02:50 -0000 1.5 @@ -135,6 +135,46 @@ to="[EMAIL PROTECTED]"/> </project> + + <project name="swf-block"> + <package>org.apache.cocoon</package> + + <ant target="block"> + <property name="block-name" value="swf"/> + </ant> + + <depend project="xml-cocoon2"/> + <depend project="swf" version="supplied"/> + + <work nested="tools/anttasks"/> + <home nested="build/cocoon"/> + + <jar name="swf-block.jar"/> + + <nag from="Nicola Ken Barozzi <[EMAIL PROTECTED]>" + to="[EMAIL PROTECTED]"/> + + </project> + + <project name="jfor-block"> + <package>org.apache.cocoon</package> + + <ant target="block"> + <property name="block-name" value="jfor"/> + </ant> + + <depend project="xml-cocoon2"/> + <depend project="jfor" version="supplied"/> + + <work nested="tools/anttasks"/> + <home nested="build/cocoon"/> + + <jar name="jfor-block.jar"/> + + <nag from="Nicola Ken Barozzi <[EMAIL PROTECTED]>" + to="[EMAIL PROTECTED]"/> + + </project> <project name="jisp"> <url href="http://www.coyotegulch.com/jisp/"/> 1.5 +2 -0 xml-cocoon2/properties.xml Index: properties.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/properties.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- properties.xml 17 Sep 2002 12:07:44 -0000 1.4 +++ properties.xml 25 Sep 2002 09:02:50 -0000 1.5 @@ -104,6 +104,8 @@ <fop include="true"/> <batik include="true"/> <chaperon include="true"/> + <jfor include="true"/> + <swf include="true"/> </blocks> </cocoon> 1.1 xml-cocoon2/src/blocks/jfor/conf/jfor.xmap Index: jfor.xmap =================================================================== <?xml version="1.0"?> <xmap xpath="/sitemap/components/serializers" unless="serializer[@name='fo2rtf']"> <map:serializer name="fo2rtf" src="org.apache.cocoon.serialization.RTFSerializer" mime-type="application/msword"/> </xmap> 1.1 xml-cocoon2/src/blocks/jfor/java/org/apache/cocoon/serialization/RTFSerializer.java Index: RTFSerializer.java =================================================================== /* ============================================================================ The Apache Software License, Version 1.1 ============================================================================ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the Apache Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4. The names "Apache Cocoon" and "Apache Software Foundation" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact [EMAIL PROTECTED] 5. Products derived from this software may not be called "Apache", nor may "Apache" appear in their name, without prior written permission of the Apache Software Foundation. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This software consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation and was originally created by Stefano Mazzocchi <[EMAIL PROTECTED]>. For more information on the Apache Software Foundation, please see <http://www.apache.org/>. */ package org.apache.cocoon.serialization; import java.net.URL; import java.net.MalformedURLException; import org.apache.avalon.framework.component.ComponentException; import org.apache.avalon.framework.component.ComponentManager; import org.apache.avalon.framework.component.Composable; import org.apache.avalon.framework.logger.LogEnabled; import org.jfor.jfor.converter.Converter; import javax.xml.transform.OutputKeys; import javax.xml.transform.sax.TransformerHandler; import javax.xml.transform.stream.StreamResult; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Writer; import java.io.BufferedWriter; import org.xml.sax.SAXException; import org.xml.sax.Attributes; import org.xml.sax.helpers.AttributesImpl; /** * This class uses the <a href="http://www.jfor.org">jfor</a> library * to serialize XSL:FO documents to RTF streams. * * @author <a href="mailto:[EMAIL PROTECTED]">Gianugo Rabellino</a> * @version CVS $Id: RTFSerializer.java,v 1.1 2002/09/25 09:02:50 stephan Exp $ */ public class RTFSerializer extends AbstractTextSerializer implements Composable, LogEnabled { private Writer rtfWriter = null; private Converter handler = null; private ComponentManager manager = null; /** * Set the current <code>ComponentManager</code> instance used by this * <code>Composable</code>. */ public void compose(ComponentManager manager) { this.manager = manager; } /** * Set the OutputStream where the serializer will write to. * * @param out the OutputStream */ public void setOutputStream(OutputStream out) { try { rtfWriter = new BufferedWriter(new OutputStreamWriter(out, "ISO-8859-1")); // FIXME Find a way to work with the org.apache.avalon.framework.logger.Logger handler = new Converter(rtfWriter, Converter.createConverterOption(System.out)); super.setContentHandler(handler); } catch (Exception e) { getLogger().error("RTFSerializer.setOutputStream()", e); throw new RuntimeException(e.toString()); } } /** * Recycle the serializer. GC instance variables */ public void recycle() { super.recycle(); rtfWriter = null; handler = null; } } 1.1 xml-cocoon2/src/blocks/swf/conf/swf.xmap Index: swf.xmap =================================================================== <?xml version="1.0"?> <xmap xpath="/sitemap/components/serializers" unless="serializer[@name='swf']"> <map:serializer name="swf" src="org.apache.cocoon.serialization.SWFSerializer" mime-type="application/x-shockwave-flash"/> </xmap> 1.1 xml-cocoon2/src/blocks/swf/java/org/apache/cocoon/serialization/SWFSerializer.java Index: SWFSerializer.java =================================================================== /* ============================================================================ The Apache Software License, Version 1.1 ============================================================================ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the Apache Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4. The names "Apache Cocoon" and "Apache Software Foundation" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact [EMAIL PROTECTED] 5. Products derived from this software may not be called "Apache", nor may "Apache" appear in their name, without prior written permission of the Apache Software Foundation. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This software consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation and was originally created by Stefano Mazzocchi <[EMAIL PROTECTED]>. For more information on the Apache Software Foundation, please see <http://www.apache.org/>. */ package org.apache.cocoon.serialization; import org.apache.cocoon.xml.XMLConsumer; import org.apache.avalon.framework.configuration.Configurable; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; import org.xml.sax.Attributes; import java.io.OutputStream; import de.tivano.flash.swf.publisher.SWFWriter; /** * uses the project http://developer.berlios.de/projects/spark-xml/ * * @author <a href="mailto:[EMAIL PROTECTED]">Torsten Curdt</a> */ public class SWFSerializer extends AbstractSerializer implements Configurable { private final static String mimeType = "application/x-shockwave-flash"; private SWFWriter handler; public void configure(Configuration configuration) throws ConfigurationException { getLogger().debug("configured the SWF serializer"); } public String getMimeType() { return(mimeType); } public void setOutputStream(OutputStream out) { handler = new SWFWriter(out); this.contentHandler = handler; } public void startDocument() throws SAXException { getLogger().debug("starting SWF document"); super.startDocument(); } public void startElement(String uri, String loc, String raw, Attributes a) throws SAXException { getLogger().debug("starting SWF element " + String.valueOf(raw)); super.startElement(uri, loc, raw, a); } } 1.5 +5 -1 xml-cocoon2/src/scratchpad/webapp/samples/slide/login-failed.html Index: login-failed.html =================================================================== RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/samples/slide/login-failed.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- login-failed.html 21 Aug 2002 07:44:34 -0000 1.4 +++ login-failed.html 25 Sep 2002 09:02:51 -0000 1.5 @@ -44,18 +44,22 @@ <form action="login" method="post"> <input type="hidden" name="resource" value="content/"/> + <tr> <td>Username</td> <td><input name="name" type="text" size="15" maxlength="40"/></td> </tr> + <tr> <td>Password</td> - <td><input name="password" type="password" size="15" maxlength="40"/></td> + <td><input name="pw" type="password" size="15" maxlength="40"/></td> </tr> + <tr> <td></td> <td><input type="submit" name="cocoon-login" value="Login"/></td> </tr> + <tr> <td></td> <td>Login failed!</td> 1.6 +5 -1 xml-cocoon2/src/scratchpad/webapp/samples/slide/login.html Index: login.html =================================================================== RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/samples/slide/login.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- login.html 21 Aug 2002 07:44:34 -0000 1.5 +++ login.html 25 Sep 2002 09:02:51 -0000 1.6 @@ -44,18 +44,22 @@ <form action="login" method="post"> <input type="hidden" name="resource" value="content/"/> + <tr> <td>Username</td> <td><input name="name" type="text" size="15" maxlength="40"/></td> </tr> + <tr> <td>Password</td> - <td><input name="password" type="password" size="15" maxlength="40"/></td> + <td><input name="pw" type="password" size="15" maxlength="40"/></td> </tr> + <tr> <td></td> <td><input type="submit" name="cocoon-login" value="Login"/></td> </tr> + <tr> <td></td> <td>Try root,root or john,john</td> 1.2 +3 -2 xml-cocoon2/src/scratchpad/webapp/samples/slide/principal2auth.xsl Index: principal2auth.xsl =================================================================== RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/samples/slide/principal2auth.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- principal2auth.xsl 8 Jul 2002 21:20:30 -0000 1.1 +++ principal2auth.xsl 25 Sep 2002 09:02:51 -0000 1.2 @@ -3,17 +3,18 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pl="http://xml.apache.org/cocoon/PrincipalListGenerator"> - <xsl:param name="password"/> + <xsl:param name="pw"/> <xsl:param name="name"/> <xsl:template match="pl:list"> <authentication> + <xsl:value-of select="$name"/>;<xsl:value-of select="$pw"/>; <xsl:apply-templates select="pl:principal"/> </authentication> </xsl:template> <xsl:template match="pl:principal"> - <xsl:if test="normalize-space(@pl:name) = $name and normalize-space(@pl:password) = $password"> + <xsl:if test="normalize-space(@pl:name) = $name and normalize-space(@pl:password) = $pw"> <ID><xsl:value-of select="@pl:name"/></ID> <role><xsl:value-of select="@pl:role"/></role> </xsl:if> 1.15 +6 -0 xml-cocoon2/src/scratchpad/webapp/samples/slide/sitemap.xmap Index: sitemap.xmap =================================================================== RCS file: /home/cvs/xml-cocoon2/src/scratchpad/webapp/samples/slide/sitemap.xmap,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- sitemap.xmap 19 Aug 2002 17:32:15 -0000 1.14 +++ sitemap.xmap 25 Sep 2002 09:02:51 -0000 1.15 @@ -19,6 +19,7 @@ src="org.apache.cocoon.transformation.SourceWritingTransformer"/> <map:transformer logger="sitemap.transformer.xinclude" name="xinclude" src="org.apache.cocoon.transformation.XIncludeTransformer"/> + <map:transformer name="log" src="org.apache.cocoon.transformation.LogTransformer"/> </map:transformers> <map:serializers default="html"> @@ -99,6 +100,11 @@ <map:transform src="principal2auth.xsl"> <map:parameter name="use-request-parameters" value="true"/> + </map:transform> + + <map:transform type="log"> + <map:parameter name="logfile" value="slide.log"/> + <map:parameter name="append" value="no"/> </map:transform> <map:serialize type="xml"/>
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]