Author: apetrelli
Date: Fri Oct 13 04:55:04 2006
New Revision: 463654

URL: http://svn.apache.org/viewvc?view=rev&rev=463654
Log:
SB-54
Renamed "controller" concept to "preparer"

Added:
    
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/UrlViewPreparer.java
      - copied, changed from r453561, 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/UrlController.java
    
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ViewPreparer.java
      - copied, changed from r453561, 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/Controller.java
    
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ViewPreparerSupport.java
      - copied, changed from r453561, 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ControllerSupport.java
Removed:
    
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/Controller.java
    
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ControllerSupport.java
    
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/UrlController.java
Modified:
    
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ComponentDefinition.java
    
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/DefinitionTagSupport.java
    
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTag.java
    
struts/sandbox/trunk/tiles/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_0.dtd

Modified: 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ComponentDefinition.java
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ComponentDefinition.java?view=diff&rev=463654&r1=463653&r2=463654
==============================================================================
--- 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ComponentDefinition.java
 (original)
+++ 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ComponentDefinition.java
 Fri Oct 13 04:55:04 2006
@@ -65,14 +65,14 @@
      */
     protected String role = null;
 
-    /** Associated Controller URL or classname, if defined */
-    protected String controller = null;
+    /** Associated ViewPreparer URL or classname, if defined */
+    protected String preparer = null;
 
     /** 
-     * Associated Controller typename, if controllerName defined.
-     * Can be CONTROLLER, ACTION or URL, or null. 
+     * Associated ViewPreparer typename, if preparerName defined.
+     * Can be PREPARER, ACTION or URL, or null. 
      */
-    protected String controllerType = null;
+    protected String preparerType = null;
 
     /**
      * Used for resolving inheritance.
@@ -80,25 +80,25 @@
     private boolean isVisited=false;
 
     /** 
-     * Controller name type. 
+     * ViewPreparer name type. 
      */
     public static final String URL = "url";
 
     /** 
-     * Controller name type. 
+     * ViewPreparer name type. 
      */
-    public static final String CONTROLLER = "controller";
+    public static final String PREPARER = "preparer";
 
     /** 
-     * Controller name type. 
+     * ViewPreparer name type. 
      */
     public static final String ACTION = "action";
 
     /**
-     * Controller associated to Definition.
+     * ViewPreparer associated to Definition.
      * Lazy creation : only on first request
      */
-    private Controller controllerInstance = null;
+    private ViewPreparer preparerInstance = null;
 
     /**
      * Constructor.
@@ -118,9 +118,9 @@
         this.name = definition.getName();
         this.path = definition.getPath();
         this.role = definition.getRole();
-        this.controllerInstance = definition.getControllerInstance();
-        this.controller = definition.getController();
-        this.controllerType = definition.getControllerType();
+        this.preparerInstance = definition.getPreparerInstance();
+        this.preparer = definition.getPreparer();
+        this.preparerType = definition.getPreparerType();
     }
 
     /**
@@ -320,171 +320,171 @@
             + path
             + ", role="
             + role
-            + ", controller="
-            + controller
-            + ", controllerType="
-            + controllerType
-            + ", controllerInstance="
-            + controllerInstance
+            + ", preparer="
+            + preparer
+            + ", preparerType="
+            + preparerType
+            + ", preparerInstance="
+            + preparerInstance
             + ", attributes="
             + attributes
             + "}\n";
     }
 
     /**
-     * Get associated controller type.
+     * Get associated preparer type.
      * Type denote a fully qualified classname.
      */
-    public String getControllerType() {
-        return controllerType;
+    public String getPreparerType() {
+        return preparerType;
     }
 
     /**
-     * Set associated controller type.
+     * Set associated preparer type.
      * Type denote a fully qualified classname.
-     * @param controllerType Typeof associated controller
+     * @param preparerType Typeof associated preparer
      */
-    public void setControllerType(String controllerType) {
-        this.controllerType = controllerType;
+    public void setPreparerType(String preparerType) {
+        this.preparerType = preparerType;
     }
 
     /**
-     * Set associated controller name as an url, and controller
+     * Set associated preparer name as an url, and preparer
      * type as "url".
      * Name must be an url (not checked).
      * Convenience method.
-     * @param controller Controller url
+     * @param preparer ViewPreparer url
      */
-    public void setControllerUrl(String controller) {
-        setController(controller);
-        setControllerType("url");
+    public void setPreparerUrl(String preparer) {
+        setPreparer(preparer);
+        setPreparerType("url");
     }
 
     /**
-     * Set associated controller name as a classtype, and controller
+     * Set associated preparer name as a classtype, and preparer
      * type as "classname".
      * Name denote a fully qualified classname
      * Convenience method.
-     * @param controller Controller classname.
+     * @param preparer ViewPreparer classname.
      */
-    public void setControllerClass(String controller) {
-        setController(controller);
-        setControllerType("classname");
+    public void setPreparerClass(String preparer) {
+        setPreparer(preparer);
+        setPreparerType("classname");
     }
 
     /**
-     * Get associated controller local URL.
+     * Get associated preparer local URL.
      * URL should be local to webcontainer in order to allow request context 
followup.
      * URL comes as a string.
      */
-    public String getController() {
-        return controller;
+    public String getPreparer() {
+        return preparer;
     }
 
     /**
-     * Set associated controller URL.
+     * Set associated preparer URL.
      * URL should be local to webcontainer in order to allow request context 
followup.
      * URL is specified as a string.
      * @param url Url called locally
      */
-    public void setController(String url) {
-        this.controller = url;
+    public void setPreparer(String url) {
+        this.preparer = url;
     }
 
     /**
-     * Get controller instance.
-     * @return controller instance.
+     * Get preparer instance.
+     * @return preparer instance.
      */
-    public Controller getControllerInstance() {
-        return controllerInstance;
+    public ViewPreparer getPreparerInstance() {
+        return preparerInstance;
     }
 
     /**
-     * Get or create controller.
-     * Get controller, create it if necessary.
-     * @return controller if controller or controllerType is set, null 
otherwise.
-     * @throws InstantiationException if an error occur while instanciating 
Controller :
+     * Get or create preparer.
+     * Get preparer, create it if necessary.
+     * @return preparer if preparer or preparerType is set, null otherwise.
+     * @throws InstantiationException if an error occur while instanciating 
ViewPreparer :
      * (classname can't be instanciated, Illegal access with instanciated 
class,
      * Error while instanciating class, classname can't be instanciated.
      */
-    public Controller getOrCreateController() throws InstantiationException {
+    public ViewPreparer getOrCreatePreparer() throws InstantiationException {
 
-        if (controllerInstance != null) {
-            return controllerInstance;
+        if (preparerInstance != null) {
+            return preparerInstance;
         }
 
-        // Do we define a controller ?
-        if (controller == null && controllerType == null) {
+        // Do we define a preparer ?
+        if (preparer == null && preparerType == null) {
             return null;
         }
 
         // check parameters
-        if (controllerType != null && controller == null) {
-            throw new InstantiationException("Controller name should be 
defined if controllerType is set");
+        if (preparerType != null && preparer == null) {
+            throw new InstantiationException("ViewPreparer name should be 
defined if preparerType is set");
         }
 
-        controllerInstance = createController(controller, controllerType);
+        preparerInstance = createPreparer(preparer, preparerType);
 
-        return controllerInstance;
+        return preparerInstance;
     }
 
     /**
-     * Set controller.
+     * Set preparer.
      */
-    public void setControllerInstance(Controller controller) {
-        this.controllerInstance = controller;
+    public void setPreparerInstance(ViewPreparer preparer) {
+        this.preparerInstance = preparer;
     }
 
     /**
-     * Create a new instance of controller named in parameter.
-     * If controllerType is specified, create controller accordingly.
+     * Create a new instance of preparer named in parameter.
+     * If preparerType is specified, create preparer accordingly.
      * Otherwise, if name denote a classname, create an instance of it. If 
class is
-     *  subclass of org.apache.struts.action.Action, wrap controller
+     *  subclass of org.apache.struts.action.Action, wrap preparer
      * appropriately.
      * Otherwise, consider name as an url.
-     * @param name Controller name (classname, url, ...)
-     * @param controllerType Expected Controller type
-     * @return org.apache.struts.tiles.Controller
-     * @throws InstantiationException if an error occur while instanciating 
Controller :
+     * @param name ViewPreparer name (classname, url, ...)
+     * @param preparerType Expected ViewPreparer type
+     * @return org.apache.struts.tiles.ViewPreparer
+     * @throws InstantiationException if an error occur while instanciating 
ViewPreparer :
      * (classname can't be instanciated, Illegal access with instanciated 
class,
      * Error while instanciating class, classname can't be instanciated.
      */
-    public static Controller createController(String name, String 
controllerType)
+    public static ViewPreparer createPreparer(String name, String preparerType)
         throws InstantiationException {
 
         if (log.isDebugEnabled()) {
-            log.debug("Create controller name=" + name + ", type=" + 
controllerType);
+            log.debug("Create preparer name=" + name + ", type=" + 
preparerType);
         }
 
-        Controller controller = null;
+        ViewPreparer preparer = null;
 
-        if (controllerType == null) { // first try as a classname
+        if (preparerType == null) { // first try as a classname
             try {
-                return createControllerFromClassname(name);
+                return createPreparerFromClassname(name);
 
             } catch (InstantiationException ex) { // ok, try something else
-                controller = new UrlController(name);
+                preparer = new UrlViewPreparer(name);
             }
 
-        } else if ("url".equalsIgnoreCase(controllerType)) {
-            controller = new UrlController(name);
+        } else if ("url".equalsIgnoreCase(preparerType)) {
+            preparer = new UrlViewPreparer(name);
 
-        } else if ("classname".equalsIgnoreCase(controllerType)) {
-            controller = createControllerFromClassname(name);
+        } else if ("classname".equalsIgnoreCase(preparerType)) {
+            preparer = createPreparerFromClassname(name);
         }
 
-        return controller;
+        return preparer;
     }
 
     /**
-     * Create a controller from specified classname
-     * @param classname Controller classname.
-     * @return org.apache.struts.tiles.Controller
-     * @throws InstantiationException if an error occur while instanciating 
Controller :
+     * Create a preparer from specified classname
+     * @param classname ViewPreparer classname.
+     * @return org.apache.struts.tiles.ViewPreparer
+     * @throws InstantiationException if an error occur while instanciating 
ViewPreparer :
      * (classname can't be instanciated, Illegal access with instanciated 
class,
      * Error while instanciating class, classname can't be instanciated.
      */
-    public static Controller createControllerFromClassname(String classname)
+    public static ViewPreparer createPreparerFromClassname(String classname)
         throws InstantiationException {
 
         try {
@@ -492,9 +492,9 @@
             Object instance = requestedClass.newInstance();
 
             if (log.isDebugEnabled()) {
-                log.debug("Controller created : " + instance);
+                log.debug("ViewPreparer created : " + instance);
             }
-            return (Controller) instance;
+            return (ViewPreparer) instance;
 
         } catch (java.lang.ClassNotFoundException ex) {
             throw new InstantiationException(
@@ -509,9 +509,9 @@
 
         } catch (java.lang.ClassCastException ex) {
             throw new InstantiationException(
-                "Controller of class '"
+                "ViewPreparer of class '"
                     + classname
-                    + "' should implements 'Controller' or extends 'Action'");
+                    + "' should implements 'ViewPreparer' or extends 
'Action'");
         }
     }
 
@@ -613,10 +613,10 @@
       setPath( parent.getPath() );
     if( role == null )
       setRole( parent.getRole() );
-    if( controller==null )
+    if( preparer==null )
       {
-      setController( parent.getController());
-      setControllerType( parent.getControllerType());
+      setPreparer( parent.getPreparer());
+      setPreparerType( parent.getPreparerType());
       }
     }
 
@@ -669,10 +669,10 @@
       setPath( parent.getPath() );
     if( role == null )
       setRole( parent.getRole() );
-    if( controller==null )
+    if( preparer==null )
       {
-      setController( parent.getController());
-      setControllerType( parent.getControllerType());
+      setPreparer( parent.getPreparer());
+      setPreparerType( parent.getPreparerType());
       }
     }
 
@@ -697,10 +697,10 @@
       {
       role = child.getRole();
       }
-    if( child.getController()!=null )
+    if( child.getPreparer()!=null )
       {
-      controller = child.getController();
-      controllerType =  child.getControllerType();
+      preparer = child.getPreparer();
+      preparerType =  child.getPreparerType();
       }
       // put all child attributes in parent.
     attributes.putAll( child.getAttributes());

Copied: 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/UrlViewPreparer.java
 (from r453561, 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/UrlController.java)
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/UrlViewPreparer.java?view=diff&rev=463654&p1=struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/UrlController.java&r1=453561&p2=struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/UrlViewPreparer.java&r2=463654
==============================================================================
--- 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/UrlController.java
 (original)
+++ 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/UrlViewPreparer.java
 Fri Oct 13 04:55:04 2006
@@ -21,12 +21,12 @@
 import java.io.IOException;
 
 /**
- * Tiles controller including a local URL.
+ * Tiles preparer including a local URL.
  */
-public class UrlController implements Controller {
+public class UrlViewPreparer implements ViewPreparer {
 
     /** 
-     * URL associated with this controller. 
+     * URL associated with this preparer. 
      */
     protected String url = null;
 
@@ -34,12 +34,12 @@
      * Constructor.
      * @param url URL.
      */
-    public UrlController(String url) {
+    public UrlViewPreparer(String url) {
             this.url = url;
     }
 
     /**
-     * @see org.apache.tiles.Controller#execute(org.apache.tiles.TilesContext, 
org.apache.tiles.ComponentContext)
+     * @see 
org.apache.tiles.ViewPreparer#execute(org.apache.tiles.TilesContext, 
org.apache.tiles.ComponentContext)
      */
     public void execute(TilesContext tilesContext, 
             ComponentContext componentContext) 

Copied: 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ViewPreparer.java
 (from r453561, 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/Controller.java)
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ViewPreparer.java?view=diff&rev=463654&p1=struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/Controller.java&r1=453561&p2=struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ViewPreparer.java&r2=463654
==============================================================================
--- 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/Controller.java
 (original)
+++ 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ViewPreparer.java
 Fri Oct 13 04:55:04 2006
@@ -18,14 +18,12 @@
 
 package org.apache.tiles;
 
-import java.io.IOException;
-
 /**
- * A controller is a piece of code called before rendering a jsp page.
- * A controller can be associated to a tile. See <insert> or 
+ * A preparer is a piece of code called before rendering a jsp page.
+ * A preparer can be associated to a tile. See <insert> or 
  * <definition> for association syntax.
  */
-public interface Controller {
+public interface ViewPreparer {
 
     /**
      * Method associated to a tile and called immediately before the tile 

Copied: 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ViewPreparerSupport.java
 (from r453561, 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ControllerSupport.java)
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ViewPreparerSupport.java?view=diff&rev=463654&p1=struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ControllerSupport.java&r1=453561&p2=struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ViewPreparerSupport.java&r2=463654
==============================================================================
--- 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ControllerSupport.java
 (original)
+++ 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/ViewPreparerSupport.java
 Fri Oct 13 04:55:04 2006
@@ -21,14 +21,14 @@
 import java.io.IOException;
 
 /**
- * Basic implementation of Controller.  Implementations can extend this class
- * to insulate themselves from changes in the <code>Controller</code> 
+ * Basic implementation of ViewPreparer.  Implementations can extend this class
+ * to insulate themselves from changes in the <code>ViewPreparer</code> 
  * interface.
  */
-public class ControllerSupport implements Controller {
+public class ViewPreparerSupport implements ViewPreparer {
 
     /**
-     * Stubs out controller method.
+     * Stubs out preparer method.
      */
     public void execute(TilesContext tilesContext, 
             ComponentContext componentContext) throws Exception {

Modified: 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/DefinitionTagSupport.java
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/DefinitionTagSupport.java?view=diff&rev=463654&r1=463653&r2=463654
==============================================================================
--- 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/DefinitionTagSupport.java
 (original)
+++ 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/DefinitionTagSupport.java
 Fri Oct 13 04:55:04 2006
@@ -27,13 +27,13 @@
  */
 public class DefinitionTagSupport extends TagSupport implements Serializable {
     /**
-     * Associated Controller type
+     * Associated ViewPreparer type
      */
-    protected String controllerType;
+    protected String preparerType;
     /**
-     * Associated Controller name (classname or url)
+     * Associated ViewPreparer name (classname or url)
      */
-    protected String controllerName;
+    protected String preparerName;
     /**
      * Role associated to definition.
      */
@@ -49,88 +49,88 @@
      */
     public void release() {
         super.release();
-        controllerType = null;
-        controllerName = null;
+        preparerType = null;
+        preparerName = null;
         role = null;
     }
 
     /**
-     * Get controller type.
+     * Get preparer type.
      * Type can be 'classname', 'url'.
      *
-     * @return Controller type.
+     * @return ViewPreparer type.
      */
-    public String getControllerType() {
-        return controllerType;
+    public String getPreparerType() {
+        return preparerType;
     }
 
     /**
-     * Get controller name.
+     * Get preparer name.
      * Name denotes a fully qualified classname, or an url.
-     * Exact type can be specified with [EMAIL PROTECTED] #setControllerType}.
+     * Exact type can be specified with [EMAIL PROTECTED] #setPreparerType}.
      *
-     * @return Controller name.
+     * @return ViewPreparer name.
      */
-    public String getControllerName() {
-        return controllerName;
+    public String getPreparerName() {
+        return preparerName;
     }
 
     /**
-     * Set associated controller type.
+     * Set associated preparer type.
      * Type denotes a fully qualified classname.
      *
-     * @param controllerType Type of associated controller.
+     * @param preparerType Type of associated preparer.
      */
-    public void setControllerType(String controllerType) {
-        this.controllerType = controllerType;
+    public void setPreparerType(String preparerType) {
+        this.preparerType = preparerType;
     }
 
     /**
-     * Set associated controller name.
+     * Set associated preparer name.
      * Name denotes a fully qualified classname, or an url.
-     * Exact type can be specified with [EMAIL PROTECTED] #setControllerType}.
+     * Exact type can be specified with [EMAIL PROTECTED] #setPreparerType}.
      *
-     * @param controller Controller classname or url.
+     * @param preparer ViewPreparer classname or url.
      */
-    public void setController(String controller) {
-        setControllerName(controller);
+    public void setPreparer(String preparer) {
+        setPreparerName(preparer);
     }
 
     /**
-     * Set associated controller name.
+     * Set associated preparer name.
      * Name denote a fully qualified classname, or an url.
-     * Exact type can be specified with setControllerType.
+     * Exact type can be specified with setPreparerType.
      *
-     * @param controller Controller classname or url
+     * @param preparer ViewPreparer classname or url
      */
-    public void setControllerName(String controller) {
-        this.controllerName = controller;
+    public void setPreparerName(String preparer) {
+        this.preparerName = preparer;
     }
 
     /**
-     * Set associated controller name as an url, and controller
+     * Set associated preparer name as an url, and preparer
      * type as "url".
      * Name must be an url (not checked).
      * Convenience method.
      *
-     * @param controller Controller url
+     * @param preparer ViewPreparer url
      */
-    public void setControllerUrl(String controller) {
-        setControllerName(controller);
-        setControllerType("url");
+    public void setPreparerUrl(String preparer) {
+        setPreparerName(preparer);
+        setPreparerType("url");
     }
 
     /**
-     * Set associated controller name as a classtype and controller
+     * Set associated preparer name as a classtype and preparer
      * type as "classname".
      * Name denotes a fully qualified classname.
      * Convenience method.
      *
-     * @param controller Controller classname.
+     * @param preparer ViewPreparer classname.
      */
-    public void setControllerClass(String controller) {
-        setControllerName(controller);
-        setControllerType("classname");
+    public void setPreparerClass(String preparer) {
+        setPreparerName(preparer);
+        setPreparerType("classname");
     }
 
     /**

Modified: 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTag.java
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTag.java?view=diff&rev=463654&r1=463653&r2=463654
==============================================================================
--- 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTag.java
 (original)
+++ 
struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTag.java
 Fri Oct 13 04:55:04 2006
@@ -36,7 +36,7 @@
 import org.apache.tiles.taglib.util.TagUtils;
 import org.apache.tiles.ComponentContext;
 import org.apache.tiles.ComponentDefinition;
-import org.apache.tiles.Controller;
+import org.apache.tiles.ViewPreparer;
 import org.apache.tiles.NoSuchDefinitionException;
 import org.apache.tiles.TilesUtil;
 
@@ -293,20 +293,20 @@
        }
 
        /**
-        * Get instantiated Controller.
-        * Return controller denoted by controllerType, or <code>null</code> if 
controllerType
+        * Get instantiated ViewPreparer.
+        * Return preparer denoted by preparerType, or <code>null</code> if 
preparerType
         * is null.
-        * @throws JspException If controller can't be created.
+        * @throws JspException If preparer can't be created.
         */
-       private Controller getController() throws JspException {
-               if (controllerType == null) {
+       private ViewPreparer getPreparer() throws JspException {
+               if (preparerType == null) {
                        return null;
                }
 
                try {
-                       return ComponentDefinition.createController(
-                               controllerName,
-                               controllerType);
+                       return ComponentDefinition.createPreparer(
+                               preparerName,
+                               preparerType);
 
                } catch (InstantiationException ex) {
                        throw new JspException(ex);
@@ -439,10 +439,10 @@
 
        /**
         * Process the url.
-        * @throws JspException If failed to create controller
+        * @throws JspException If failed to create preparer
         */
        public TagHandler processUrl(String url) throws JspException {
-               return new InsertHandler(url, role, getController());
+               return new InsertHandler(url, role, getPreparer());
        }
 
        /**
@@ -453,7 +453,7 @@
         * @throws JspException- NoSuchDefinitionException No Definition  found 
for name.
         * @throws JspException- FactoryNotFoundException Can't find 
Definitions factory.
         * @throws JspException- DefinedComponentFactoryException General error 
in factory.
-        * @throws JspException InstantiationException Can't create requested 
controller
+        * @throws JspException InstantiationException Can't create requested 
preparer
         */
        protected TagHandler processDefinitionName(String name)
                throws JspException {
@@ -491,17 +491,17 @@
         * Then, create appropriate tag handler.
         * @param definition Definition to process.
         * @return Appropriate TagHandler.
-        * @throws JspException InstantiationException Can't create requested 
controller
+        * @throws JspException InstantiationException Can't create requested 
preparer
         */
        protected TagHandler processDefinition(ComponentDefinition definition)
                throws JspException {
                // Declare local variable in order to not change Tag attribute 
values.
                String role = this.role;
                String page = this.template;
-               Controller controller = null;
+               ViewPreparer preparer = null;
 
                try {
-                       controller = definition.getOrCreateController();
+                       preparer = definition.getOrCreatePreparer();
 
                        // Overload definition with tag's template and role.
                        if (role == null) {
@@ -512,11 +512,11 @@
                                page = definition.getTemplate();
                        }
 
-                       if (controllerName != null) {
-                               controller =
-                                       ComponentDefinition.createController(
-                                               controllerName,
-                                               controllerType);
+                       if (preparerName != null) {
+                               preparer =
+                                       ComponentDefinition.createPreparer(
+                                               preparerName,
+                                               preparerType);
                        }
 
                        // Can check if page is set
@@ -524,7 +524,7 @@
                                definition.getAttributes(),
                                page,
                                role,
-                               controller);
+                               preparer);
 
                } catch (InstantiationException ex) {
                        throw new JspException(ex);
@@ -592,7 +592,7 @@
                return processDefinition((ComponentDefinition) 
value.getValue());
             } else {
                 return new InsertHandler((String) value.getValue(),
-                       role, getController());
+                       role, getPreparer());
             }
        }
 
@@ -693,7 +693,7 @@
                protected ComponentContext currentContext;
                protected ComponentContext subCompContext;
                protected String role;
-               protected Controller controller;
+               protected ViewPreparer preparer;
 
                /**
                 * Constructor.
@@ -703,11 +703,11 @@
                        Map attributes,
                        String page,
                        String role,
-                       Controller controller) {
+                       ViewPreparer preparer) {
 
                        this.page = page;
                        this.role = role;
-                       this.controller = controller;
+                       this.preparer = preparer;
                        subCompContext = new ComponentContext(attributes);
                }
 
@@ -715,10 +715,10 @@
                 * Constructor.
                 * Create insert handler to insert page at specified location.
                 */
-               public InsertHandler(String page, String role, Controller 
controller) {
+               public InsertHandler(String page, String role, ViewPreparer 
preparer) {
                        this.page = page;
                        this.role = role;
-                       this.controller = controller;
+                       this.preparer = preparer;
                        subCompContext = new ComponentContext();
                }
 
@@ -770,13 +770,13 @@
                                 subCompContext,
                                 PageContext.REQUEST_SCOPE);
 
-                        // Call controller if any
-                        if (controller != null) {
+                        // Call preparer if any
+                        if (preparer != null) {
                             try {
                               TilesContext tilesContext = 
TilesContextFactory.getInstance(
                                       pageContext.getServletContext(),
                                       pageContext.getRequest(), 
pageContext.getResponse());
-                                controller.execute(tilesContext, 
subCompContext);
+                                preparer.execute(tilesContext, subCompContext);
                             } catch (Exception e) {
                                 throw new ServletException(e);
                             }

Modified: 
struts/sandbox/trunk/tiles/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_0.dtd
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_0.dtd?view=diff&rev=463654&r1=463653&r2=463654
==============================================================================
--- 
struts/sandbox/trunk/tiles/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_0.dtd
 (original)
+++ 
struts/sandbox/trunk/tiles/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_0.dtd
 Fri Oct 13 04:55:04 2006
@@ -76,14 +76,14 @@
      page. This definition is identified by its logical name. A definition 
allows
      to define all the attributes that can be set in <insert> tag from a jsp 
page.
 
-     controllerClass The fully qualified Java class name of the controller
+     preparerClass The fully qualified Java class name of the preparer
                      subclass to call immediately before the tiles is inserted.
-                     Only one of controllerClass or controllerUrl should be
+                     Only one of preparerClass or preparerUrl should be
                      specified.
 
-     controllerUrl   The context-relative path to the resource used as 
controller
+     preparerUrl   The context-relative path to the resource used as preparer
                      called immediately before the tiles is inserted.
-                     Only one of controllerClass or controllerUrl should be
+                     Only one of preparerClass or preparerUrl should be
                      specified.
 
      extends         Name of a definition that is used as ancestor of this 
definition.
@@ -107,8 +107,8 @@
 -->
 <!ELEMENT definition (icon?, display-name?, description?, put*, putList*)>
 <!ATTLIST definition       id               ID               #IMPLIED>
-<!ATTLIST definition       controllerClass  %ClassName;      #IMPLIED>
-<!ATTLIST definition       controllerUrl    %RequestPath;    #IMPLIED>
+<!ATTLIST definition       preparerClass  %ClassName;      #IMPLIED>
+<!ATTLIST definition       preparerUrl    %RequestPath;    #IMPLIED>
 <!ATTLIST definition       extends          %DefinitionName; #IMPLIED>
 <!ATTLIST definition       name             %DefinitionName; #REQUIRED>
 <!ATTLIST definition       page             %RequestPath;    #IMPLIED>


Reply via email to