access session context from flowscript

2003-11-04 Thread Markus Heussen
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: access session context from flowscript

2003-11-04 Thread Antonio Gallardo
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]




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