Hello,
I need to know which user is logged on inside a Cocoon-XSP-page in
Jetspeed 1.2b1.
I created the following index.xml und index.xsl pages, but it turns out
that
rundata.getUser() is always empty (the output is "???" in the below
example).
So the question is:
How can I get the name of the current user inside a Cocoon-XSP-page ???
It would be a cool thing to have Cocoon-XSP (dynamic-java-programming
on-the-fly without change of the jetspeed/cocoon system!!!) up and
running -
but a important thing would be the full access to the rundata of
jetspeed/turbine.
index.xml:
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="index.xsl" type="text/xsl"?>
<xsp:page language="java"
xmlns:xsp="http://www.apache.org/1999/XSP/Core">
<xsp:structure>
<xsp:include>org.apache.turbine.util.*</xsp:include>
<xsp:include>org.apache.turbine.om.user.*</xsp:include>
<xsp:include>org.apache.jetspeed.daemon.*</xsp:include>
<xsp:include>org.apache.jetspeed.daemon.impl.*</xsp:include>
<xsp:include>org.apache.jetspeed.portal.util.*</xsp:include>
<xsp:include>org.apache.jetspeed.portal.*</xsp:include>
<xsp:include>org.apache.jetspeed.portal.factory.*</xsp:include>
<xsp:include>org.apache.jetspeed.util.servlet.*</xsp:include>
</xsp:structure>
<portletlist>
<xsp:logic>
RunData rundata = RunDataFactory.getRunData( request,
response, new JetspeedServletConfig() );
String user = "???";
if (rundata.getUser() != null) { user =
rundata.getUser().getUserName(); };
<!-- if (rundata.getUser() != null) if
(rundata.getUser().hasLoggedIn()) { user =
rundata.getUser().getUserName(); }; -->
<!-- if (rundata.getUser() != null &&
rundata.getUser().hasLoggedIn() ) { user =
rundata.getUser().getUserName(); }; -->
</xsp:logic>
<user>
<xsp:expr>user</xsp:expr>
</user>
</portletlist>
</xsp:page>
index.xsp:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="portletlist">
<xsl:processing-instruction
name="cocoon-format">type="text/html"</xsl:processing-instruction>
<div>
<ul>
<br>
<p>
Hello
<xsl:value-of select="./user"/>
</p>
</ul>
</div>
</xsl:template>
</xsl:stylesheet>
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://marc.theaimsgroup.com/?l=jetspeed>
Problems?: [EMAIL PROTECTED]