Re: common request handling in our xsp?

Christian Egli <[email protected]> 31 Mar 2003 15:20:30 +0200
Newsgroups gmane.comp.cms.wyona.devel
Message-ID <[email protected]>
"Gregor J. Rothfuss" <[email protected]> writes:

> i noticed we do have an awful lot of code like the following in our
> xsp:
> 
> String referer=request.getHeader("Referer");
> Session session=request.getSession(true);
> String status=request.getParameter("status");
> //if(session.getAttribute("org.lenya.cms.cocoon.acting.ParentChildCreatorAct
> ion.parent_uri") == null){

> it composes about 80% of all our xsp. bascially it is copied & pasted
> code, with all its problems.
> 
> can't we derive all this from a common class / xsp, make the variables
> available under standard names, and only have the differences in the
> various xsp?

There is a logic sheet which does part of this. You could extend
it. See
http://cvs.wyona.org/cgi-bin/cvsweb.cgi/lenya/src/java/org/lenya/cms/cocoon/logicsheets/util.xsl

> unifying this code would go a long way towards the much discussed
> page envelope (sorry, discussion was offlist..)

Yup.

-- 
Christian Egli       [email protected]   +41 1 272 9161
                     Wyona AG, Hardstrasse 219, CH-8005 Zurich
Open Source CMS      http://www.wyona.org http://www.wyona.com