cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neeme Praks" <>
Subject RE: Thoughts on a data-driven web site
Date Wed, 21 Jun 2000 20:57:56 GMT

> -----Original Message-----
> From: Jonathan Stimmel []
> Sent: Wednesday, June 21, 2000 9:47 PM


> I did overlook this problem in my email, but I have thought about it.
> Our pages have a lot of cursory information that you wouldn't want to
> send to a mobile device. There are definite performance 
> benefits to only
> loading the data you will actually be using which I believe 
> will outweigh
> the (minimal) effort needed to maintain the additional source 
> documents.
> The underlying directory structure would look something like:
>   wap/index.xml              html/index.xml
>   wap/index.xsl              html/index.xsl
>   wap/news/index.xml         html/news/index.xml
>   wap/news/index.xsl         html/news/index.xsl
>   wap/weather/index.xml      html/news/index.xml
>   wap/weather/index.xsl      html/news/index.xsl
>   wap/xsl/skin.xsl           html/xsl/skin.xsl
> Still quite managable.

well, in this case I see no benefit in using the "template" XSL file
(stage 3). In this case I could just as well put the structure into the
stage 1 XML file together with the data sources. Then afterwards I could
"skin" this with additional stylesheet if needed...

> Not really, it shows that two different development groups have
> wrestled with the same problem and come to the same conclusions.
> Hopefully that means we're both on the right track =)

This is what I like about open-source: you can see that you are not
alone in this world with your problems ;-)

To give you a better understanding what did I chose in the end, I can
give a short description and example. The whole system consists of 2
global files:
/en/resources.xml (i18n resource file for english, one flavour of the
XResourceBundles as discussed on this list)
/forms.xml (definitions of forms, to separate the concerns of
information layout and web app development; and to abstract the
application model specifics, as I'm using Jetspeed/Turbine currently,
but I want to use Cocoon2 later on)

And then I have the actual XML file (stage 1) that includes the data
sources and very abstract information layout.

------------------- resources.xml -----------------------
<?xml version="1.0" encoding="UTF-8"?>
<resources xml:lang="en">
		    <from-mycontacts>my contacts</from-mycontacts>
		    <from-allmembers>all members</from-allmembers>
			    <firstname>first name</firstname>
			    <lastname>last name</lastname>

------------------- forms.xml -----------------------
<?xml version="1.0" encoding="UTF-8"?>
	<form ID="contacts-search"><res:group
		<field name="searchfor">
		<field name="fields">
				<res:group ref="field-to-search">
					<option name="all">
					<option name="firstname">
					<option name="lastname">
					<option name="phone">
					<option name="email">
		<field name="from-mycontacts">
		<field name="from-allmembers">
		<field name="submit">
				<res:resource ref="submit"/>

------------------- one specific page example -----------------------
	<form:form ref="contacts-search">
	<res:group ref="/forms/contacts-search/desc">
					<res:resource ref="searchfor"/>
					<form:field ref="searchfor"/>
					<form:field ref="fields"/>
					<res:resource ref="from"/>
ref="from-mycontacts"/> <res:resource ref="from-mycontacts"/><br/>
ref="from-allmembers"/> <res:resource ref="from-allmembers"/>
					<form:field ref="submit"/>

---------------------- the end result should be something like this in
HTML ----------------
<table width="100%" cellpadding="3" cellspacing="0" class="grayBg"
<td class="smallnormal">
<table width="100%" cellspacing="0" cellpadding="1" border="0">
<td width="35%" class="smallnormal" align="right">find:</td>
<td class="smallnormal"><input type="textfield" size="11"

<td width="35%" class="smallnormal" align="right">what:</td>
<td class="smallnormal"><select>
<option>first name</option>
<option>last name</option>

<td width="35%" class="smallnormal" align="right"
<td class="smallnormal"><input type="checkbox" name="1" value=""
checked> my contacts<br>
<input type="checkbox" name="1" value=""> all members</td>

<td width="35%"></td>
<td class="smallnormal"><input type="image" src="img/bu/sech.gif"
alt="search" border="0">



So, how is it supposed to work?

1. user requests this specific URL.
2. the base XML file is processed
3. all references to the forms.xml are replaced with content from there
4. all tags from XSP taglibs are expanded with a logicsheet (this is not
included in this example)
4. all references to resources.xml are replaced with locale specific
content (probably also in XSP)
5. XSP is compiled to Java source
6. all this content is handed to the media/skin specific designer
stylesheet. (this means one sheet per media/skin, not per each original
7. response goes back to client

My underlying directory structure would look something like:
with supporting files:
   /en/resources.xml (i18n file)

This is not yet fully working example (the namespace declarations are
missing, etc)... I'm still working on this. However, all comments would
be welcome, as always ;-)

I haven't tried to write any final designer stylesheets yet, this is the
job of our designer... So probably I'll have to adjust things then...

And this example is an example of "static" form, no database
interactivity... but I have my ideas about this: everything is in XSP
taglibs and the tags can be in every stage of processing before the
actual XSP processing, this means that I can put dynamic tags in the
file requested, forms.xml or resources.xml.

I hope this all makes some sense...


View raw message