portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raph...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/modules/screens Customize.java Info.java Admin.java BaseJetspeedScreen.java Home.java
Date Mon, 04 Jun 2001 17:22:33 GMT
raphael     01/06/04 10:22:33

  Modified:    src/java/org/apache/jetspeed/modules/screens Customize.java
                        Info.java
  Removed:     src/java/org/apache/jetspeed/modules/screens Admin.java
                        BaseJetspeedScreen.java Home.java
  Log:
  - remove obsolete ECS screens
  - update the other screens with new PortalToolkit service
  
  Revision  Changes    Path
  1.8       +34 -41    jakarta-jetspeed/src/java/org/apache/jetspeed/modules/screens/Customize.java
  
  Index: Customize.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/screens/Customize.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Customize.java	2001/05/07 20:47:58	1.7
  +++ Customize.java	2001/06/04 17:22:29	1.8
  @@ -60,16 +60,19 @@
   import java.util.*;
   import java.text.*;
   
  -
   //Jetspeed support
   import org.apache.jetspeed.daemon.*;
   import org.apache.jetspeed.portal.*;
  -import org.apache.jetspeed.portal.factory.*;
   import org.apache.jetspeed.util.*;
   import org.apache.jetspeed.profiler.*;
   import org.apache.jetspeed.capability.*;
  +import org.apache.jetspeed.services.PortalToolkit;
  +import org.apache.jetspeed.services.PsmlManager;
   import org.apache.jetspeed.services.resources.JetspeedResources;
  -import org.apache.jetspeed.om.newregistry.PortletEntry;
  +import org.apache.jetspeed.xml.api.portletmarkup.Portlets;
  +import org.apache.jetspeed.xml.api.portletmarkup.Control;
  +import org.apache.jetspeed.xml.api.portletmarkup.Controller;
  +import org.apache.jetspeed.xml.api.portletmarkup.Entry;
   
   //ECS support
   import org.apache.ecs.html.*;
  @@ -85,7 +88,7 @@
    ** 
    ** @author <a href="mailto:liberman@raleigh.ibm.com">Alexandra Liberman</a>
    */
  -public class Customize extends BaseJetspeedScreen
  +public class Customize extends Screen
   {
   
   
  @@ -152,15 +155,7 @@
   
               //the set here should be one control and one portlet
               PortletSet set = this.getPortletSet( aRunData );
  -
  -
  -            PortletController controller = PortletControllerFactory
  -                                           .getPortletController( PORTLET_CONTROLLER, 
  -                                                                  set,
  -                                                                  aRunData.getParameters()
);
  -
  -
  -            return controller.getContent( aRunData );
  +            return set.getContent( aRunData );
   
           }
           catch (PortletException e)
  @@ -184,7 +179,8 @@
        **
        ** @return  ecs concrete element (portlet set context) 
        */
  -    private ConcreteElement getPSMLContent( RunData aRunData ) {
  +    private ConcreteElement getPSMLContent( RunData aRunData )
  +    {
   
           //Get content form the PSML 
   
  @@ -200,11 +196,12 @@
           {
   
               String customizerPSMLResource = JetspeedResources.getString( JetspeedResources.CUSTOMIZATION_RESOURCE_KEY
);
  -
  -            Portlet portlet = PortletSetFactory.getInstance(customizerPSMLResource)
  -                              .getPortletSet( aRunData );
   
  -            root.addElement( portlet.getContent( aRunData ) );
  +            PortletSet set = PortalToolkit.getSet(
  +                                PsmlManager.getDocument(customizerPSMLResource)
  +                                           .getPortlets() );
  +                                           
  +            root.addElement( set.getContent( aRunData ) );
   
           }
           catch ( Throwable t )
  @@ -248,33 +245,29 @@
        **
        ** @return  ecs concrete element (portlet set context) 
        */
  -    private PortletSet getPortletSet( RunData aRunData ) throws PortletException {
  -
  -
  -        PortletSet portletSet = new BasePortletSet();
  -
  -        PortletEntry entry = PortletURIManager.getEntry( aRunData.getParameters() );
  +    private PortletSet getPortletSet( RunData aRunData ) throws PortletException
  +    {
   
  -        if ( entry == null )
  +        String portletName = aRunData.getParameters().getString(PORTLET);
  +        
  +        if ( portletName == null )
           {
  -            String message = "Could not determine entry for the portlet "+aRunData.getParameters().getString(
PORTLET)+".";
  +            String message = "Could not determine entry for the portlet "+portletName+".";
               throw new PortletException( message );
           }
  -
  -        Portlet portlet = PortletFactory.getPortlet( entry );
  -
  -        PortletControl control = PortletControlFactory
  -                                 .getPortletControl(PORTLET_CONTROL, portlet );
  -
  -        control.setWidth( "100%" );
  -
  -        portletSet.addPortlet( control ); 
   
  -
  -
  -        return portletSet;
  -
  -
  +        // build a simple PSML fragment for our screen
  +        Portlets portlets = new Portlets();        
  +        Entry entry = new Entry();
  +        entry.setParent( portletName );        
  +        Control control = new Control();
  +        control.setName(PORTLET_CONTROL);        
  +        entry.setControl(control);        
  +        Controller controller = new Controller();
  +        controller.setName(PORTLET_CONTROLLER);        
  +        portlets.setController( controller );
  +        portlets.addEntry( entry );
  +        
  +        return PortalToolkit.getSet( portlets );
       } 
  -
   }
  
  
  
  1.6       +9 -16     jakarta-jetspeed/src/java/org/apache/jetspeed/modules/screens/Info.java
  
  Index: Info.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/screens/Info.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Info.java	2001/03/07 06:44:26	1.5
  +++ Info.java	2001/06/04 17:22:31	1.6
  @@ -59,35 +59,29 @@
   import java.util.*;
   import java.text.*;
   
  -//servlet API
  -import javax.servlet.*;
  -import javax.servlet.http.*;
  -
  -
   //Jetspeed support
  -import org.apache.jetspeed.daemon.*;
   import org.apache.jetspeed.portal.*;
  -import org.apache.jetspeed.portal.factory.PortletSetFactory;
   import org.apache.jetspeed.util.*;
   import org.apache.jetspeed.capability.*;
  +import org.apache.jetspeed.services.PortalToolkit;
  +import org.apache.jetspeed.services.PsmlManager;
  +import org.apache.jetspeed.services.resources.JetspeedResources;
   
   //ECS support
  -import org.apache.ecs.html.*;
   import org.apache.ecs.*;
   
  -
   //Turbine support
   import org.apache.turbine.modules.*;
   import org.apache.turbine.util.*;
  -import org.apache.jetspeed.services.resources.JetspeedResources;
   
   /**
   The Jetspeed home page
   
   @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  -@version $Id: Info.java,v 1.5 2001/03/07 06:44:26 taylor Exp $
  +@version $Id: Info.java,v 1.6 2001/06/04 17:22:31 raphael Exp $
   */
  -public class Info extends BaseJetspeedScreen {
  +public class Info extends Screen
  +{
       
       /**
       Portlet pathinfo name
  @@ -121,10 +115,9 @@
   
               String info = JetspeedResources.getString( JetspeedResources.PSML_BASE_URL_KEY
)+"info.psml";
   
  -            Portlet portlet = PortletSetFactory.getInstance( info )
  -                .getPortletSet( rundata );
  +            PortletSet set = PortalToolkit.getSet(PsmlManager.getDocument(info).getPortlets());
               
  -            root.addElement( portlet.getContent( rundata ) );
  +            root.addElement( set.getContent( rundata ) );
   
           } catch ( Throwable t ) {
   
  @@ -139,7 +132,7 @@
           // time in millis, sugested by Thomas Schaeck (schaeck@de.ibm.com)
           long milliseconds = ( System.currentTimeMillis() - begin );
   
  -        Log.note( "Jetspeed Home: END default portlets -> total time " + milliseconds
+ " millisecond(s)" );
  +        Log.note( "Jetspeed Info: END default portlets -> total time " + milliseconds
+ " millisecond(s)" );
   
           return root;
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message