You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Anthony Perritano <ap...@gmail.com> on 2006/03/09 22:43:01 UTC
simplest portlet
Hi,
I created the simplest porlet from the guide:
http://portals.apache.org/jetspeed-2/guides/guide-simple-portlet.html
it works great. but i modified it to include a jsp and want to test
to see if i can get access to the user info from it, so in a jsp
page i have the following:
<table border="1">
<tr>
<th colspan="2" align="center"></th>
</tr>
<c-rt:forEach var="userAttr" items="<%=
renderRequest.getAttribute(PortletRequest.USER_INFO)%>">
<tr>
<td>key: <c:out value="${userAttr.key}"/></td>
<td>value: <c:out value="${userAttr.value}"/></td>
</tr>
</c-rt:forEach>
</table>
that i nabbed from the userinfo.jsp that comes with jetspeed.
then i log into the admin account and went to simplest.psml created
from this psml:
<page>
<defaults
skin="orange"
layout-decorator="tigris"
portlet-decorator="tigris"
/>
<title>The simplest portlet in the world</title>
<metadata name="title" xml:lang="fr">La plus simple portlet du
monde</metadata>
<fragment id="Simplest" type="layout" name="jetspeed-
layouts::VelocityTwoColumns">
<fragment id="Simplest-1" type="portlet" name="Simplest::Simplest">
<property layout="TwoColumns" name="row" value="0" />
<property layout="TwoColumns" name="column" value="0" />
</fragment>
</fragment>
<security-constraints>
<security-constraints-ref>public-view</security-constraints-ref>
</security-constraints>
</page>
the user attributes table that i want to display comes up empty.
however, on the default tab in the space the User Info Portlet shows
all the user info.
is there some state that my portlet has to be in to get access to the
user info??
thanks
Anthony
Re: simplest portlet
Posted by Aaron Evans <aa...@gmail.com>.
You have to define them in your portlet.xml so they are available in your
app. See:
http://portals.apache.org/jetspeed-2/guides/guide-user-attributes.html
On 3/9/06, Anthony Perritano <ap...@gmail.com> wrote:
>
> Hi,
> I created the simplest porlet from the guide:
> http://portals.apache.org/jetspeed-2/guides/guide-simple-portlet.html
>
> it works great. but i modified it to include a jsp and want to test
> to see if i can get access to the user info from it, so in a jsp
> page i have the following:
>
> <table border="1">
> <tr>
> <th colspan="2" align="center"></th>
> </tr>
>
> <c-rt:forEach var="userAttr" items="<%=
> renderRequest.getAttribute(PortletRequest.USER_INFO)%>">
> <tr>
> <td>key: <c:out value="${userAttr.key}"/></td>
> <td>value: <c:out value="${userAttr.value}"/></td>
> </tr>
> </c-rt:forEach>
>
> </table>
>
> that i nabbed from the userinfo.jsp that comes with jetspeed.
>
> then i log into the admin account and went to simplest.psml created
> from this psml:
>
> <page>
> <defaults
> skin="orange"
> layout-decorator="tigris"
> portlet-decorator="tigris"
> />
> <title>The simplest portlet in the world</title>
> <metadata name="title" xml:lang="fr">La plus simple portlet du
> monde</metadata>
>
> <fragment id="Simplest" type="layout" name="jetspeed-
> layouts::VelocityTwoColumns">
> <fragment id="Simplest-1" type="portlet" name="Simplest::Simplest">
> <property layout="TwoColumns" name="row" value="0" />
> <property layout="TwoColumns" name="column" value="0" />
> </fragment>
> </fragment>
>
> <security-constraints>
> <security-constraints-ref>public-view</security-constraints-ref>
> </security-constraints>
> </page>
>
> the user attributes table that i want to display comes up empty.
> however, on the default tab in the space the User Info Portlet shows
> all the user info.
>
> is there some state that my portlet has to be in to get access to the
> user info??
>
> thanks
> Anthony
>