You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ar...@apache.org on 2009/12/09 22:01:33 UTC

svn commit: r888969 - in /myfaces/trinidad/branches/1.2.12.2-branch: trinidad-api/ trinidad-impl/ trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/ trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/

Author: arobinson74
Date: Wed Dec  9 21:01:33 2009
New Revision: 888969

URL: http://svn.apache.org/viewvc?rev=888969&view=rev
Log:
Add support for createVisitContext in MRequestContext

Added:
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/MVisitContextFactory.java   (with props)
Modified:
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/pom.xml
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/pom.xml
    myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MRequestContext.java

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/pom.xml?rev=888969&r1=888968&r2=888969&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/pom.xml (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-api/pom.xml Wed Dec  9 21:01:33 2009
@@ -94,6 +94,12 @@
       <plugin>
         <groupId>org.apache.myfaces.trinidadbuild</groupId>
         <artifactId>maven-jdev-plugin</artifactId>
+        <configuration>
+          <projectHasTests>true</projectHasTests>
+          <testSourceRoots>
+            <file>${project.basedir}/src/test</file>
+          </testSourceRoots>
+        </configuration>
       </plugin>
 
       <plugin>

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/pom.xml?rev=888969&r1=888968&r2=888969&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/pom.xml (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/pom.xml Wed Dec  9 21:01:33 2009
@@ -135,6 +135,10 @@
           <resourceRoots>
             <resourceRoot>src/main/javascript/</resourceRoot>
           </resourceRoots>
+          <projectHasTests>true</projectHasTests>
+          <testSourceRoots>
+            <file>${project.basedir}/src/test</file>
+          </testSourceRoots>
         </configuration>
       </plugin>
       <plugin>

Added: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/MVisitContextFactory.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/MVisitContextFactory.java?rev=888969&view=auto
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/MVisitContextFactory.java (added)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/MVisitContextFactory.java Wed Dec  9 21:01:33 2009
@@ -0,0 +1,28 @@
+package org.apache.myfaces.trinidadinternal.context;
+
+import java.util.Collection;
+import java.util.Set;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseId;
+
+import org.apache.myfaces.trinidad.component.visit.VisitContext;
+import org.apache.myfaces.trinidad.component.visit.VisitHint;
+
+
+public final class MVisitContextFactory
+{
+  private MVisitContextFactory() {}
+
+  public static VisitContext createVisitContext(
+   FacesContext       context,
+   Collection<String> ids,
+   Set<VisitHint>     hints,
+   PhaseId            phaseId)
+  {
+    if ((ids == null) || ids.isEmpty())
+      return new FullVisitContext(context, hints, phaseId);
+    else
+      return new PartialVisitContext(context, ids, hints, phaseId);
+  }
+}

Propchange: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/context/MVisitContextFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MRequestContext.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MRequestContext.java?rev=888969&r1=888968&r2=888969&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MRequestContext.java (original)
+++ myfaces/trinidad/branches/1.2.12.2-branch/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MRequestContext.java Wed Dec  9 21:01:33 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -19,6 +19,7 @@
 package org.apache.myfaces.trinidadinternal.renderkit;
 
 import java.awt.Color;
+
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -27,33 +28,30 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.TimeZone;
+
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 import javax.faces.event.PhaseId;
 
 import org.apache.myfaces.trinidad.change.ChangeManager;
-import org.apache.myfaces.trinidad.config.RegionManager;
-
 import org.apache.myfaces.trinidad.component.visit.VisitContext;
 import org.apache.myfaces.trinidad.component.visit.VisitHint;
-
-
+import org.apache.myfaces.trinidad.config.RegionManager;
 import org.apache.myfaces.trinidad.context.AccessibilityProfile;
-import org.apache.myfaces.trinidad.context.RequestContext;
 import org.apache.myfaces.trinidad.context.Agent;
-import org.apache.myfaces.trinidad.context.PageResolver;
-import org.apache.myfaces.trinidad.context.PageFlowScopeProvider;
 import org.apache.myfaces.trinidad.context.DialogService;
-
+import org.apache.myfaces.trinidad.context.PageFlowScopeProvider;
+import org.apache.myfaces.trinidad.context.PageResolver;
+import org.apache.myfaces.trinidad.context.RequestContext;
 import org.apache.myfaces.trinidad.webapp.UploadedFileProcessor;
-
+import org.apache.myfaces.trinidadinternal.context.MVisitContextFactory;
 import org.apache.myfaces.trinidadinternal.context.PageFlowScopeProviderImpl;
 import org.apache.myfaces.trinidadinternal.context.PageResolverDefaultImpl;
 
+
 public class MRequestContext extends RequestContext
 {
-
   public MRequestContext()
   {
     attach();
@@ -99,7 +97,7 @@
 
   @Override
   public void returnFromDialog(
-      Object returnValue, 
+      Object returnValue,
       Map<Object, Object> returnParam)
   {
     throw new UnsupportedOperationException("Should not be called during rendering");
@@ -107,10 +105,10 @@
 
   @Override
   public void launchDialog(
-      UIViewRoot dialogRoot, 
-      Map<String, Object> dialogParameters, 
-      UIComponent source, 
-      boolean useWindow, 
+      UIViewRoot dialogRoot,
+      Map<String, Object> dialogParameters,
+      UIComponent source,
+      boolean useWindow,
       Map<String, Object> windowProperties)
   {
     throw new UnsupportedOperationException("Should not be called during rendering");
@@ -121,7 +119,7 @@
   {
     return false;
   }
-  
+
   @Override
   public boolean isPartialRequest(FacesContext context)
   {
@@ -304,14 +302,14 @@
   {
     // throw new UnsupportedOperationException("Not implemented yet");
   }
-  
+
   /**
    * @see org.apache.myfaces.trinidad.context.RequestContext#addPartialTargets(javax.faces.component.UIComponent, java.lang.String[])
    */
   @Override
   public void addPartialTargets(UIComponent from, String... targets)
   {
-    
+
   }
 
   @Override
@@ -382,7 +380,7 @@
    Set<VisitHint> hints,
    PhaseId phaseId)
   {
-    throw new UnsupportedOperationException("Not implemented yet");
+    return MVisitContextFactory.createVisitContext(context, ids, hints, phaseId);
   }
 
   @Override
@@ -440,7 +438,7 @@
 
   static private TimeZone _FIXED_TIME_ZONE =
     TimeZone.getTimeZone("America/Los_Angeles");
-    
+
   static private final String _VIEW_MAP_KEY =
     MRequestContext.class.getName() + ".VIEW_MAP";
 }