portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morci...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets PortletInfoPortlet.java
Date Mon, 07 Oct 2002 17:01:32 GMT
morciuch    2002/10/07 10:01:31

  Modified:    src/java/org/apache/jetspeed/portal/portlets
                        PortletInfoPortlet.java
  Log:
  Fixed the Avantgo link to display current portlet in max mode
  
  Revision  Changes    Path
  1.42      +27 -8     jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/PortletInfoPortlet.java
  
  Index: PortletInfoPortlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/PortletInfoPortlet.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- PortletInfoPortlet.java	14 May 2002 06:32:59 -0000	1.41
  +++ PortletInfoPortlet.java	7 Oct 2002 17:01:30 -0000	1.42
  @@ -74,6 +74,8 @@
   import org.apache.jetspeed.capability.*;
   import org.apache.jetspeed.util.*;
   import org.apache.jetspeed.services.rundata.JetspeedRunData;
  +import org.apache.jetspeed.util.template.JetspeedLink;
  +import org.apache.jetspeed.util.template.JetspeedLinkFactory;
   
   //Turbine
   import org.apache.turbine.util.*;
  @@ -168,24 +170,41 @@
           t.addElement( new TR().addElement( new TD()
               .addElement( new B().addElement( "Actions:" ) ) ) );
               
  -            
  -        DynamicURI internal = new DynamicURI( rundata, "portlets.PortletInfoScreen" );
  -
  -        internal.addPathInfo( "portlet", portlet.getName() );
  -        internal.addQueryData("raw", "true");
  +        String internal = null;
  +        JetspeedLink jsLink = null;
   
  +        try
  +        {
  +            jsLink = JetspeedLinkFactory.getInstance(rundata);
  +            String mtype = rundata.getParameters().getString("mtype");
  +            if (mtype != null)
  +            {
  +                jsLink.setMediaType(mtype);
  +                jsLink.addQueryData("mtype", mtype);
  +            }
  +            String js_peid = rundata.getParameters().getString("js_peid");
  +            // FIX ME: If the portlet is viewed in Avantgo and then portlet info is restored,
the portlet will
  +            // be maximized (similar to customizing certain portlet types. The desired
effect would be to 
  +            // set the portlet's mode to normal.
  +            internal = jsLink.addPathInfo("js_peid", js_peid).setAction("controls.Maximize").toString();
  +        }
  +        catch (Exception e)
  +        {
  +            Log.error(e);
  +        }
  +        JetspeedLinkFactory.putInstance(jsLink);
   
           StringBuffer external = new StringBuffer( getPortletConfig().getInitParameter(
THIRDPARTY_PORTLETRENDERER_URL_KEY ) );
   
           //this is the parameters of what so specify to the 3rd party provider
           external.append("&title=" + URLEncoder.encode( portlet.getTitle() ) );
  -        external.append("&url=" + URLEncoder.encode( internal.toString() ) );
  +        external.append("&url=" + URLEncoder.encode(internal));
   
           String message = getPortletConfig().getInitParameter( THIRDPARTY_PORTLETRENDERER_CAPTION_KEY
);
   
           t.addElement( new TR()
               .addElement( new TD()
  -                .addElement( new A( external.toString() ).addElement( message ) ) ) );
  +                .addElement( new A( external.toString() ).setTarget("_blank").addElement(
message ) ) ) );
   
           //END 3RD PARTY REPL
   
  
  
  

--
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