portals-bridges-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r539169 - /portals/bridges/trunk/jsf/src/java/org/apache/portals/bridges/jsf/PortletViewHandlerImpl.java
Date Thu, 17 May 2007 23:32:02 GMT
Author: taylor
Date: Thu May 17 16:32:01 2007
New Revision: 539169

URL: http://svn.apache.org/viewvc?view=rev&rev=539169
Log:
http://issues.apache.org/jira/browse/PB-62

contribution from Matt Bruzek

reviewed
im applying this patch, although Im still seeing broken behavior in the JSF Demo portlet that
comes with Bridges (jsf-demo)
leaving this issue open until i can get the jsf-demo and jetspeed-profiler ui working again

Modified:
    portals/bridges/trunk/jsf/src/java/org/apache/portals/bridges/jsf/PortletViewHandlerImpl.java

Modified: portals/bridges/trunk/jsf/src/java/org/apache/portals/bridges/jsf/PortletViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/portals/bridges/trunk/jsf/src/java/org/apache/portals/bridges/jsf/PortletViewHandlerImpl.java?view=diff&rev=539169&r1=539168&r2=539169
==============================================================================
--- portals/bridges/trunk/jsf/src/java/org/apache/portals/bridges/jsf/PortletViewHandlerImpl.java
(original)
+++ portals/bridges/trunk/jsf/src/java/org/apache/portals/bridges/jsf/PortletViewHandlerImpl.java
Thu May 17 16:32:01 2007
@@ -1,18 +1,17 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file 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
+ * Copyright 2004 The Apache Software Foundation.
  * 
- *      http://www.apache.org/licenses/LICENSE-2.0
+ * Licensed 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 KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
  */
 package org.apache.portals.bridges.jsf;
 
@@ -83,13 +82,24 @@
      */
     public UIViewRoot createView(FacesContext facesContext, String viewId)
     {        
-        UIViewRoot root = handler.createView(facesContext, viewId);
-        if (root != null)
+        PortletUIViewRoot portletViewRoot = null;
+        // Create the regular UIViewRoot from the ViewHandler.
+        UIViewRoot root = handler.createView( facesContext, viewId );
+        if ( root != null )
         {
-            facesContext.setViewRoot(root);
+            if ( root instanceof PortletUIViewRoot )
+            {
+              portletViewRoot = ( PortletUIViewRoot )root;
+            }
+            else
+            {
+              // Create a PortletUIViewRoot that will namespace properly.
+              portletViewRoot = new PortletUIViewRoot( root );
+            }
+            facesContext.setViewRoot( portletViewRoot );
         }
         
-        return root;
+        return portletViewRoot;
     }
 
     /**
@@ -132,12 +142,24 @@
      */
     public UIViewRoot restoreView(FacesContext facesContext, String viewId)
     {
-        UIViewRoot root = handler.restoreView(facesContext, viewId);
-        if (root != null)
+        PortletUIViewRoot portletViewRoot = null;
+        // Restore the UIViewRoot from the ViewHandler.
+        UIViewRoot root = handler.restoreView( facesContext, viewId );
+        if ( root != null )
         {
-            facesContext.setViewRoot(root);
+            // Is the root is already an instance of PortletUIViewRoot?
+            if ( root instanceof PortletUIViewRoot )
+            {
+                portletViewRoot = ( PortletUIViewRoot )root;
+            }
+            else  // The root is not a PortletUIViewRoot.
+            {
+                // Create a PortletViewRoot that will namespace properly.
+                portletViewRoot = new PortletUIViewRoot( root );
+            }
+            facesContext.setViewRoot( portletViewRoot );
         }
-        return root;
+        return portletViewRoot;
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: bridges-commits-unsubscribe@portals.apache.org
For additional commands, e-mail: bridges-commits-help@portals.apache.org


Mime
View raw message