CVS: plexus-components/summit/src/java/org/apache/plexus/summit/display AbstractDisplay.java,1.1.1.1,1.2 ClassicBufferedDisplay.java,1.1.1.1,1.2 Display.java,1.1.1.1,1.2 SimpleDisplay.java,1.1.1.1,1.2

[email protected] Thu, 1 May 2003 14:28:42 -0500
Newsgroups gmane.comp.java.plexus.devel
Message-ID <[email protected]>
Update of /cvsroot/plexus/plexus-components/summit/src/java/org/apache/plexus/summit/display
In directory eng.werken.com:/tmp/cvs-serv17379/src/java/org/apache/plexus/summit/display

Modified Files:
	AbstractDisplay.java ClassicBufferedDisplay.java Display.java 
	SimpleDisplay.java 
Log Message:
o Removed the multiple View notion.
o Using a service manager instead of the components being service managers.


Index: AbstractDisplay.java
===================================================================
RCS file: /cvsroot/plexus/plexus-components/summit/src/java/org/apache/plexus/summit/display/AbstractDisplay.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- AbstractDisplay.java	15 Feb 2003 03:55:47 -0000	1.1.1.1
+++ AbstractDisplay.java	1 May 2003 19:28:39 -0000	1.2
@@ -68,7 +68,7 @@
 import org.apache.plexus.summit.rundata.RunData;
 
 /**
- * @see org.apache.plexus.summit.display.Dispay
+ * @see org.apache.plexus.summit.display.Display
  *
  * @author <a href="mailto:[email protected]">Jason van Zyl</a>
  * @author <a href="mailto:[email protected]">Pete Kazmier</a>
@@ -80,25 +80,25 @@
 {
     /** Default encoding. */
     private String encoding = "ISO-8859-1";
-    
+
     /** Default mime type. */
     private String defaultMimeType = "text/html";
-    
+
     /** Render the target view. */
-    public abstract void render(RunData data)
+    public abstract void render( RunData data )
         throws Exception;
 
-    /** 
-     * By default create a <code>Writer</code> from the servlet 
-     * output stream. 
+    /**
+     * By default create a <code>Writer</code> from the servlet
+     * output stream.
      */
-    protected Writer getWriter(RunData data)
+    protected Writer getWriter( RunData data )
         throws IOException, UnsupportedEncodingException
     {
-        data.getResponse().setContentType(defaultMimeType);
-        data.getResponse().setStatus(200);
+        data.getResponse().setContentType( defaultMimeType );
+        data.getResponse().setStatus( 200 );
         ServletOutputStream output = data.getResponse().getOutputStream();
-        OutputStreamWriter osw = new OutputStreamWriter(output, encoding);
+        OutputStreamWriter osw = new OutputStreamWriter( output, encoding );
         return osw;
     }
 }

Index: ClassicBufferedDisplay.java
===================================================================
RCS file: /cvsroot/plexus/plexus-components/summit/src/java/org/apache/plexus/summit/display/ClassicBufferedDisplay.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- ClassicBufferedDisplay.java	15 Feb 2003 03:55:47 -0000	1.1.1.1
+++ ClassicBufferedDisplay.java	1 May 2003 19:28:39 -0000	1.2
@@ -72,7 +72,7 @@
  * </p>
  *
  * <pre>
- * 
+ *
  * +------------------------------------------------+
  * | DefaultLayout.vm                               |
  * | +--------------------------------------------+ |
@@ -91,7 +91,7 @@
  * | | TopNavigation.vm                           | |
  * | +--------------------------------------------+ |
  * +------------------------------------------------+
- * 
+ *
  * </pre>
  *
  * <p>
@@ -107,39 +107,39 @@
     extends AbstractDisplay
 {
     /** @see org.apache.plexus.summit.display.Display#render(RunData) */
-    public void render(RunData data)
+    public void render( RunData data )
         throws Exception
     {
         Renderer renderer =
-            ( Renderer ) getServiceBroker().lookup( Renderer.ROLE );
+            (Renderer) getServiceManager().lookup( Renderer.ROLE );
 
         // Retrieve the ViewContext
-        ViewContext vc = (ViewContext) data.getMap().get(SummitConstants.VIEW_CONTEXT);
-        vc.put("data", data);
-        
+        ViewContext vc = (ViewContext) data.getMap().get( SummitConstants.VIEW_CONTEXT );
+        vc.put( "data", data );
+
         // ---------------------------------------------------------------
         // S C R E E N
         // ---------------------------------------------------------------
-        Module screenModule = data.getResolution().getModule(ClassicResolver.SCREEN_MODULE);
-        if (screenModule != null)
+        Module screenModule = data.getResolution().getModule( ClassicResolver.SCREEN_MODULE );
+        if ( screenModule != null )
         {
-            screenModule.execute(data);
+            screenModule.execute( data );
         }
-        View screenView = data.getResolution().getView(ClassicResolver.SCREEN_VIEW);
-        String screenViewContent = renderer.render(data, screenView.getName());
-        vc.put("screenViewContent", screenViewContent);
-        
+        View screenView = data.getResolution().getView( ClassicResolver.SCREEN_VIEW );
+        String screenViewContent = renderer.render( data, screenView.getName() );
+        vc.put( "screenViewContent", screenViewContent );
+
         // ---------------------------------------------------------------
         // L A Y O U T
         // ---------------------------------------------------------------
-        Module layoutModule = data.getResolution().getModule(ClassicResolver.LAYOUT_MODULE);
-        if (layoutModule != null)
+        Module layoutModule = data.getResolution().getModule( ClassicResolver.LAYOUT_MODULE );
+        if ( layoutModule != null )
         {
-            layoutModule.execute(data);
-        } 
-        View layoutView = data.getResolution().getView(ClassicResolver.LAYOUT_VIEW);
-        renderer.render(data, layoutView.getName(), getWriter(data));
-        
+            layoutModule.execute( data );
+        }
+        View layoutView = data.getResolution().getView( ClassicResolver.LAYOUT_VIEW );
+        renderer.render( data, layoutView.getName(), getWriter( data ) );
+
         // IMO this is where the model falls apart. Typically in a Turbine application
         // we have no knowledge of which navigation template is going to be
         // used so a tool is placed in the context in order to execute a module
@@ -149,11 +149,11 @@
         // of velocity constructs. If anything other than scalars are required
         // than a velocity macro should hide this so a simple #macro can be
         // used instead.
-        
+
         // ---------------------------------------------------------------
         // N A V I G A T I O N
         // ---------------------------------------------------------------
-        //Module navigationModule = data.getResolution().getModule(ClassicResolver.NAVIGATION_MODULE); 
+        //Module navigationModule = data.getResolution().getModule(ClassicResolver.NAVIGATION_MODULE);
         //if (navigationModule != null)
         //{
         //    navigationModule.execute(data);

Index: Display.java
===================================================================
RCS file: /cvsroot/plexus/plexus-components/summit/src/java/org/apache/plexus/summit/display/Display.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- Display.java	15 Feb 2003 03:55:48 -0000	1.1.1.1
+++ Display.java	1 May 2003 19:28:39 -0000	1.2
@@ -71,8 +71,8 @@
 public interface Display
 {
     public final static String ROLE = Display.class.getName();
-    
+
     /** Render the target view */
-    void render(RunData data)
+    void render( RunData data )
         throws Exception;
 }

Index: SimpleDisplay.java
===================================================================
RCS file: /cvsroot/plexus/plexus-components/summit/src/java/org/apache/plexus/summit/display/SimpleDisplay.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- SimpleDisplay.java	15 Feb 2003 03:55:48 -0000	1.1.1.1
+++ SimpleDisplay.java	1 May 2003 19:28:39 -0000	1.2
@@ -74,13 +74,13 @@
     extends AbstractDisplay
 {
     /** @see org.apache.plexus.summit.display.Display#render(RunData) */
-    public void render(RunData data)
+    public void render( RunData data )
         throws Exception
     {
         // ---------------------------------------------------------------
         // S C R E E N
         // ---------------------------------------------------------------
-        Module screenModule = data.getResolution().getModule(ClassicResolver.SCREEN_MODULE);
-        View screenView = data.getResolution().getView(ClassicResolver.SCREEN_VIEW);
+        Module screenModule = data.getResolution().getModule( ClassicResolver.SCREEN_MODULE );
+        View screenView = data.getResolution().getView( ClassicResolver.SCREEN_VIEW );
     }
 }