struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddew...@apache.org
Subject svn commit: r470947 - in /struts/sandbox/trunk/tiles: tiles-api/src/main/java/org/apache/tiles/ tiles-core/src/main/java/org/apache/tiles/context/ tiles-core/src/main/java/org/apache/tiles/context/enhanced/ tiles-core/src/main/java/org/apache/tiles/con...
Date Fri, 03 Nov 2006 19:00:11 GMT
Author: ddewolf
Date: Fri Nov  3 11:00:10 2006
New Revision: 470947

URL: http://svn.apache.org/viewvc?view=rev&rev=470947
Log:
Cleaning up the api;  Simplifying and adding more docs

Added:
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/ComponentListAttribute.java
  (contents, props changed)
      - copied, changed from r470901, struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentListAttribute.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/TilesRequestContext.java
  (contents, props changed)
      - copied, changed from r470901, struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesRequestContext.java
Removed:
    struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentListAttribute.java
    struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesRequestContext.java
Modified:
    struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentAttribute.java
    struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentContext.java
    struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesApplicationContext.java
    struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesContainer.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/BasicComponentContext.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/BasicTilesContextFactory.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/TilesContextFactory.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/enhanced/EnhancedContextFactory.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/jsp/JspTilesRequestContext.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/portlet/PortletTilesApplicationContext.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/portlet/PortletTilesRequestContext.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesApplicationContext.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesRequestContext.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsFactory.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/factory/TilesContainerFactory.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/BasicPreparerFactory.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerFactory.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertDefinitionTag.java
    struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/MockOnlyLocaleTilesContext.java
    struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/MockPublicUrlDefinitionsFactory.java
    struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/TestUrlDefinitionsFactory.java
    struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/factory/TilesContainerFactoryTest.java
    struts/sandbox/trunk/tiles/tiles-test/src/main/java/org/apache/tiles/test/preparer/TestViewPreparer.java

Modified: struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentAttribute.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentAttribute.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentAttribute.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentAttribute.java
Fri Nov  3 11:00:10 2006
@@ -64,6 +64,7 @@
     /**
      * Constructor.
      *
+     * @param name name of the attribute
      * @param value Object to store.
      */
     public ComponentAttribute(String name, Object value) {
@@ -97,6 +98,7 @@
 
     /**
      * Get role.
+     * @return the name of the required role(s)
      */
     public String getRole() {
         return role;
@@ -113,6 +115,7 @@
 
     /**
      * Get value.
+     * @return the value
      */
     public Object getValue() {
         return value;

Modified: struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentContext.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentContext.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentContext.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentContext.java
Fri Nov  3 11:00:10 2006
@@ -31,41 +31,41 @@
      * Retrieve the named attribute.
      *
      * @param name key name for the attribute.
-     * @return
+     * @return ComponentAttribute associated with the given name.
      */
     ComponentAttribute getAttribute(String name);
 
     /**
      * Iterator of all attribute names.
      *
-     * @return
+     * @return iterator of all names.
      */
     Iterator<String> getAttributeNames();
 
     /**
      * Add the specified attribute.
      *
-     * @param name
-     * @param value
+     * @param name name of the attribute
+     * @param value value of the attribute
      */
     void putAttribute(String name, ComponentAttribute value);
 
     /**
      * Find the attribute
      *
-     * @param beanName
-     * @param pageContext
-     * @return
+     * @param beanName name of the bean
+     * @param pageContext current pageContext.
+     * @return search for the attribute in one of the scopes.
      */
     ComponentAttribute findAttribute(String beanName, PageContext pageContext);
 
     /**
      * Find the named attribute.
      *
-     * @param beanName
-     * @param scope
-     * @param pageContext
-     * @return
+     * @param beanName name of the bean
+     * @param scope scope of the bean
+     * @param pageContext current pageContext
+     * @return component attribute - if found.
      */
     ComponentAttribute getAttribute(
         String beanName,

Modified: struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesApplicationContext.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesApplicationContext.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesApplicationContext.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesApplicationContext.java
Fri Nov  3 11:00:10 2006
@@ -19,7 +19,6 @@
  */
 package org.apache.tiles;
 
-import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Map;
 import java.util.Set;

Modified: struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesContainer.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesContainer.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesContainer.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesContainer.java
Fri Nov  3 11:00:10 2006
@@ -20,6 +20,7 @@
 package org.apache.tiles;
 
 import javax.servlet.jsp.PageContext;
+import java.util.Map;
 
 /**
  * An encapsulation of the tiles framework.  This interface is
@@ -36,10 +37,10 @@
      * Initialize the container with the given
      * configuration.
      *
-     * @param context
-     * @throws TilesException
+     * @param initParameters application context
+     * @throws TilesException when an initialization error occurs
      */
-    void init(TilesApplicationContext context) throws TilesException;
+    void init(Map<String, String> initParameters) throws TilesException;
 
     /**
      * Retrieve the containers context.

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/BasicComponentContext.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/BasicComponentContext.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/BasicComponentContext.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/BasicComponentContext.java
Fri Nov  3 11:00:10 2006
@@ -21,7 +21,7 @@
 package org.apache.tiles.context;
 
 import org.apache.tiles.taglib.ComponentConstants;
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 import org.apache.tiles.ComponentContext;
 import org.apache.tiles.ComponentAttribute;
 

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/BasicTilesContextFactory.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/BasicTilesContextFactory.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/BasicTilesContextFactory.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/BasicTilesContextFactory.java
Fri Nov  3 11:00:10 2006
@@ -21,7 +21,7 @@
 package org.apache.tiles.context;
 
 import org.apache.tiles.TilesApplicationContext;
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 import org.apache.tiles.context.jsp.JspTilesRequestContext;
 import org.apache.tiles.context.portlet.PortletTilesApplicationContext;
 import org.apache.tiles.context.portlet.PortletTilesRequestContext;

Copied: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/ComponentListAttribute.java
(from r470901, struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentListAttribute.java)
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/ComponentListAttribute.java?view=diff&rev=470947&p1=struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentListAttribute.java&r1=470901&p2=struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/ComponentListAttribute.java&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/ComponentListAttribute.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/ComponentListAttribute.java
Fri Nov  3 11:00:10 2006
@@ -17,16 +17,13 @@
  * under the License.
  *
  */
-
-
-package org.apache.tiles;
+package org.apache.tiles.context;
 
 import org.apache.tiles.ComponentAttribute;
 
 import java.util.ArrayList;
 import java.util.List;
 
-
 /**
  * An attribute as a <code>List</code>.
  * This attribute associates a name with a list. The list can be found by the
@@ -42,13 +39,13 @@
      * We declare a List to avoid cast.
      * Parent "value" property points to the same list.
      */
-    private List list;
+    private List<Object> list;
 
     /**
      * Constructor.
      */
     public ComponentListAttribute() {
-        list = new ArrayList();
+        list = new ArrayList<Object>();
         setValue(list);
     }
 
@@ -58,7 +55,7 @@
      * @param name  Name.
      * @param value List.
      */
-    public ComponentListAttribute(String name, List value) {
+    public ComponentListAttribute(String name, List<Object> value) {
         super(name, value);
         list = value;
     }
@@ -84,7 +81,6 @@
         // Digester doesn't call correct method according to object type ;-(
         if (value instanceof ComponentAttribute) {
             add((ComponentAttribute) value);
-            return;
         } else {
             list.add(value);
         }

Propchange: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/ComponentListAttribute.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/ComponentListAttribute.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/TilesContextFactory.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/TilesContextFactory.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/TilesContextFactory.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/TilesContextFactory.java
Fri Nov  3 11:00:10 2006
@@ -20,7 +20,7 @@
 package org.apache.tiles.context;
 
 import org.apache.tiles.TilesApplicationContext;
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 
 import javax.servlet.jsp.PageContext;
 import java.util.Map;

Copied: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/TilesRequestContext.java
(from r470901, struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesRequestContext.java)
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/TilesRequestContext.java?view=diff&rev=470947&p1=struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesRequestContext.java&r1=470901&p2=struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/TilesRequestContext.java&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-api/src/main/java/org/apache/tiles/TilesRequestContext.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/TilesRequestContext.java
Fri Nov  3 11:00:10 2006
@@ -17,7 +17,7 @@
  * under the License.
  *
  */
-package org.apache.tiles;
+package org.apache.tiles.context;
 
 import java.io.IOException;
 import java.util.Locale;

Propchange: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/TilesRequestContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/TilesRequestContext.java
------------------------------------------------------------------------------
    svn:keywords = Id Author Date

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/enhanced/EnhancedContextFactory.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/enhanced/EnhancedContextFactory.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/enhanced/EnhancedContextFactory.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/enhanced/EnhancedContextFactory.java
Fri Nov  3 11:00:10 2006
@@ -20,7 +20,7 @@
 package org.apache.tiles.context.enhanced;
 
 import org.apache.tiles.TilesApplicationContext;
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 import org.apache.tiles.context.BasicTilesContextFactory;
 
 import javax.servlet.jsp.PageContext;

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/jsp/JspTilesRequestContext.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/jsp/JspTilesRequestContext.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/jsp/JspTilesRequestContext.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/jsp/JspTilesRequestContext.java
Fri Nov  3 11:00:10 2006
@@ -22,16 +22,14 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.tiles.TilesException;
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 import org.apache.tiles.context.servlet.ServletTilesRequestContext;
 
 import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.jsp.PageContext;
 import javax.servlet.jsp.JspException;
-import java.io.IOException;
 
 /**
  * Context implementation used for executing tiles within a

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/portlet/PortletTilesApplicationContext.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/portlet/PortletTilesApplicationContext.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/portlet/PortletTilesApplicationContext.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/portlet/PortletTilesApplicationContext.java
Fri Nov  3 11:00:10 2006
@@ -20,7 +20,7 @@
 package org.apache.tiles.context.portlet;
 
 import org.apache.tiles.TilesApplicationContext;
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 
 import javax.portlet.PortletContext;
 import javax.portlet.PortletRequest;

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/portlet/PortletTilesRequestContext.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/portlet/PortletTilesRequestContext.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/portlet/PortletTilesRequestContext.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/portlet/PortletTilesRequestContext.java
Fri Nov  3 11:00:10 2006
@@ -19,7 +19,7 @@
  */
 package org.apache.tiles.context.portlet;
 
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 
 import javax.portlet.*;
 import java.io.IOException;

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesApplicationContext.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesApplicationContext.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesApplicationContext.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesApplicationContext.java
Fri Nov  3 11:00:10 2006
@@ -20,7 +20,7 @@
 package org.apache.tiles.context.servlet;
 
 import org.apache.tiles.TilesApplicationContext;
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesRequestContext.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesRequestContext.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesRequestContext.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/context/servlet/ServletTilesRequestContext.java
Fri Nov  3 11:00:10 2006
@@ -19,7 +19,7 @@
  */
 package org.apache.tiles.context.servlet;
 
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsFactory.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsFactory.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsFactory.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/DefinitionsFactory.java
Fri Nov  3 11:00:10 2006
@@ -20,7 +20,7 @@
 
 package org.apache.tiles.definition;
 
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 
 import java.util.Map;
 

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/UrlDefinitionsFactory.java
Fri Nov  3 11:00:10 2006
@@ -21,7 +21,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 import org.apache.tiles.definition.digester.DigesterDefinitionsReader;
 import org.apache.tiles.util.RequestUtils;
 

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java
Fri Nov  3 11:00:10 2006
@@ -214,7 +214,7 @@
         String LIST_TAG = "putList";
         String DEF_LIST_TAG = DEFINITION_TAG + "/" + LIST_TAG;
 
-        String listHandlerClass = PACKAGE_NAME + ".ComponentListAttribute";
+        String listHandlerClass = PACKAGE_NAME + ".context.ComponentListAttribute";
         // Tag value for adding an element in a list
         String ADD_LIST_ELE_TAG = "*/" + LIST_TAG + "/add";
 

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/factory/TilesContainerFactory.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/factory/TilesContainerFactory.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/factory/TilesContainerFactory.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/factory/TilesContainerFactory.java
Fri Nov  3 11:00:10 2006
@@ -57,13 +57,14 @@
     public static final String PREPARER_FACTORY_INIT_PARAM =
         "org.apache.tiles.PREPARER_FACTORY";
 
-    private static final Map DEFAULT_IMPLEMENTATIONS = new HashMap();
+    private static final Map<String, String> DEFAULTS =
+        new HashMap<String, String>();
 
     static {
-        DEFAULT_IMPLEMENTATIONS.put(CONTAINER_FACTORY_INIT_PARAM, TilesContainerFactory.class.getName());
-        DEFAULT_IMPLEMENTATIONS.put(CONTEXT_FACTORY_INIT_PARAM, BasicTilesContextFactory.class.getName());
-        DEFAULT_IMPLEMENTATIONS.put(DEFINITIONS_FACTORY_INIT_PARAM, UrlDefinitionsFactory.class.getName());
-        DEFAULT_IMPLEMENTATIONS.put(PREPARER_FACTORY_INIT_PARAM, BasicPreparerFactory.class.getName());
+        DEFAULTS.put(CONTAINER_FACTORY_INIT_PARAM, TilesContainerFactory.class.getName());
+        DEFAULTS.put(CONTEXT_FACTORY_INIT_PARAM, BasicTilesContextFactory.class.getName());
+        DEFAULTS.put(DEFINITIONS_FACTORY_INIT_PARAM, UrlDefinitionsFactory.class.getName());
+        DEFAULTS.put(PREPARER_FACTORY_INIT_PARAM, BasicPreparerFactory.class.getName());
     }
 
     /**
@@ -76,9 +77,10 @@
      * the factory will attempt to utilize one of it's internal
      * factories.
      *
-     * @param context
-     * @return
-     * @throws TilesException
+     * @param context the executing applications context.
+     *        Typically a ServletContext or PortletContext
+     * @return a tiles container
+     * @throws TilesException if an error occurs creating the factory.
      */
     public static TilesContainerFactory getFactory(Object context)
         throws TilesException {
@@ -100,22 +102,23 @@
         PreparerFactory prepFactory =
             (PreparerFactory) createFactory(context, PREPARER_FACTORY_INIT_PARAM);
 
+        TilesApplicationContext tilesContext =
+            contextFactory.createApplicationContext(context);
+
         container.setDefinitionsFactory(defsFactory);
         container.setContextFactory(contextFactory);
         container.setPreparerFactory(prepFactory);
+        container.setApplicationContext(tilesContext);
 
-        TilesApplicationContext tilesContext =
-            contextFactory.createApplicationContext(context);
-
-        container.init(tilesContext);
+        container.init(getInitParameterMap(context));
 
         return container;
     }
 
 
-    public Map getInitParameterMap(Object context)
+    protected Map<String, String> getInitParameterMap(Object context)
         throws TilesException {
-        Map initParameters = new HashMap();
+        Map<String, String> initParameters = new HashMap<String, String>();
         Class contextClass = context.getClass();
         try {
             Method method = contextClass.getMethod("getInitParameterNames");
@@ -124,12 +127,12 @@
             method = contextClass.getMethod("getInitParameter", String.class);
             while (e.hasMoreElements()) {
                 String key = (String) e.nextElement();
-                initParameters.put(key, method.invoke(context, key));
+                initParameters.put(key, (String)method.invoke(context, key));
             }
         } catch (Exception e) {
             throw new TilesException("Unable to retrieve init parameters." +
                 " Is this context a ServletContext, PortletContext," +
-                " or similar object?");
+                " or similar object?", e);
         }
         return initParameters;
     }
@@ -154,7 +157,7 @@
     public static String resolveFactoryName(Object context, String parameterName)
         throws TilesException {
 
-        Object factoryName = null;
+        Object factoryName;
         try {
             Class contextClass = context.getClass();
             Method getInitParameterMethod =
@@ -165,7 +168,7 @@
                 "a ServletContext, PortletContext, or similar?", e);
         }
         return factoryName == null
-            ? DEFAULT_IMPLEMENTATIONS.get(parameterName).toString()
+            ? DEFAULTS.get(parameterName)
             : factoryName.toString();
     }
 }

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java
Fri Nov  3 11:00:10 2006
@@ -24,6 +24,7 @@
 import org.apache.tiles.*;
 import org.apache.tiles.context.BasicComponentContext;
 import org.apache.tiles.context.TilesContextFactory;
+import org.apache.tiles.context.TilesRequestContext;
 import org.apache.tiles.definition.ComponentDefinition;
 import org.apache.tiles.definition.DefinitionsFactory;
 import org.apache.tiles.definition.DefinitionsFactoryException;
@@ -78,20 +79,23 @@
 
     private TilesContextFactory contextFactory;
 
+    private boolean initialized = false;
+
     /**
      * Initialize the Container with the given configuration.
      *
-     * @param context application context for this container
+     * @param initParameters application context for this container
      * @throws TilesException
      */
-    public void init(TilesApplicationContext context) throws TilesException {
+    public void init(Map<String, String> initParameters) throws TilesException {
         checkInit();
+        initialized = true;
         if (LOG.isInfoEnabled()) {
             LOG.info("Initializing Tiles2 container. . .");
         }
-        this.context = context;
-        contextFactory.init(context.getInitParams());
-        definitionsFactory.init(context.getInitParams());
+        
+        contextFactory.init(initParameters);
+        definitionsFactory.init(initParameters);
 
         //Everything is now initialized.  We will populate
         // our definitions
@@ -128,7 +132,7 @@
      * @throws IllegalStateException if the container has already been initialized.
      */
     private void checkInit() {
-        if (context != null) {
+        if (initialized) {
             throw new IllegalStateException("Container allready initialized");
         }
     }
@@ -140,6 +144,10 @@
      */
     public TilesApplicationContext getApplicationContext() {
         return context;
+    }
+
+    public void setApplicationContext(TilesApplicationContext context) {
+        this.context = context;
     }
 
     public ComponentContext getComponentContext(Object request, Object response) {

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/BasicPreparerFactory.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/BasicPreparerFactory.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/BasicPreparerFactory.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/BasicPreparerFactory.java
Fri Nov  3 11:00:10 2006
@@ -21,7 +21,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 import org.apache.tiles.util.RequestUtils;
 
 import java.util.HashMap;

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerFactory.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerFactory.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerFactory.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/PreparerFactory.java
Fri Nov  3 11:00:10 2006
@@ -19,7 +19,7 @@
  */
 package org.apache.tiles.preparer;
 
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 
 /**
  * <p>

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java
Fri Nov  3 11:00:10 2006
@@ -19,8 +19,7 @@
  */
 package org.apache.tiles.preparer;
 
-import org.apache.tiles.context.BasicComponentContext;
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 import org.apache.tiles.ComponentContext;
 
 /**

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java
Fri Nov  3 11:00:10 2006
@@ -19,8 +19,7 @@
  */
 package org.apache.tiles.preparer;
 
-import org.apache.tiles.context.BasicComponentContext;
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 import org.apache.tiles.ComponentContext;
 
 /**

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertDefinitionTag.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertDefinitionTag.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertDefinitionTag.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertDefinitionTag.java
Fri Nov  3 11:00:10 2006
@@ -20,10 +20,7 @@
 
 package org.apache.tiles.taglib;
 
-import org.apache.tiles.TilesRequestContext;
-import org.apache.tiles.definition.ComponentDefinition;
 import org.apache.tiles.definition.NoSuchDefinitionException;
-import org.apache.tiles.taglib.util.TagUtils;
 
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.PageContext;

Modified: struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/MockOnlyLocaleTilesContext.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/MockOnlyLocaleTilesContext.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/MockOnlyLocaleTilesContext.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/MockOnlyLocaleTilesContext.java
Fri Nov  3 11:00:10 2006
@@ -26,7 +26,7 @@
 import java.util.Locale;
 import java.util.Map;
 
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 
 /**
  * Creates a TilesApplicationContext that contains only a Locale
@@ -51,7 +51,7 @@
     /**
      * Returns the locale specified in the constructor.
      * 
-     * @see org.apache.tiles.TilesRequestContext#getRequestLocale()
+     * @see org.apache.tiles.context.TilesRequestContext#getRequestLocale()
      */
     public Locale getRequestLocale() {
         return locale;

Modified: struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/MockPublicUrlDefinitionsFactory.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/MockPublicUrlDefinitionsFactory.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/MockPublicUrlDefinitionsFactory.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/MockPublicUrlDefinitionsFactory.java
Fri Nov  3 11:00:10 2006
@@ -22,7 +22,7 @@
 
 import org.apache.tiles.definition.ComponentDefinitions;
 import org.apache.tiles.definition.DefinitionsFactoryException;
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 import org.apache.tiles.definition.UrlDefinitionsFactory;
 
 /**
@@ -38,7 +38,7 @@
      * <code>UrlDefinitionsFactory</code>
      * 
      * @see org.apache.tiles.definition.UrlDefinitionsFactory#addDefinitions(org.apache.tiles.definition.ComponentDefinitions,
-     *      org.apache.tiles.TilesRequestContext)
+     *org.apache.tiles.context.TilesRequestContext)
      */
     public void addDefinitions(ComponentDefinitions definitions,
             TilesRequestContext tilesContext) throws DefinitionsFactoryException {
@@ -50,7 +50,7 @@
      * Exposes the <code>isLocaleProcessed</code> method of
      * <code>UrlDefinitionsFactory</code>
      * 
-     * @see org.apache.tiles.definition.UrlDefinitionsFactory#isLocaleProcessed(org.apache.tiles.TilesRequestContext)
+     * @see org.apache.tiles.definition.UrlDefinitionsFactory#isLocaleProcessed(org.apache.tiles.context.TilesRequestContext)
      */
     public boolean isLocaleProcessed(TilesRequestContext tilesContext) {
         return super.isLocaleProcessed(tilesContext);

Modified: struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/TestUrlDefinitionsFactory.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/TestUrlDefinitionsFactory.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/TestUrlDefinitionsFactory.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/definition/TestUrlDefinitionsFactory.java
Fri Nov  3 11:00:10 2006
@@ -36,7 +36,7 @@
 import org.apache.tiles.definition.MockPublicUrlDefinitionsFactory;
 import org.apache.tiles.definition.MockDefinitionsReader;
 import org.apache.tiles.definition.MockOnlyLocaleTilesContext;
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 
 /**
  * Tests the UrlDefinitionsFactory component.

Modified: struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/factory/TilesContainerFactoryTest.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/factory/TilesContainerFactoryTest.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/factory/TilesContainerFactoryTest.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/test/java/org/apache/tiles/factory/TilesContainerFactoryTest.java
Fri Nov  3 11:00:10 2006
@@ -32,6 +32,7 @@
 
 import java.util.Map;
 import java.util.Vector;
+import java.util.HashMap;
 import java.net.URL;
 import java.net.MalformedURLException;
 
@@ -71,10 +72,12 @@
 
     public void testCreateContainer() throws TilesException, MalformedURLException {
         URL url = getClass().getResource("test-defs.xml");
+        Vector enumeration = new Vector();
         EasyMock.expect(context.getInitParameter(TilesContainerFactory.CONTAINER_FACTORY_INIT_PARAM)).andReturn(null);
         EasyMock.expect(context.getInitParameter(TilesContainerFactory.CONTEXT_FACTORY_INIT_PARAM)).andReturn(null);
         EasyMock.expect(context.getInitParameter(TilesContainerFactory.DEFINITIONS_FACTORY_INIT_PARAM)).andReturn(null);
         EasyMock.expect(context.getInitParameter(EasyMock.isA(String.class))).andReturn(null).anyTimes();
+        EasyMock.expect(context.getInitParameterNames()).andReturn(enumeration.elements());
         EasyMock.expect(context.getResource("/WEB-INF/tiles.xml")).andReturn(url);
         EasyMock.replay(context);
 
@@ -84,7 +87,7 @@
         assertNotNull(container);
         //now make sure it's initialized
         try {
-            container.init(null);
+            container.init(new HashMap<String, String>());
             fail("Container should have allready been initialized");
         }
         catch (IllegalStateException te) {

Modified: struts/sandbox/trunk/tiles/tiles-test/src/main/java/org/apache/tiles/test/preparer/TestViewPreparer.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-test/src/main/java/org/apache/tiles/test/preparer/TestViewPreparer.java?view=diff&rev=470947&r1=470946&r2=470947
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-test/src/main/java/org/apache/tiles/test/preparer/TestViewPreparer.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-test/src/main/java/org/apache/tiles/test/preparer/TestViewPreparer.java
Fri Nov  3 11:00:10 2006
@@ -20,7 +20,7 @@
 package org.apache.tiles.test.preparer;
 
 import org.apache.tiles.preparer.ViewPreparer;
-import org.apache.tiles.TilesRequestContext;
+import org.apache.tiles.context.TilesRequestContext;
 import org.apache.tiles.ComponentContext;
 import org.apache.tiles.ComponentAttribute;
 



Mime
View raw message