You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Remon <re...@interact.mobi> on 2008/12/10 15:25:30 UTC

WURFL + COCOON (WALL Serializer)

Hello All,

 

This is my first post to the list and I hope someone could light my way out
J.

 

I've developed a java package (Program) that accepts XML document as a
string or from URL, and convert the XML document to HTML/XHTML/WML/CHTML
according to the connected useragent in a way similar to WALL ( Based on
WURFL ), actually it is an update to wall tags.

 

The Library API accepts XML document in a string or URL format (which
returns XML document), and an HTTPServletRequest or PageContext and either
returns a HTTPServletResponse or directly write the ouput markup to the page
context.

 

What I need to do is developing a new cocoon Serializer called WALL to work
with my package. My Idea is to fetch XML from a source generator, transform
it using XSLT to my XML defined tags, pass it to the Developed serializer
for converting the XML and setting the document content type and generating
the text output.

 

I'm ready to contribute my source code to anybody who help me or may benefit
from this serializer later. Also I want to use cocoon 2.1.11 as this is the
one I'm using for production now.

 

Best Regards,

Remon Magdy


Re: WURFL + COCOON (WALL Serializer)

Posted by Luca Morandini <lm...@ieee.org>.
Remon wrote:
> Hi Luca,
> 
> I just want to integrate WALL in cocoon, I need to find a way to pass a
> universal markup (understood by my program) which is in XML format from
> cocoon XML transformer or generator to the custom serializer and let this
> serializer decides whether to serve the client with WML or HTML or CHTML ...
> 
> This means that the output markup and content type will be decided by the
> serializer.

Look, serializers are meant to be "dumb" components in Cocoon while the 
routing is done by the sitemap itself (or flowscript/javaflow).

If I were you I'd call the HTML (or WML) serializer from the sitemap 
itself using the browser seletor, hence dropping this logic from your 
package: this solution would add some flexibility and play on the 
existing Cocoon components.

The sitemap would look something like:
<map:match pattern="hello">
	<map:generate src="hello.xml"/>
	<map:transform type="wall"/>
	<map:select type="browser">
		<map:when test="wap-useragent">
			<map:serialize type="wml"/>
		</map:when>
		<map:otherwise>
			<map:serialize type="html"/>
		</map:otherwise>
	</map:select>
</map:match>

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


RE: WURFL + COCOON (WALL Serializer)

Posted by Remon <re...@interact.mobi>.
Hi Luca,

I just want to integrate WALL in cocoon, I need to find a way to pass a
universal markup (understood by my program) which is in XML format from
cocoon XML transformer or generator to the custom serializer and let this
serializer decides whether to serve the client with WML or HTML or CHTML ...

This means that the output markup and content type will be decided by the
serializer.

The idea is to separate the markup generated for mobile devices from the
markup generated by sources.

e.g. let's say the PIPE line goes as follows

XML received from transformer or generator is

<walldocument>
<wallxmlpidtd encoding="UTF-8"/>
<wallhead>
<walltitle enforce_title="true">
<walltext value="Test Page Title"/>
</walltitle>
</wallhead>
<wallbody>
<wallimg cach="true" src="http://l.yimg.com/a/i/us/uh/bt2/movies_logov1.gif"
alt="Test Image"/>
</wallbody>
</walldocument>

Serializer serializes output to HTML if device preferred markup is HTML or
WML if device preferred markup is WML.

Which means the serializer will change the markup language to meet WML/HTML
markup specs, as well as changing the content type of the document from
text/xml to text/html or text/wml


Regards,
Remon






-----Original Message-----
From: news [mailto:news@ger.gmane.org] On Behalf Of Luca Morandini
Sent: Friday, December 12, 2008 7:38 PM
To: dev@cocoon.apache.org
Subject: Re: WURFL + COCOON (WALL Serializer)

Remon wrote:
> 
> What I need to do is developing a new cocoon Serializer called WALL to 
> work with my package. My Idea is to fetch XML from a source generator, 
> transform it using XSLT to my XML defined tags, pass it to the Developed 
> serializer for converting the XML and setting the document content type 
> and generating the text output.

Not sure I understood your proposal: custom serializers are there for 
converting to non-XML format, but, as far as I understood, your package 
produces some form of XML (well, it  might malformed XML, right ?), 
which can be serialized using the XML serializer or the HTML serializer.

What you propose sounds more the job of a transformer (XML in - XML out, 
or, more properly: SAX in - SAX out).

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: WURFL + COCOON (WALL Serializer)

Posted by Luca Morandini <lm...@ieee.org>.
Remon wrote:
> 
> What I need to do is developing a new cocoon Serializer called WALL to 
> work with my package. My Idea is to fetch XML from a source generator, 
> transform it using XSLT to my XML defined tags, pass it to the Developed 
> serializer for converting the XML and setting the document content type 
> and generating the text output.

Not sure I understood your proposal: custom serializers are there for 
converting to non-XML format, but, as far as I understood, your package 
produces some form of XML (well, it  might malformed XML, right ?), 
which can be serialized using the XML serializer or the HTML serializer.

What you propose sounds more the job of a transformer (XML in - XML out, 
or, more properly: SAX in - SAX out).

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------