You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2008/05/05 19:47:59 UTC

svn commit: r653538 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry/corelib/mixins/ main/java/org/apache/tapestry/internal/model/ main/java/org/apache/tapestry/internal/services/ main/java/org/apache/tapestry/internal/st...

Author: hlship
Date: Mon May  5 10:47:58 2008
New Revision: 653538

URL: http://svn.apache.org/viewvc?rev=653538&view=rev
Log:
TAPESTRY-2397: Mixins inside components should have an id that extends from from the containing component, but is still unique and URL safe

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/mixins/Autocomplete.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/model/MutableComponentModelImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentSourceImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageElementFactoryImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElement.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImpl.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentSource.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/model/MutableComponentModelImplTest.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImplTest.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/mixins/Autocomplete.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/mixins/Autocomplete.java?rev=653538&r1=653537&r2=653538&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/mixins/Autocomplete.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/mixins/Autocomplete.java Mon May  5 10:47:58 2008
@@ -86,7 +86,7 @@
     /**
      * Overwrites the default minimum characters to trigger a server round trip (the default is 1).
      */
-    @Parameter(defaultPrefix = "literal")
+    @Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
     private int _minChars;
 
     @Inject
@@ -97,14 +97,14 @@
      * Overrides the default check frequency for determining whether to send a server request. The default is .4
      * seconds.
      */
-    @Parameter(defaultPrefix = "literal")
+    @Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
     private double _frequency;
 
     /**
      * If given, then the autocompleter will support multiple input values, seperated by any of the individual
      * characters in the string.
      */
-    @Parameter(defaultPrefix = "literal")
+    @Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
     private String _tokens;
 
     /**

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/model/MutableComponentModelImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/model/MutableComponentModelImpl.java?rev=653538&r1=653537&r2=653538&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/model/MutableComponentModelImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/model/MutableComponentModelImpl.java Mon May  5 10:47:58 2008
@@ -202,9 +202,7 @@
 
     public String setFieldPersistenceStrategy(String fieldName, String strategy)
     {
-        String stripped = InternalUtils.stripMemberPrefix(fieldName);
-
-        String logicalFieldName = _persistentFieldNameAllocator.allocateId(stripped);
+        String logicalFieldName = _persistentFieldNameAllocator.allocateId(fieldName);
 
         if (_persistentFields == null) _persistentFields = newMap();
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentSourceImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentSourceImpl.java?rev=653538&r1=653537&r2=653538&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentSourceImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentSourceImpl.java Mon May  5 10:47:58 2008
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 2007, 2008 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -14,6 +14,8 @@
 
 package org.apache.tapestry.internal.services;
 
+import org.apache.tapestry.ComponentResources;
+import org.apache.tapestry.internal.structure.ComponentPageElement;
 import org.apache.tapestry.internal.structure.Page;
 import org.apache.tapestry.runtime.Component;
 import org.apache.tapestry.services.ComponentSource;
@@ -27,23 +29,40 @@
         _pageCache = pageCache;
     }
 
-    public Component getComponent(String componentId)
+    public Component getComponent(String completeId)
     {
-        int colonx = componentId.indexOf(':');
+        int colonx = completeId.indexOf(':');
 
         if (colonx < 0)
         {
-            Page page = _pageCache.get(componentId);
+            Page page = _pageCache.get(completeId);
 
             return page.getRootComponent();
         }
 
-        String pageName = componentId.substring(0, colonx);
+        String pageName = completeId.substring(0, colonx);
 
         Page page = _pageCache.get(pageName);
-        String nestedId = componentId.substring(colonx + 1);
+        String nestedId = completeId.substring(colonx + 1);
+        String mixinId = null;
 
-        return page.getComponentElementByNestedId(nestedId).getComponent();
+        int dollarx = nestedId.indexOf("$");
+
+        if (dollarx > 0)
+        {
+            mixinId = nestedId.substring(dollarx + 1);
+            nestedId = nestedId.substring(0, dollarx);
+        }
+
+
+        ComponentPageElement element = page.getComponentElementByNestedId(nestedId);
+
+        if (mixinId == null)
+            return element.getComponent();
+
+        ComponentResources resources = element.getMixinResources(mixinId);
+
+        return resources.getComponent();
     }
 
     public Component getPage(String pageName)

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageElementFactoryImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageElementFactoryImpl.java?rev=653538&r1=653537&r2=653538&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageElementFactoryImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageElementFactoryImpl.java Mon May  5 10:47:58 2008
@@ -283,8 +283,7 @@
 
     public void addMixinByClassName(ComponentPageElement component, String mixinClassName)
     {
-        Instantiator mixinInstantiator = _componentInstantiatorSource
-                .findInstantiator(mixinClassName);
+        Instantiator mixinInstantiator = _componentInstantiatorSource.findInstantiator(mixinClassName);
 
         component.addMixin(mixinInstantiator);
     }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElement.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElement.java?rev=653538&r1=653537&r2=653538&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElement.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElement.java Mon May  5 10:47:58 2008
@@ -15,6 +15,7 @@
 package org.apache.tapestry.internal.structure;
 
 import org.apache.tapestry.Block;
+import org.apache.tapestry.ComponentResources;
 import org.apache.tapestry.ComponentResourcesCommon;
 import org.apache.tapestry.internal.InternalComponentResources;
 import org.apache.tapestry.internal.InternalComponentResourcesCommon;
@@ -91,6 +92,16 @@
     ComponentPageElement getEmbeddedElement(String id);
 
     /**
+     * Returns the {@link org.apache.tapestry.ComponentResources} for a mixin attached to this component element. Mixin
+     * ids are the simple names of the mixin class.
+     *
+     * @param mixinId the mixin id (case insensitive)
+     * @return the resources for the component
+     * @throws IllegalArgumentException if no mixin with the given id exists
+     */
+    ComponentResources getMixinResources(String mixinId);
+
+    /**
      * Invoked when the component should render its body.
      */
     void enqueueBeforeRenderBody(RenderQueue queue);

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java?rev=653538&r1=653537&r2=653538&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/ComponentPageElementImpl.java Mon May  5 10:47:58 2008
@@ -441,9 +441,10 @@
     private boolean _loaded;
 
     /**
-     * Map from mixin name to resources for the mixin. Created when first mixin is added.
+     * Map from mixin id (the simple name of the mixin class) to resources for the mixin. Created when first mixin is
+     * added.
      */
-    private Map<String, InternalComponentResources> _mixinsByShortName;
+    private Map<String, InternalComponentResources> _mixinIdToComponentResources;
 
     private final String _nestedId;
 
@@ -568,8 +569,9 @@
             }
         }
 
-        _coreResources = new InternalComponentResourcesImpl(_page, this, containerResources, instantiator,
-                                                            _pageResources);
+        _coreResources = new InternalComponentResourcesImpl(_page, this, containerResources, _pageResources,
+                                                            _completeId, _nestedId, instantiator
+        );
 
         _coreComponent = _coreResources.getComponent();
     }
@@ -597,21 +599,26 @@
 
     public void addMixin(Instantiator instantiator)
     {
-        if (_mixinsByShortName == null)
+        if (_mixinIdToComponentResources == null)
         {
-            _mixinsByShortName = newCaseInsensitiveMap();
+            _mixinIdToComponentResources = newCaseInsensitiveMap();
             _components = newList();
         }
 
         String mixinClassName = instantiator.getModel().getComponentClassName();
         String mixinName = TapestryInternalUtils.lastTerm(mixinClassName);
 
+        String mixinExtension = "$" + mixinName.toLowerCase();
+
         InternalComponentResourcesImpl resources = new InternalComponentResourcesImpl(_page, this, _coreResources,
-                                                                                      instantiator, _pageResources);
+                                                                                      _pageResources,
+                                                                                      _completeId + mixinExtension,
+                                                                                      _nestedId + mixinExtension,
+                                                                                      instantiator);
 
         // TODO: Check for name collision?
 
-        _mixinsByShortName.put(mixinName, resources);
+        _mixinIdToComponentResources.put(mixinName, resources);
 
         _components.add(resources.getComponent());
     }
@@ -625,7 +632,7 @@
         if (dotx > 0)
         {
             String mixinName = parameterName.substring(0, dotx);
-            InternalComponentResources mixinResources = InternalUtils.get(_mixinsByShortName, mixinName);
+            InternalComponentResources mixinResources = InternalUtils.get(_mixinIdToComponentResources, mixinName);
 
             if (mixinResources == null) throw new TapestryException(
                     StructureMessages.missingMixinForParameter(_completeId, mixinName, parameterName), binding, null);
@@ -646,9 +653,9 @@
             return;
         }
 
-        for (String mixinName : InternalUtils.sortedKeys(_mixinsByShortName))
+        for (String mixinName : InternalUtils.sortedKeys(_mixinIdToComponentResources))
         {
-            InternalComponentResources resources = _mixinsByShortName.get(mixinName);
+            InternalComponentResources resources = _mixinIdToComponentResources.get(mixinName);
             if (resources.getComponentModel().getParameterModel(parameterName) != null)
             {
                 resources.bindParameter(parameterName, binding);
@@ -800,12 +807,12 @@
         return embeddedElement;
     }
 
-
     public String getId()
     {
         return _id;
     }
 
+
     public Logger getLogger()
     {
         return _coreResources.getLogger();
@@ -815,9 +822,9 @@
     {
         Component result = null;
 
-        if (_mixinsByShortName != null)
+        if (_mixinIdToComponentResources != null)
         {
-            for (InternalComponentResources resources : _mixinsByShortName.values())
+            for (InternalComponentResources resources : _mixinIdToComponentResources.values())
             {
                 if (resources.getComponentModel().getComponentClassName().equals(mixinClassName))
                 {
@@ -833,6 +840,20 @@
         return result;
     }
 
+    public ComponentResources getMixinResources(String mixinId)
+    {
+        ComponentResources result = null;
+
+        if (_mixinIdToComponentResources != null)
+            result = _mixinIdToComponentResources.get(mixinId);
+
+        if (result == null)
+            throw new IllegalArgumentException(
+                    String.format("Unable to locate mixin '%s' for component '%s'.", mixinId, _completeId));
+
+        return result;
+    }
+
     public String getNestedId()
     {
         return _nestedId;
@@ -1052,8 +1073,8 @@
 
         addUnboundParameterNames(null, unbound, _coreResources);
 
-        for (String name : InternalUtils.sortedKeys(_mixinsByShortName))
-            addUnboundParameterNames(name, unbound, _mixinsByShortName.get(name));
+        for (String name : InternalUtils.sortedKeys(_mixinIdToComponentResources))
+            addUnboundParameterNames(name, unbound, _mixinIdToComponentResources.get(name));
 
         if (unbound.isEmpty()) return;
 
@@ -1104,7 +1125,7 @@
         if (dotx > 0)
         {
             String mixinName = parameterName.substring(0, dotx);
-            InternalComponentResources mixinResources = InternalUtils.get(_mixinsByShortName, mixinName);
+            InternalComponentResources mixinResources = InternalUtils.get(_mixinIdToComponentResources, mixinName);
 
             if (mixinResources == null) throw new TapestryException(
                     StructureMessages.missingMixinForParameter(_completeId, mixinName, parameterName), null, null);
@@ -1124,9 +1145,9 @@
 
         // Search for mixin that it is a formal parameter of
 
-        for (String mixinName : InternalUtils.sortedKeys(_mixinsByShortName))
+        for (String mixinName : InternalUtils.sortedKeys(_mixinIdToComponentResources))
         {
-            InternalComponentResources resources = _mixinsByShortName.get(mixinName);
+            InternalComponentResources resources = _mixinIdToComponentResources.get(mixinName);
 
             pm = resources.getComponentModel().getParameterModel(parameterName);
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImpl.java?rev=653538&r1=653537&r2=653538&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImpl.java Mon May  5 10:47:58 2008
@@ -44,6 +44,8 @@
 {
     private final Page _page;
 
+    private final String _completeId;
+
     private final String _nestedId;
 
     private final ComponentModel _componentModel;
@@ -54,28 +56,29 @@
 
     private final ComponentResources _containerResources;
 
+    private final PageResources _pageResources;
+
     // Case insensitive
     private Map<String, Binding> _bindings;
 
-    private final PageResources _pageResources;
-
     private Messages _messages;
 
     // Case insensitive
     private Map<String, Object> _renderVariables;
 
     public InternalComponentResourcesImpl(Page page, ComponentPageElement element,
-                                          ComponentResources containerResources, Instantiator componentInstantiator,
-                                          PageResources elementResources)
+                                          ComponentResources containerResources, PageResources pageResources,
+                                          String completeId, String nestedId, Instantiator componentInstantiator
+    )
     {
         _page = page;
         _element = element;
         _containerResources = containerResources;
-        _pageResources = elementResources;
-        _componentModel = componentInstantiator.getModel();
-
-        _nestedId = _element.getNestedId();
+        _pageResources = pageResources;
+        _completeId = completeId;
+        _nestedId = nestedId;
 
+        _componentModel = componentInstantiator.getModel();
         _component = componentInstantiator.newInstance(this);
     }
 
@@ -116,12 +119,14 @@
     }
 
     /**
-     * Delegates to the {@link Page#createActionLink(String, String, boolean, Object[])} on the containing page. Why the
-     * extra layer? Trying to avoid some unwanted injection (of LinkFactory, into every component page element).
+     * Delegates to the {@link Page#createActionLink(String, String, boolean, Object[])} on the containing page. Uses
+     * the element's nested id (i.e., a mixin can generate a link, but the link targets the component, not the mixin
+     * itself). Why the extra layer? Trying to avoid some unwanted injection (of LinkFactory, into every component page
+     * element).
      */
     public Link createActionLink(String action, boolean forForm, Object... context)
     {
-        return _page.createActionLink(_nestedId, action, forForm, context);
+        return _page.createActionLink(_element.getNestedId(), action, forForm, context);
     }
 
     public Link createPageLink(String pageName, boolean override, Object... context)
@@ -141,7 +146,7 @@
 
     public String getCompleteId()
     {
-        return _element.getCompleteId();
+        return _completeId;
     }
 
     public Component getComponent()
@@ -180,7 +185,7 @@
 
     public String getNestedId()
     {
-        return _element.getNestedId();
+        return _nestedId;
     }
 
     public Component getPage()

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentSource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentSource.java?rev=653538&r1=653537&r2=653538&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentSource.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentSource.java Mon May  5 10:47:58 2008
@@ -14,7 +14,6 @@
 
 package org.apache.tapestry.services;
 
-import org.apache.tapestry.ComponentResourcesCommon;
 import org.apache.tapestry.runtime.Component;
 
 /**
@@ -25,14 +24,16 @@
 public interface ComponentSource
 {
     /**
-     * Gets a component by its complete id.
+     * Gets a component by its {@linkplain org.apache.tapestry.ComponentResourcesCommon#getCompleteId() complete id}. If
+     * the component id is for a mixin, then the mixin attached to the component will be returned. A mixin's complete id
+     * is its container's complete id, suffixed with "$" and the mixin's id (its simple class name).
      *
-     * @param componentId complete component id
+     * @param completeId complete component id (case insensitive)
      * @return the component
      * @throws IllegalArgumentException if the component can not be found
-     * @see ComponentResourcesCommon#getCompleteId()
+     * @see org.apache.tapestry.ComponentResourcesCommon#getCompleteId()
      */
-    Component getComponent(String componentId);
+    Component getComponent(String completeId);
 
     /**
      * Returns the page identified by its logical page name. A logical page name is the short form of a page name often

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/model/MutableComponentModelImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/model/MutableComponentModelImplTest.java?rev=653538&r1=653537&r2=653538&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/model/MutableComponentModelImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/model/MutableComponentModelImplTest.java Mon May  5 10:47:58 2008
@@ -28,8 +28,8 @@
 import java.util.Arrays;
 
 /**
- * Tests {@link org.apache.tapestry.internal.model.MutableComponentModelImpl} and
- * {@link org.apache.tapestry.internal.model.MutableEmbeddedComponentModelImpl}.
+ * Tests {@link org.apache.tapestry.internal.model.MutableComponentModelImpl} and {@link
+ * org.apache.tapestry.internal.model.MutableEmbeddedComponentModelImpl}.
  */
 public class MutableComponentModelImplTest extends InternalBaseTestCase
 {
@@ -467,24 +467,6 @@
     }
 
     @Test
-    public void persistent_field_names_have_punctuation_stripped()
-    {
-        Resource r = mockResource();
-        Logger logger = mockLogger();
-
-        replay();
-
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
-
-        assertEquals(model.setFieldPersistenceStrategy("_fred", "session"), "fred");
-        assertEquals(model.setFieldPersistenceStrategy("_$barney", "client"), "barney");
-
-        assertEquals(model.getPersistentFieldNames(), Arrays.asList("barney", "fred"));
-
-        verify();
-    }
-
-    @Test
     public void get_persistent_field_names_reflects_parent_model()
     {
         Resource r = mockResource();

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImplTest.java?rev=653538&r1=653537&r2=653538&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/structure/InternalComponentResourcesImplTest.java Mon May  5 10:47:58 2008
@@ -39,13 +39,12 @@
         TypeCoercer coercer = mockTypeCoercer();
         ComponentModel model = mockComponentModel();
 
-        train_getNestedId(element, "foo.bar");
-
         train_getModel(ins, model);
 
         replay();
 
-        InternalComponentResources resources = new InternalComponentResourcesImpl(null, element, null, ins, null);
+        InternalComponentResources resources = new InternalComponentResourcesImpl(null, element, null, null, null,
+                                                                                  null, ins);
 
         resources.renderInformalParameters(writer);
 
@@ -59,20 +58,18 @@
         Component component = mockComponent();
         Instantiator ins = mockInstantiator(component);
         MarkupWriter writer = mockMarkupWriter();
-        TypeCoercer coercer = mockTypeCoercer();
         ComponentModel model = mockComponentModel();
         ParameterModel pmodel = mockParameterModel();
         Binding binding = mockBinding();
 
-        train_getNestedId(element, "foo.bar");
-
         train_getModel(ins, model);
 
         train_getParameterModel(model, "fred", pmodel);
 
         replay();
 
-        InternalComponentResources resources = new InternalComponentResourcesImpl(null, element, null, ins, null);
+        InternalComponentResources resources = new InternalComponentResourcesImpl(null, element, null, null, null,
+                                                                                  null, ins);
 
         resources.bindParameter("fred", binding);
 
@@ -94,8 +91,6 @@
         String convertedValue = "*converted*";
         PageResources pageResources = mockPageResources();
 
-        train_getNestedId(element, "foo.bar");
-
         train_getModel(ins, model);
 
         train_getParameterModel(model, "fred", null);
@@ -108,8 +103,8 @@
 
         replay();
 
-        InternalComponentResources resources = new InternalComponentResourcesImpl(null, element, null, ins,
-                                                                                  pageResources);
+        InternalComponentResources resources = new InternalComponentResourcesImpl(null, element, null, pageResources,
+                                                                                  null, null, ins);
 
         resources.bindParameter("fred", binding);
 
@@ -128,15 +123,13 @@
 
         Object value = new Object();
 
-        train_getNestedId(element, "foo.bar");
-
         train_getModel(ins, model);
 
         train_isRendering(element, true);
 
         replay();
 
-        ComponentResources resources = new InternalComponentResourcesImpl(null, element, null, ins, null);
+        ComponentResources resources = new InternalComponentResourcesImpl(null, element, null, null, null, null, ins);
 
         resources.storeRenderVariable("myRenderVar", value);
 
@@ -158,18 +151,15 @@
         ComponentModel model = mockComponentModel();
         ComponentPageElement element = mockComponentPageElement();
 
-        train_getNestedId(element, "foo.bar");
-
         train_getModel(ins, model);
 
         train_isRendering(element, true);
         train_isRendering(element, true);
 
-        train_getCompleteId(element, "Foo.bar");
-
         replay();
 
-        ComponentResources resources = new InternalComponentResourcesImpl(null, element, null, ins, null);
+        ComponentResources resources = new InternalComponentResourcesImpl(null, element, null, null, "Foo.bar", null,
+                                                                          ins);
 
         resources.storeRenderVariable("fred", "FRED");
         resources.storeRenderVariable("barney", "BARNEY");
@@ -196,18 +186,15 @@
         ComponentModel model = mockComponentModel();
         ComponentPageElement element = mockComponentPageElement();
 
-        train_getNestedId(element, "bar");
-
         train_getModel(ins, model);
 
         train_isRendering(element, true);
         train_isRendering(element, true);
 
-        train_getCompleteId(element, "Foo.bar");
-
         replay();
 
-        InternalComponentResources resources = new InternalComponentResourcesImpl(null, element, null, ins, null);
+        InternalComponentResources resources = new InternalComponentResourcesImpl(null, element, null, null, "Foo.bar",
+                                                                                  null, ins);
 
         resources.storeRenderVariable("fred", "FRED");
         resources.storeRenderVariable("barney", "BARNEY");
@@ -236,17 +223,14 @@
         ComponentModel model = mockComponentModel();
         ComponentPageElement element = mockComponentPageElement();
 
-        train_getNestedId(element, "foo.bar");
-
         train_getModel(ins, model);
 
         train_isRendering(element, false);
 
-        train_getCompleteId(element, "Foo.bar");
-
         replay();
 
-        InternalComponentResources resources = new InternalComponentResourcesImpl(null, element, null, ins, null);
+        InternalComponentResources resources = new InternalComponentResourcesImpl(null, element, null, null, "Foo.bar",
+                                                                                  null, ins);
 
 
         try
@@ -273,15 +257,14 @@
         Page page = mockPage();
         PageLifecycleListener listener = newMock(PageLifecycleListener.class);
 
-        train_getNestedId(element, "foo.bar");
-
         train_getModel(ins, model);
 
         page.addLifecycleListener(listener);
 
         replay();
 
-        InternalComponentResources resources = new InternalComponentResourcesImpl(page, element, null, ins, null);
+        InternalComponentResources resources = new InternalComponentResourcesImpl(page, element, null, null, null,
+                                                                                  null, ins);
 
         resources.addPageLifecycleListener(listener);