Ok, I figured the SAXPIFilter out and made changes to allow stylesheet
to be optional in registry.
I didn't delete the part of throwing of exception when stylesheet
property not in registry (in CocoonPortlet.java), just commented it out
and added a comment about it. (I feel uneasy about deleting other
people's code...)

There is still the bug of resolving stylesheet names when referenced in
the XML file (mentioned that in another post). Now it is even more
visible...

Neeme

Index: cocoon/CocoonRenderer.java
===================================================================
RCS file:
/products/cvs/jetspeed/jetspeed/src/java/org/apache/jetspeed/portal/coco
on/CocoonRenderer.java,v
retrieving revision 1.21
diff -r1.21 CocoonRenderer.java
113c113
<         String stylesheet_pi = "<?xml-stylesheet href=\"" + stylesheet
+ "\" type=\"text/xsl\"?>";
---
>         boolean stripExistingPIs = (stylesheet != null);
115c115
<         SAXPIFilter filter = new SAXPIFilter( new PrintWriter(bos),
true );
---
>         SAXPIFilter filter = new SAXPIFilter( new PrintWriter(bos),
stripExistingPIs );
134c134,138
<         pis.append( stylesheet_pi + "\n");
---
>         if (stylesheet != null)
>         {
>             String stylesheet_pi = "<?xml-stylesheet href=\"" +
stylesheet + "\" type=\"text/xsl\"?>";
>             pis.append( stylesheet_pi + "\n");
>         }

Index: portlets/CocoonPortlet.java
===================================================================
RCS file:
/products/cvs/jetspeed/jetspeed/src/java/org/apache/jetspeed/portal/port
lets/CocoonPortlet.java,v
retrieving revision 1.28
diff -r1.28 CocoonPortlet.java
127,129c127,129
<     
<             //if it is still null somethign is wrong
<     
---
> 
>             //check removed, if null then stylesheet specified in the
XML file will be used
> /*
132,133c132,133
<             } 
<     
---
>             }
> */
136,148c136,149
<     
<             
<             try {
<                 stylesheet = JetspeedDiskCache.getInstance()
<                     .getEntry( stylesheet ).getURL();
<             } catch (IOException e) {
<                 Log.error( e );
<                 throw new PortletException( e.getMessage() );
<             }
<             
<             Log.note( "CocoonPortlet:  transforming " + 
<                        url + 
<                        " with stylesheet " + 
---
> 
> 
>             if (stylesheet != null)
>                 try {
>                     stylesheet = JetspeedDiskCache.getInstance()
>                         .getEntry( stylesheet ).getURL();
>                 } catch (IOException e) {
>                     Log.error( e );
>                     throw new PortletException( e.getMessage() );
>                 }
> 
>             Log.note( "CocoonPortlet:  transforming " +
>                        url +
>                        " with stylesheet " +



--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to