Hello,
I noticed that the controls.Maximize action will never maximize a portlet
for an Anonymous user regardless of permissions set for Anonymous user.
public void doPerform( RunData rundata ) throws Exception
{
JetspeedRunData jdata = (JetspeedRunData)rundata;
if( rundata.getUser() == null || !rundata.getUser().hasLoggedIn() )
{
return;
}
String name = jdata.getPortlet();
if ( name == null )
{
return;
}
//record that this portlet is now maximized
jdata.getUser().setTemp("portlet",name);
jdata.setScreenTemplate("Maximize");
}
Is there a reason that this action will only complete for logged in users?
Why not do a check of permissions to determine if the user is allowed to
maximize?
public void doPerform( RunData rundata ) throws Exception
{
JetspeedRunData jdata = (JetspeedRunData)rundata;
String name = jdata.getPortlet();
if ( name == null )
{
return;
}
org.apache.jetspeed.xml.api.portletmarkup.Entry entry =
jdata.getProfile().getDocument().getEntry(name);
org.apache.jetspeed.portal.Portlet portlet = null;
if (entry != null)
{
portlet =
org.apache.jetspeed.services.PortletFactory.getPortlet(entry);
}
if(!((org.apache.jetspeed.portal.security.portlets.StatefulPortletWrapper)po
rtlet).allowMaximize(rundata))
return;
//record that this portlet is now maximized
jdata.setMode("maximize");
jdata.getUser().setTemp("portlet",name);
jdata.setScreenTemplate("Maximize");
}
thanks,
marcus
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>