Re: ServerPageAction: XMLFragment reuse in XSL transformer

2002-11-10 Thread Christian Kurz



Sorry for the delay!

Thanks for your answer, Peter.

I must admit that I did not compare the performance 
between the aggregation and the transformer approach. The aggregation is just 
one additional component in the pipeline, that has to process the big document. 
Apart from that the necessarykind of processing of the big document 
requires the XSL-transformer to build an entire DOMDocument before doing the 
transformations, I guess.

So what I have done is I have written a Transformer 
for handling expandable data like the directory tree in the Windows' Explorer. 
It requires all input elements to have a unique id attribute. According to the 
tree status stored in the session, the transformer will only forward the visible 
tags and drop everything else. It also supports URL commands for setting 
upthe status tree (only root element is visible or all parent elements of 
one particular one are visible),expanding and collapsing child elements. 
Later transformers can then easily do thepresentation of the visible part 
of the tree and setup URL links e.g. for expanding leaf nodes 
futhermore.

In most cases all SAX processing is done on-the-fly 
without intermediate storage of all SAX element.

The quality of the code is probably not very high, 
as I am not working with Cocoon for very long, but at least its documented. Do 
you think this transformer could be useful for other people? And do you know to 
whom I should give it?

Thank you and best regards,
Christian


  - Original Message - 
  From: 
  Hunsberger, Peter 
  To: '[EMAIL PROTECTED]' 
  
  Sent: Monday, October 21, 2002 2:56 
  PM
  Subject: RE: ServerPageAction: 
  XMLFragment reuse in XSL transformer
  
  That 
  should work. I don't know ifit is much (any?) more efficient 
  thanusing aggregation...
  
-Original Message-From: Christian Kurz 
[mailto:[EMAIL PROTECTED]]Sent: Saturday, October 19, 2002 4:53 
AMTo: [EMAIL PROTECTED]Subject: 
Re: ServerPageAction: XMLFragment reuse in XSL 
transformer
I'll try to implement a pipeline similar to 
this:

FileGenerator - 
"MyFilterTransformer" - other steps

The FileGenerator will read the big document 
and is cacheable.
MyFilterTransformer will use the XMLFragment 
from the session to forward only a small portion of the events from the 
generator, following your idea. MyFilterTransformer is the first component 
in the pipeline, which is NOT cacheable, as it returns different data on 
every request.

To my understanding cocoon's caching strategy 
should cache the pipeline as far as possible. In this particular case only 
including the FileGenerator:

"The keys of all cacheable components are 
chained, and together they build the cache key. The request is processed, 
and the document is built. The cache stores the result of the _last_ 
component, indicating cacheablility. The next time this document is 
requested, the key is built, and the cached content is fetched from the 
cache.

Next, the cache asks all components of the 
event pipeline, if their input has changed since the time the content was 
cached. For example, the generator checks this by looking at the last 
modification date of the xml document, the xslt transformer checksthe 
date of the stylesheet, and so on. Only if all state that the content is 
still valid it is used from the cache. Otherwise, the document is generated 
from scratch. So the event pipeline tries to cache as much of the XML 
processing pipeline as possible."
from New Riders, Cocoon: Building XML 
Applications by Matthew Langham and Carsten Ziegeler, p. 182.


  - Original Message - 
  From: 
  Hunsberger, Peter 
  To: '[EMAIL PROTECTED]' 
  
  Sent: Friday, October 18, 2002 4:23 
  PM
  Subject: RE: ServerPageAction: 
  XMLFragment reuse in XSL transformer
  
  Well, obviously, it something changes on every request then, by 
  definition, it isn't cacheable. However, I believe, with 
  aggregation, only the components that are marked as invalidated in the 
  cache are rebuilt on a new request; the rest of the data stays in it's 
  respective cache. This does mean that the aggregated document 
  is rebuilt each time (I have no idea what the impact of that would 
  be). But the "large" document source would stay not be retrieved 
  from scratch.
  
  Perhaps using the document function as Olivier would avoid 
  this. At one point document did notcheck cache validity at all 
  and you would only get a newer version of the data if the main data was 
  invalidated in cache. I think this has been fixed in 2.0.3. The 
  problem is how to get the URI resolve for the document function to fund 
  the data in session. Someone else will have to tell you how to do 
  that (and if it's even 

Session Woes

2002-11-10 Thread Tom Place
Hi all,

Apologies for the relatively low level of this email but someone out
there must be able to answer in 1 min what I have been failing to do for
days now.

This simple XSP file:

?xml version=1.0?
xsp:page
  xmlns:xsp=http://apache.org/xsp;
  xmlns:xsp-session=http://apache.org/xsp/session/2.0;
  create-session=true

  page
xsp-session:set-attribute
name=fruitApple/xsp-session:set-attribute
fruitxsp-session:get-attribute name=fruit//fruit
  /page

/xsp:page

Should produce the following XML right?

page
  fruitApple/fruit
/page

What am I doing wrong if the session attributes are being ignored and I
get the following XML

  page
xsp-session:set-attribute
name=fruitApple/xsp-session:set-attribute
fruitxsp-session:get-attribute name=fruit//fruit
  /page

Again my apologies if I have missed the obvious but this example if off
the cocoon site and should work?!

Thanks

Tom


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Cocoon Users Group - Texas

2002-11-10 Thread Ivelin Ivanov

If you live in Texas, please let me know.
Respond directly to [EMAIL PROTECTED]

I will gather all names and will post back to the list.

If the Cocoon population here is big enough we can probably setup a
brainstorming gathering,
similar to the one in London. Hopefully Stefano will be tempted to attend.


-=Ivelin=-



-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




XTML vs. HTML

2002-11-10 Thread Erik Bruchez
All,

I found an interesting document about sending XHTML vs. HTML to user agents:

  http://www.hixie.ch/advocacy/xhtml

The document links to a couple others:

  http://www.damowmow.com/playground/xhtml-in-uas.xhtml
  http://www.hut.fi/u/hsivonen/xhtml-the-point

May be of interest to Cocoon'ers.

-Erik


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Re: Session Woes

2002-11-10 Thread Sylvain Wallez
Tom Place wrote:


Hi all,

Apologies for the relatively low level of this email but someone out
there must be able to answer in 1 min what I have been failing to do for
days now.

This simple XSP file:

?xml version=1.0?
xsp:page
 xmlns:xsp=http://apache.org/xsp;
 xmlns:xsp-session=http://apache.org/xsp/session/2.0;
 create-session=true

 page
   xsp-session:set-attribute
name=fruitApple/xsp-session:set-attribute
   fruitxsp-session:get-attribute name=fruit//fruit
 /page

/xsp:page

Should produce the following XML right?

page
 fruitApple/fruit
/page

What am I doing wrong if the session attributes are being ignored and I
get the following XML

 page
   xsp-session:set-attribute
name=fruitApple/xsp-session:set-attribute
   fruitxsp-session:get-attribute name=fruit//fruit
 /page

Again my apologies if I have missed the obvious but this example if off
the cocoon site and should work?!
 


There are two cases that can cause XSP taglib markup to be ignored by 
the XSP engine and produced as is in the output document : either the 
taglib namespace is wrong (this isn't the case here), or the the taglib 
isn't declared in cocoon.xconf.

You should check that the following exists in your cocoon.xconf :

 markup-languages
   xsp-language name=xsp logger=core.markup.xsp
 ...
 target-language name=java
   builtin-logicsheet
 parameter name=prefix value=xsp-session/
 parameter name=uri value=http://apache.org/xsp/session/2.0/
 parameter name=href 
value=resource://org/apache/cocoon/components/language/markup/xsp/java/session.xsl/
   /builtin-logicsheet


Hope this helps.

Sylvain

--
Sylvain Wallez  Anyware Technologies
http://www.apache.org/~sylvain   http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]



Using Cocoon from the command

2002-11-10 Thread Alessio Sangalli
For the first time in a year and a half I want to use Cocoon from the 
command line. I will be able to use the results in an environment 
without Cocoon or Java and I won't have to generate every time the data 
etc etc.

I use Sun's JDK 1.4.1_01, Cocoon 2.0.3, on Linux.

I've found at least of informations on dejanews and the mail list archives:

http://groups.google.com/groups?q=cocoon+command+linehl=enlr=ie=UTF-8oe=UTF-8safe=offselm=jPAd8.9020%240C1.767012%40newsread1.prod.itd.earthlink.netrnum=4

Uh, I should have looked at the code!
I answered my own simple question. For reference:
java -classpath . org.apache.cocoon.Main  --help

-Mark

and:

http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=100439206023213w=2

You can use Cocoon command line interface.

java org.apache.cocoon.Main -csourcepath -dresultpath  -wtmppath \
-llogfilename  -uINFO -flist.uris

sourcepath : where your cocoon files are, with the sitemap and so on
resultpath : where tour HTML files go
tmppath: a directory for tmp files
logfilename : the log file
list.uris : a file containing the list of URI your want to build using 
Cocoon


good, however WHERE should I give those command lines?

I've never compiled Cocoon by sources because in the early days of the 
2.0beta it was a pain in *** ***, and I used to download the binary 
.war. However this time I had to, because Main.class wasn't avaiable 
anywhere on a binary distribution only.

$ sh build all

will create cocoon.jar but I can't get it working; at best I get a


$ java -classpath . org.apache.cocoon.Main
Exception in thread main java.lang.NoClassDefFoundError: 
org/apache/avalon/framework/CascadingException
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
etc etc etc..


I tried to unzip the jar, to go directly inside and call Main.class from 
its own dir, etc


what can I do...!

bye  thank you
as






-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]



Re: Using Cocoon from the command

2002-11-10 Thread Sylvain Wallez
Alessio Sangalli wrote:

snip/


$ java -classpath . org.apache.cocoon.Main
Exception in thread main java.lang.NoClassDefFoundError: 
org/apache/avalon/framework/CascadingException
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
etc etc etc..


I tried to unzip the jar, to go directly inside and call Main.class 
from its own dir, etc


what can I do...!


You should set the correct class path ;-)

Look at the stack trace : one of the first classes loaded from Avalon by 
Cocoon can't be found. That's because your classpath is set to . and 
so includes only Cocoon's own classes (guessing you start this from the 
build/classes directory).

Hope this helps,
Sylvain

--
Sylvain Wallez  Anyware Technologies
http://www.apache.org/~sylvain   http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]



Out of office

2002-11-10 Thread MORVEK Peter
Momentalne nie som pritomny (08.11.2002-22.11.2002). 

Elektronicke bankovnictvo riesi Ivan Tarapcik ([EMAIL PROTECTED])
Elektronicke poistovnictvo riesi Henrich Fukna ([EMAIL PROTECTED])
CS CIC riesi Ivan Kmeto ([EMAIL PROTECTED])

organizacne veci useku Elektronicke systemy riesi Ivan Tarapcik
([EMAIL PROTECTED])

Dakujem

Peter Moravek
-
+421903269903

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




AW: Umlauts in cocoon 2.0.2

2002-11-10 Thread Sternath Elmar
Hi Braun,

I wrote an action to encode the request params before accessing them in the sitemap:

public class RequestEncodedParamAction extends ComposerAction implements ThreadSafe {

public final static String MAP_URI = requestURI;
public final static String MAP_QUERY   = requestQuery;
public final static String MAP_CONTEXTPATH = context;

public final static String PARAM_PARAMETERS = parameters;
public final static String PARAM_DEFAULT_PREFIX = default.;


public Map act( Redirector redirector, SourceResolver resolver, Map objectModel, 
String source, Parameters param )
throws Exception
{

Request request = (Request) objectModel.get(Constants.REQUEST_OBJECT);
if (request == null) {
  getLogger().error(RequestInfoAction: no request object!);
  return(null);
}

Map map = new HashMap();

map.put(MAP_URI, request.getRequestURI());

String query = request.getQueryString();
if (query != null  query.length()  0){
  map.put(MAP_QUERY, ? + query);
}
else{
  map.put(MAP_QUERY, );
}

map.put(MAP_CONTEXTPATH, request.getContextPath());

if (true.equalsIgnoreCase(param.getParameter(PARAM_PARAMETERS, null))){
  Enumeration e = request.getParameterNames();
  while(e.hasMoreElements()){
String name = (String) e.nextElement();
String value = request.getParameter(name);

getLogger().debug(Encode Parameter:  + name +  with value: 
 + value);
if (value != null  !map.containsKey(name)){
  map.put(name, URLEncoder.encode( value ));
}
  }

  String[] paramNames = param.getNames();
  for (int i=0; i paramNames.length; i++) {
  if (paramNames[i].startsWith(PARAM_DEFAULT_PREFIX) 
  
(request.getParameter(paramNames[i].substring(PARAM_DEFAULT_PREFIX.length())) == 
null)) {
getLogger().debug(Encode Parameter:  + paramNames[i] +  
with value:  + param.getParameter(paramNames[i]));

map.put(paramNames[i].substring(PARAM_DEFAULT_PREFIX.length()), URLEncoder.encode( 
param.getParameter(paramNames[i])));
  }
  }


}

return(map);
}
}

-Ursprüngliche Nachricht-
Von: Braun [mailto:jakarta;kbr-immobilien.de]
Gesendet: Sonntag, 10. November 2002 02:32
An: [EMAIL PROTECTED]
Betreff: Umlauts in cocoon 2.0.2


I have the problem with german Umlauts in request parameters.
When I transfer german Umlauts by request paramaters cocoon doesn't 
decode the Umlauts encoding when I use these Umlauts in my xml-documents 
or stylesheets.
I set already all my encodings to ISO-8859-1.




-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]