cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agsoftware.dnsalias.com>
Subject Re: access session context from flowscript
Date Tue, 04 Nov 2003 13:50:34 GMT
Check in the samples of authentication framework fro Cocoon CVS. I thought
there are example using flow.

Best Regards,

Antonio Gallardo

Markus Heussen dijo:
> Hi everybody,
>
> I need to access the session authentication context created by the
> authentication framework using javascript within flowscript.
>
> Can anybody give some javascript code that does it for me? Or how can I
> use the class XSPSessionHelperFw to do it for me (see below)?
>
>
> public class XSPSessionFwHelper {
>     /** 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
> Fragment
>      **/
>      public static DocumentFragment getXML(ComponentManager cm, String
> context, String path) throws ProcessingException {
>
>          SessionManager sm = null;
>          DocumentFragment df = null;
>
>          try {
>              // Start looking up the manager
>              sm = (SessionManager)cm.lookup(SessionManager.ROLE);
>              // Make our work
>              df = sm.getContextFragment(context, path);
>              if (sm != null) {
>                  cm.release((Component)sm);
>              }
>          } catch (ComponentException ce) {
>              throw new ProcessingException("Error during lookup of
> SessionManager component.", ce);
>          } finally {
>              // End releasing the sessionmanager
> 		     cm.release((Component)sm);
> 	     }
>          return df;
>      }
> }
>
> Many thanks, Markus
>
>
>
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message