You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Kristian Rink <kr...@pm-planc.de> on 2005/11/22 13:11:13 UTC

xhtml templating?

Hi all;

after getting my feet wet with lenya, right now I am trying to do
something "productive", yet I fail. At the moment, I am trying to get
lenya to use my XHTML template for site output according to the tutorial
posted at

http://wiki.apache.org/lenya/HowToXHTMLTemplating

but this fails like that:

org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
java.lang.RuntimeException: java.lang.RuntimeException:
java.lang.RuntimeException: java.lang.NullPointerException
	at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:588)
	at
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:183)
	at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:789)
	at
org.apache.cocoon.components.source.impl.SitemapSource.toSAX(SitemapSource.java:412)
	at org.apache.cocoon.components.source.SourceUtil.toSAX(SourceUtil.java:98)
	at
org.apache.cocoon.components.source.SourceUtil.parse(SourceUtil.java:318)
	at
org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:115)
	at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:581)
	at
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:183)
	at
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:483)
[snipped]



So, basically, two questions:

(a) Can anyone enlighten me where this error arises from and how to deal
with it?

(b), more generally: Are there any pieces of documentation besides that
Wiki entry on how to use XHTML templates within lenya? Reading through
that didn't make things clear too much for me, and asking google also
ain't really successful...

TIA and bye,
Kris

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


RE: Lenya 1.2, Kupu, BXE and image alignment

Posted by Richard Schottdorf <sc...@screenwave.de>.
 
Hi,

I made it quite a while ago to get an ID attribute for my objects on my
windows production server.
But as soon as I put my publications on the linux server the id attribute
for objects is not available.

The modifications described by Jon are made. Has anyone any idea how I may
fix this problem?

Greetings
Richard


> Hi,
>
> I seem to be unable to insert images into the Default publication
> of a lenya 1.2.x SVN checkout from about 2 weeks ago.
>
> In Kupu, I have the choice between left, right and inline, but
> neither as any effect - after saving, the image has no class- or
> align-attribute.
>
> In BXE, the image object has a lot of attributes, but again
> neither class nor align. So again, no chance to align it somehow.
>
> Am I doing something wrong? The wish to align an image seems
> rather basic to me, so I am puzzled...
>
> Have a nice weekend

Yeah, I found this out the hard way myself.  Here's what I did to
fix it:

1.  Go to lenya/resources/kupu/apache-lenya/lenya/ and edit the
file kupusave.xsl.  You should see a chunk like the following:

<!-- this template converts the img tag to object
  for more, see http://www.xml.com/pub/a/2003/07/02/dive.html -->
<xsl:template match="xhtml:img">
   <object>
     <xsl:attribute name="data">

Towards the bottom, you'll see a couple of <xsl:if> statements
for the attributes @height and @width.  Copy one of them as a
template and replace it with @class.  So your bottom section will
look like this:

         <xsl:if test="string(@height)">
          <xsl:attribute name="height">
            <xsl:value-of select="@height"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:if test="string(@width)">
          <xsl:attribute name="width">
            <xsl:value-of select="@width"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:if test="string(@class)">
          <xsl:attribute name="class">
            <xsl:value-of select="@class"/>
          </xsl:attribute>
        </xsl:if>

Save the file.

2.  You'll see something similar in a file called content2edit.xsl,
which is in the same directory as number 1.  Make the same change
by adding in a check for the class attribute.  Save.

3.  Lastly, you'll need to go into each publication you have and
edit the file xslt/xhtml2xhtml.xsl.  Take a look at the patch of
XSL that starts like this:

   <xsl:template name="object2img">
      <img border="0">
        <xsl:attribute name="src">
          <xsl:choose>
            <xsl:when test="not(starts-with(@data, '/'))">

First off, I like removing the border="0" attribute from the image
tag above.  I don't like the assumption that it needs to be there.
I just like assigning a class to the image and assuming that the
CSS will handle whether or not a border exists.

Secondly, just like you did with the above two points, add a new
section for @class.  You can copy one of the <xsl:if> statements
from @height and @width as templates.  Save.

Now you're all set to have classes assigned to your image when you
save out of Kupu (and presumably Bitflux).  If you don't like the
default class names that Kupu uses, then you can go into the files
lenya/resources/kupu/common/kupubasetools.js and
lenya/resources/kupu/common/kupudrawers/drawer.xsl and search for
the default class names of "image-left", "image-right", and
"image-inline" and replace them with whatever you choose.  Be sure
to add the classes you create in your CSS so that they float
properly and have the appropriate styles.

Hope this helps!
Jon


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: xhtml templating?

Posted by Doug Chestnut <dh...@virginia.edu>.
Hi Kris,

Kristian Rink wrote:
> Hi all;
> 
> after getting my feet wet with lenya, right now I am trying to do
> something "productive", yet I fail. At the moment, I am trying to get
> lenya to use my XHTML template for site output according to the tutorial
> posted at
> 
> http://wiki.apache.org/lenya/HowToXHTMLTemplating
> [...]
> 
> So, basically, two questions:
> 
> (a) Can anyone enlighten me where this error arises from and how to deal
> with it?
Don't really know what is causing the error.  I will take a look today 
and see if I can implement the steps in the wiki [if so I will send you 
a patch].

> 
> (b), more generally: Are there any pieces of documentation besides that
> Wiki entry on how to use XHTML templates within lenya? Reading through
> that didn't make things clear too much for me, and asking google also
> ain't really successful...

http://lenya.apache.org/1_2_x/components/layout/xhtml-templating.html
> 
> TIA and bye,
> Kris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
> 
> 


--Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org