portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmostt...@yci.com
Subject Maximize portlet for Anonymous User
Date Fri, 10 May 2002 19:07:45 GMT
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:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>


Mime
View raw message