Return-Path: Delivered-To: apmail-xml-cocoon-users-archive@xml.apache.org Received: (qmail 51470 invoked by uid 500); 27 Sep 2002 00:39:11 -0000 Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-users@xml.apache.org Delivered-To: mailing list cocoon-users@xml.apache.org Received: (qmail 51459 invoked from network); 27 Sep 2002 00:39:09 -0000 Content-Type: text/plain; charset="iso-8859-1" From: Antonio Gallardo Rivera Organization: AG Software, S. A. To: cocoon-users@xml.apache.org Subject: Re: Date: Thu, 26 Sep 2002 18:43:22 -0600 User-Agent: KMail/1.4.3 References: <200209260350.30154.agallardo@agsoftware.dnsalias.com> In-Reply-To: <200209260350.30154.agallardo@agsoftware.dnsalias.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200209261843.22497.agallardo@agsoftware.dnsalias.com> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Please check this function I included into XSPSessionHelper.java in=20 src/java/org/apache/cocoon/components/language/markup/xsp: /** GetXML Fragment from the given session context and path * * * @param session The Session object * @param context The Session context tha define where to search * @param path The parameter path * @param defaultValue Value to substitute in absence of the required= =20 Fragment **/ public static DocumentFragment getXML(ComponentManager cm, String=20 context, String path) throws ProcessingException { DocumentFragment df =3D null; SessionManager sm =3D null; try { // Start looking up the manager sm =3D (SessionManager)cm.lookup(SessionManager.ROLE); // Make our work df =3D sm.getContextFragment(context, path); if (sm !=3D null) { cm.release(sm); } } catch (ComponentException ce) { throw new ProcessingException("Error during lookup of=20 SessionManager component.", ce); } // End releasing the sessionmanager return df; } Soon I will publish here too the changes in the xsp-session.xsl I takes me 3 days! Antonio Gallardo. El Jueves, 26 de Septiembre de 2002 03:50, Antonio Gallardo Rivera escrib= i=F3: > I will try to explain how far I am now in the building of the > for XSP. > > As I said I was researching about that, now I can get the values of the > "authentication" context. > > In XSP we can use: > Namespace: xmlns:xsp-session=3D"http://apache.org/xsp/session/2.0" > > 2-Add imports: > org.apache.cocoon.webapps.session.context.SimpleSessionCon= text > org.w3c.dom.DocumentFragment > org.apache.cocoon.xml.dom.DOMUtil > > 3- Logic inside the xsp:page: > > > SimpleSessionContext a =3D > ((SimpleSessionContext) name=3D"org.apache.cocoon.webapps.authentication.SessionContext"/> >); DocumentFragment b =3D a.getXML("/"); > String d =3D DOMUtil.createText(b); > > > Only for test I used, and it gets the values I need. > > b > > After it returns I saw in the generated HTML that there is only one > context. > > > > 1 > myrole > > =09My name > =09 > =09..... > > > > > I am also researching about how to get the authentication context becau= se > there are two attributes and the name of the handler can be diferent as > long as I know. Then: > > A) adding imports > java.util.ArrayList > java.util.HashMap > > B) > > ArrayList al =3D > ((ArrayList)); > > String al0 =3D ((String)al.get(0)); > String al1 =3D ((String)al.get(1));oot node, does anyone know how > HashMap hs =3D ((HashMap) name=3D"org.apache.cocoon.webapps.authentication.Handlers"/>= ); > > With al. I can make use of the attributesnames of the session, after th= at I > can get the names using the variables al0 and al1. > > al0 is org.apache.cocoon.webapps.authentication.Handlers > and > al1 is org.apache.cocoon.webapps.authentication.SessionContext > > About al1 is above a litlle explain that can helps to get directly the > authentication ID using the Strings: > > > SimpleSessionContext a =3D > ((SimpleSessionContext) name=3D"org.apache.cocoon.webapps.authentication.SessionContext"/> >); DocumentFragment b =3D a.getXML("/myhandler/authentication/ID"); > > > After this, the variable b has the value of "/authentication/ID". > > About al0 (org.apache.cocoon.webapps.authentication.Handlers) it is a > ArrayList that contains the names of the attributes. > > Some examples using > >

Key: hs.keySet()

>

Value: hs.values()

>

Attribute: hs.values()

> > But I cannot take the Session Context. I was thinking in a get how to g= et > away the context and just write a tag like: > > > > Another question: Can we add this new function to the already xsp-sessi= on > logicsheet? > > Comments are welcome :) > > Antonio Gallardo > > > > > > > > > --------------------------------------------------------------------- > Please check that your question has not already been answered in the > FAQ before posting. > > To unsubscribe, e-mail: > For additional commands, e-mail: --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. To unsubscribe, e-mail: For additional commands, e-mail: