raphael     2002/11/07 12:22:16

  Modified:    src/java/org/apache/jetspeed/modules/layouts
                        JetspeedLayout.java
               src/java/org/apache/jetspeed/modules/pages
                        JetspeedTemplatePage.java
  Log:
  Convert calls to CapabilityMapFactory to JetspeedRunData.getCapability()
  
  Revision  Changes    Path
  1.8       +21 -21    
jakarta-jetspeed/src/java/org/apache/jetspeed/modules/layouts/JetspeedLayout.java
  
  Index: JetspeedLayout.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/layouts/JetspeedLayout.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- JetspeedLayout.java       13 Jun 2002 09:23:22 -0000      1.7
  +++ JetspeedLayout.java       7 Nov 2002 20:22:15 -0000       1.8
  @@ -51,12 +51,12 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    */
  - 
  +
   package org.apache.jetspeed.modules.layouts;
   
   //jetspeed stuff
   import org.apache.jetspeed.capability.CapabilityMap;
  -import org.apache.jetspeed.capability.CapabilityMapFactory;
  +import org.apache.jetspeed.services.rundata.JetspeedRunData;
   import org.apache.jetspeed.services.resources.JetspeedResources;
   import org.apache.jetspeed.util.MimeType;
   
  @@ -74,7 +74,7 @@
   import org.apache.ecs.xml.*;
   
   /**
  - * 
  + *
    * @author <a href="mailto:burton@;apache.org">Kevin A. Burton</a>
    * @author <a href="mailto:raphael@;apache.org">Rapha�l Lute</a>
    * @version $Id$
  @@ -82,26 +82,26 @@
   public class JetspeedLayout extends Layout
   {
   
  -    public static final String TOP = 
  +    public static final String TOP =
           JetspeedResources.getString( JetspeedResources.NAVIGATIONS_TOP_KEY );
   
  -    public static final String BOTTOM = 
  +    public static final String BOTTOM =
           JetspeedResources.getString( JetspeedResources.NAVIGATIONS_BOTTOM_KEY );
  -        
  +
       /**
           The Doctype of WML
       */
  -    public static final Doctype WML_DOCTYPE = 
  -        new Doctype( "wml", 
  +    public static final Doctype WML_DOCTYPE =
  +        new Doctype( "wml",
                        "PUBLIC",
  -                     "\"-//WAPFORUM//DTD WML 1.1//EN\"", 
  +                     "\"-//WAPFORUM//DTD WML 1.1//EN\"",
                        "\"http://www.wapforum.org/DTD/wml_1.1.xml\""; );
   
  -        
  +
       public void doBuild( RunData data ) throws Exception
       {
   
  -        CapabilityMap cm = CapabilityMapFactory.getCapabilityMap( data );
  +        CapabilityMap cm = ((JetspeedRunData)data).getCapability();
   
           MimeType mt = cm.getPreferredType();
           data.setContentType( mt.getContentType() );
  @@ -112,7 +112,7 @@
           if ( mt.equals( MimeType.WML ) ) {
               // we should output WML code, use raw output
               // don"t use navigations for WML
  -            
  +
               ElementContainer ec = new ElementContainer();
               WML wml = new WML();
               ec.addElement( new PI().setVersion( 1.0 ) );
  @@ -124,7 +124,7 @@
               ConcreteElement screen = ScreenLoader.getInstance().eval ( data, 
data.getScreen() );
               if (screen != null)
                   wml.addElement( screen );
  -            
  +
               // output everything on stdout
               try {
                   ec.output( data.getOut() );
  @@ -135,30 +135,30 @@
               }
   
           } else {
  -            
  +
               // Execute the Top Navigation portion for this Layout
  -            ConcreteElement topNav = 
  +            ConcreteElement topNav =
                   NavigationLoader.getInstance().eval ( data, TOP );
               if ( topNav != null)
                   data.getPage().getBody().addElement( topNav );
  -                                                
  +
               // Now execute the Screen portion of the page
               ConcreteElement screen = ScreenLoader.getInstance().eval ( data, 
data.getScreen() );
               if (screen != null)
                   data.getPage().getBody().addElement( screen );
   
  -            // The screen should have attempted to set a Title 
  +            // The screen should have attempted to set a Title
               // for itself, otherwise, a default title is set
               data.getPage().getTitle()
                   .addElement( data.getTitle() );
   
  -            // The screen should have attempted to set a Body bgcolor 
  +            // The screen should have attempted to set a Body bgcolor
               // for itself, otherwise, a default body bgcolor is set
               data.getPage().getBody()
                   .setBgColor(HtmlColor.white);
  -        
  +
               // Execute the Bottom Navigation portion for this Layout
  -            ConcreteElement bottomNav = 
  +            ConcreteElement bottomNav =
               NavigationLoader.getInstance().eval ( data, BOTTOM );
               if ( bottomNav != null)
                   data.getPage().getBody().addElement( bottomNav );
  
  
  
  1.18      +8 -11     
jakarta-jetspeed/src/java/org/apache/jetspeed/modules/pages/JetspeedTemplatePage.java
  
  Index: JetspeedTemplatePage.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/pages/JetspeedTemplatePage.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JetspeedTemplatePage.java 28 Jun 2002 03:51:26 -0000      1.17
  +++ JetspeedTemplatePage.java 7 Nov 2002 20:22:15 -0000       1.18
  @@ -68,16 +68,13 @@
   import org.apache.turbine.services.*;
   
   // Jetspeed Classes
  -import org.apache.jetspeed.util.MimeType;
  -import org.apache.jetspeed.capability.CapabilityMap;
  -import org.apache.jetspeed.capability.CapabilityMapFactory;
   import org.apache.jetspeed.services.TemplateLocator;
   import org.apache.jetspeed.services.rundata.JetspeedRunData;
   import org.apache.jetspeed.services.resources.JetspeedResources;
   
  -//<Temporary FIX: new turbine will make it obsolete>        
  +//<Temporary FIX: new turbine will make it obsolete>
   import org.apache.turbine.services.localization.LocaleDetector;
  -//</Temporary FIX: new turbine will make it obsolete>        
  +//</Temporary FIX: new turbine will make it obsolete>
   
   /**
    * When building sites using templates, Screens need only be defined
  @@ -159,7 +156,7 @@
                   data.getResponse().setDateHeader("Last-Modified", 
System.currentTimeMillis());
                   break;
           }
  -        
  +
       }
   
       /**
  @@ -179,7 +176,7 @@
   
           if (!data.hasScreen())
           {
  -            
  +
               // if only a screen but no template is specified, then we need to 
display
               // a legacy ecs screen --> screenTemplate = ECS
               if ( data.getTemplateInfo().getScreenTemplate() == null )
  @@ -189,12 +186,12 @@
               }
   
               String ext = TurbineTemplate.getDefaultExtension();
  -            
  +
               String template = data.getTemplateInfo().getScreenTemplate();
   
               //save the initial requested template before mangling it
               ((JetspeedRunData)data).setRequestedTemplate(template);
  -            
  +
               if (template.lastIndexOf('.')<0)
               {
                   template=template+"."+ext;
  @@ -225,5 +222,5 @@
               data.setScreen(screen);
           }
       }
  -    
  +
   }
  
  
  

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

Reply via email to