cziegeler 2002/09/25 06:30:13 Modified: src/webapp/samples/portal sitemap.xmap src/java/org/apache/cocoon/transformation CIncludeTransformer.java src/webapp/samples/portal/resources roleprofile.xml Log: Fixing ignoreErrors and updating first sample Revision Changes Path 1.8 +2 -0 xml-cocoon2/src/webapp/samples/portal/sitemap.xmap Index: sitemap.xmap =================================================================== RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/portal/sitemap.xmap,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- sitemap.xmap 23 Sep 2002 11:41:40 -0000 1.7 +++ sitemap.xmap 25 Sep 2002 13:30:13 -0000 1.8 @@ -130,12 +130,14 @@ <map:match pattern="sunspotdemoresource-save*"> <map:generate src="resources/save{1}.xml"/> <map:transform type="session"/> + <map:transform type="cinclude"/> <map:transform type="write-source"/> <map:serialize type="xml"/> </map:match> <map:match pattern="sunspotdemoresource-*"> <map:generate src="resources/{1}.xml"/> <map:transform type="session"/> + <map:transform type="cinclude"/> <map:transform type="write-source"/> <map:transform src="styles/portal.xsl"/> <map:serialize type="xml"/> 1.14 +29 -2 xml-cocoon2/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java Index: CIncludeTransformer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- CIncludeTransformer.java 25 Sep 2002 12:14:50 -0000 1.13 +++ CIncludeTransformer.java 25 Sep 2002 13:30:13 -0000 1.14 @@ -85,6 +85,27 @@ * <code>prefix</code> it is possible to specify an element * which surrounds the included content. * + * This transformer also supports a more verbose but flexible version: + * <cinclude:includexml xmlns:cinclude="http://apache.org/cocoon/include/1.0" ignoreErrors="false"> + * <cinclude:src>THE SRC URI</cinclude:src> + * <!-- This is an optional configuration block --> + * <cinclude:configuration> + * <!-- For example if you want to make a HTTP POST --> + * <cinclude:parameter> + * <cinclude:name>method</cinclude:name> + * <cinclude:value>POST</cinclude:value> + * </cinclude:parameter> + * </cinclude:configuration> + * <!-- The following are optional parameters appended to the URI --> + * <cinclude:parameters> + * <cinclude:parameter> + * <cinclude:name>a name</cinclude:name> + * <cinclude:value>a value</cinclude:value> + * </cinclude:parameter> + * <!-- more can follow --> + * </cinclude:parameters> + * </cinclude:includexml> + * * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> * @author <a href="mailto:[EMAIL PROTECTED]">Andrew C. Oliver</a> * @version CVS $Id$ @@ -240,7 +261,13 @@ SourceUtil.toSAX(source, this.xmlConsumer, manager, this.configurationParameters, true); } catch (SourceException se) { - throw SourceUtil.handle(se); + if (!ignoreErrors) throw SourceUtil.handle(se); + } catch (SAXException se) { + if (!ignoreErrors) throw se; + } catch (IOException ioe) { + if (!ignoreErrors) throw ioe; + } catch (ProcessingException pe) { + if (!ignoreErrors) throw pe; } finally { this.resolver.release(source); } 1.2 +7 -8 xml-cocoon2/src/webapp/samples/portal/resources/roleprofile.xml Index: roleprofile.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/src/webapp/samples/portal/resources/roleprofile.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- roleprofile.xml 3 Jun 2002 11:45:53 -0000 1.1 +++ roleprofile.xml 25 Sep 2002 13:30:13 -0000 1.2 @@ -1,11 +1,10 @@ <?xml version="1.0"?> <!-- $Id$ - + Try to include the corresponding role profile --> -<roledelta> -<session:include xmlns:session="http://cocoon.apache.org/session/1.0" ignoreErrors="true"> - <session:connection> - <session:target>profiles/roleprofile-<session:getxml context="request" path="/parameter/role"/>.xml</session:target> - </session:connection> -</session:include> +<roledelta xmlns:session="http://cocoon.apache.org/session/1.0" + xmlns:cinclude="http://apache.org/cocoon/include/1.0"> + <cinclude:includexml ignoreErrors="true"> + <cinclude:src>profiles/roleprofile-<session:getxml context="request" path="/parameter/role"/>.xml</cinclude:src> + </cinclude:includexml> </roledelta>
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]