You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mf...@apache.org on 2011/05/10 19:42:28 UTC

svn commit: r1101561 - in /myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge: BridgeConfig.java BridgeContext.java BridgeController.java BridgeLogger.java

Author: mfreedman
Date: Tue May 10 17:42:28 2011
New Revision: 1101561

URL: http://svn.apache.org/viewvc?rev=1101561&view=rev
Log:
Updated apis 

Modified:
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeConfig.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeContext.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeController.java
    myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeLogger.java

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeConfig.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeConfig.java?rev=1101561&r1=1101560&r2=1101561&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeConfig.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeConfig.java Tue May 10 17:42:28 2011
@@ -14,6 +14,8 @@ import java.util.List;
 
 import java.util.Map;
 
+import javax.faces.lifecycle.LifecycleFactory;
+
 import javax.portlet.PortletConfig;
 import javax.portlet.faces.BridgeEventHandler;
 import javax.portlet.faces.BridgePublicRenderParameterHandler;
@@ -336,5 +338,18 @@ public interface BridgeConfig
    */  
   public Map<String, String> getFacesSuffixes();
   
+  /**
+   * Sets the id of the lifecycle the portlet should use for executing Faces requests.
+   * @param id
+   */
+  public void setLifecyleId(String id);
+  
+  /**
+   * 
+   * @return the lifecycle id the portlet should use for executing Faces requests.  If not previously set the value 
+   * <code>LifecycleFactory.DEFAULT_LIFECYCLE</code> is returned.
+   */
+  public String getLifecycleId();
+  
   
 }
\ No newline at end of file

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeContext.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeContext.java?rev=1101561&r1=1101560&r2=1101561&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeContext.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeContext.java Tue May 10 17:42:28 2011
@@ -39,6 +39,9 @@ import javax.portlet.faces.Bridge;
  */
 public interface BridgeContext 
 {
+    
+  static final String BRIDGE_CONTEXT_CURRENT_INSTANCE = "org.apache.myfaces.portlet.faces.bridge.bridgeContextCurrentInstance";
+  
   /**
    * Called at the end of bridge request processing.  It releases associated
    * state.
@@ -322,5 +325,31 @@ public interface BridgeContext 
   public Map<String, String[]> getPreservedActionParams();
   
   
+  /**
+   * Bridge maintains in the session the last viewId accessed in each mode.  This allows
+   * developers to use EL access to get the viewId (with appropriate QS) to navigate back
+   * to the view that was left when a new mode was entered.  Key in the session is:
+   * javax.portlet.faces.viewIdHistory.<i>modeName</i>.  value is the corresponding viewId
+   * with an encoded QS containing the pertinent state (scope id, etc) to return you to the 
+   * state you left.  Prior to the first request the bridge sets up a default history by adding one
+   * session attribute per supported mode.  The value is the default viewId configured for this mode
+   * for this portlet.  This is done so a developers EL will always resolve to non-null.
+   * 
+   * @param mode name of the portlet mode
+   * @param viewId JSF view that we are currently in/adding to the history.  Includes a QS of the various state needed to restore this view
+   * @param preserveRenderParams indicates whether the render params are carried into the history.  Generally <code>true</code> is the view's mode
+   * hasn't changed from what the bridge finds encoded in its render params and <code>false</code> otherwise.
+   */
+  public void setViewHistory(String mode, String viewId, boolean preserveRenderParams);
+  
+  
+  /**
+   * Returns the last viewId rendered for a given mode.  Allows one to return to the view you left when you entered a new mode.
+   * Generally this isn't called directly other than potentially to verify that the attributes have initially been set up as the primary use
+   * case is to allow developers to access this value directly from the session object using EL.
+   * @param mode
+   * @return
+   */
+  public String getViewHistory(String mode);
   
 }
\ No newline at end of file

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeController.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeController.java?rev=1101561&r1=1101560&r2=1101561&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeController.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeController.java Tue May 10 17:42:28 2011
@@ -10,49 +10,48 @@
  */
 package org.apache.myfaces.portlet.faces.bridge;
 
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-import javax.portlet.faces.Bridge;
 import javax.portlet.faces.BridgeDefaultViewNotSpecifiedException;
 import javax.portlet.faces.BridgeException;
 import javax.portlet.faces.BridgeUninitializedException;
 
 
-public interface BridgeController extends Bridge
+public interface BridgeController 
 {
+  public void init(BridgeConfig config) throws BridgeException;
+  
+  public void destroy();
   
-  public void processAction(BridgeContext ctx)
+  public void processPortletAction(BridgeContext ctx)
      throws BridgeException,
             BridgeDefaultViewNotSpecifiedException,
             BridgeUninitializedException, 
             NullPointerException; 
   
-  public void handleEvent(BridgeContext ctx)
+  public void handlePortletEvent(BridgeContext ctx)
      throws BridgeException,
             BridgeDefaultViewNotSpecifiedException,
             BridgeUninitializedException, 
             NullPointerException;  
  
- public void renderHead(BridgeContext ctx)
+ public void renderPortletHead(BridgeContext ctx)
     throws BridgeException,
            BridgeDefaultViewNotSpecifiedException,
            BridgeUninitializedException, 
            NullPointerException;
 
-  public void renderBody(BridgeContext ctx)
+  public void renderPortletBody(BridgeContext ctx)
      throws BridgeException,
             BridgeDefaultViewNotSpecifiedException,
             BridgeUninitializedException, 
             NullPointerException;
   
-  public void getFacesResource(BridgeContext ctx)
+  public void renderFacesResource(BridgeContext ctx)
      throws BridgeException,
             BridgeDefaultViewNotSpecifiedException,
             BridgeUninitializedException, 
             NullPointerException;
   
-  public void getNonFacesResource(BridgeContext ctx)
+  public void renderNonFacesResource(BridgeContext ctx)
      throws BridgeException,
             BridgeDefaultViewNotSpecifiedException,
             BridgeUninitializedException, 

Modified: myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeLogger.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeLogger.java?rev=1101561&r1=1101560&r2=1101561&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeLogger.java (original)
+++ myfaces/portlet-bridge/core/branches/refactored_3.0.x/controller-api/src/main/java/org/apache/myfaces/portlet/faces/bridge/BridgeLogger.java Tue May 10 17:42:28 2011
@@ -20,7 +20,12 @@ package org.apache.myfaces.portlet.faces
 public interface BridgeLogger
 {
   
-
+  public void log(String msg);
   
+  public void log(String message, Throwable throwable);
+  
+  public boolean isEnabled();
+  
+  public int logLevel();
   
 }
\ No newline at end of file