[portal-commits] JBoss Portal SVN: r11790 - in branches/JBoss_Portal_Branch_2_7/core-admin/src: resources/portal-admin-war/WEB-INF and 1 other directory.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Tue Sep 2 17:30:19 EDT 2008


Author: chris.laprun at jboss.com
Date: 2008-09-02 17:30:19 -0400 (Tue, 02 Sep 2008)
New Revision: 11790

Modified:
   branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/CoordinationManagerBean.java
   branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
Log:
- Fixed issue with page reloading.
- More documentation.
- Re-organized faces-config.xml somewhat.

Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/CoordinationManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/CoordinationManagerBean.java	2008-09-02 21:27:13 UTC (rev 11789)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/coordination/CoordinationManagerBean.java	2008-09-02 21:30:19 UTC (rev 11790)
@@ -181,7 +181,7 @@
          selectedPage = (Page)portalObject;
 
          //perform surgery on portalobjectmanager
-         pomb.selectObject(pomb.getPortalObjectContainer().getObject(selectedPage.getId()));
+         pomb.selectObject(selectedPage.getId());
          return selectedPage;
       }
 
@@ -306,7 +306,7 @@
          aliasManager = replaceInSession("aliasManager", new AliasBindingManagerBean(this));
          eventManager = replaceInSession("eventManager", new EventWiringManagerBean(this));
          parameterManager = replaceInSession("parameterManager", new ParameterBindingManagerBean(this));
-         
+
          // Extract metadata only on window children and only if needed
          if (isExplicitEventsUsed() || isExplicitParametersUsed())
          {
@@ -381,11 +381,15 @@
    }
 
    /**
-    * 
-    * @param beanName
-    * @param newBean
-    * @param <T>
-    * @return
+    * Replaces the bean identified by the given name by the specified new one. Passing <code>null</code> for the new
+    * bean value will remove the bean reference from the session. If a bean was previously assigned to this name, then
+    * only a bean of the same type (as defined by {@link Class#isAssignableFrom(Class)}) can be assigned to this name.
+    * todo: JSF COMMON
+    *
+    * @param beanName the name identifying the bean to be replaced
+    * @param newBean  the new value for the bean to be replaced or <code>null</code> if the bean is to be removed
+    * @param <T>      the type of the given bean
+    * @return the new value for the bean or <code>null</code> if the remove semantics was used
     */
    <T> T replaceInSession(String beanName, T newBean)
    {
@@ -393,7 +397,7 @@
       Map<String, Object> sessionMap = getFacesSessionMap();
 
       // if we passed null, use the remove semantics
-      if(newBean == null)
+      if (newBean == null)
       {
          sessionMap.remove(beanName);
          return null;
@@ -415,7 +419,7 @@
     * todo: JSF COMMON
     *
     * @param name name of the parameter which value we want to retrieve
-    * @return 
+    * @return
     */
    public String getFacesParam(String name)
    {
@@ -465,6 +469,9 @@
          try
          {
             selectedType.bean().delete(selectedName);
+
+            // reload data: we need to make sure we select the current page
+            pomb.selectObject(selectedObjectId);
             editCoordination();
          }
          catch (IllegalCoordinationException e)
@@ -494,6 +501,9 @@
       if (selectedType != null)
       {
          selectedType.bean().rename(selectedName, newName);
+
+         // reload data: we need to make sure we select the current page
+         pomb.selectObject(selectedObjectId);
          editCoordination();
       }
 

Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml	2008-09-02 21:27:13 UTC (rev 11789)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml	2008-09-02 21:30:19 UTC (rev 11790)
@@ -344,28 +344,6 @@
    </managed-bean>
 
    <managed-bean>
-      <managed-bean-name>coordinationManager</managed-bean-name>
-      <managed-bean-class>org.jboss.portal.core.admin.ui.coordination.CoordinationManagerBean</managed-bean-class>
-      <managed-bean-scope>session</managed-bean-scope>
-      <managed-property>
-         <property-name>pomb</property-name>
-         <value>#{portalobjectmgr}</value>
-      </managed-property>
-      <managed-property>
-         <property-name>eventManager</property-name>
-         <value>#{eventManager}</value>
-      </managed-property>
-      <managed-property>
-         <property-name>parameterManager</property-name>
-         <value>#{parameterManager}</value>
-      </managed-property>
-      <managed-property>
-         <property-name>aliasManager</property-name>
-         <value>#{aliasManager}</value>
-      </managed-property>
-   </managed-bean>
-
-   <managed-bean>
       <managed-bean-name>renameDashboardPageAction</managed-bean-name>
       <managed-bean-class>org.jboss.portal.core.admin.ui.actions.RenameAction</managed-bean-class>
       <managed-bean-scope>request</managed-bean-scope>
@@ -420,7 +398,31 @@
          <value>org.jboss.portal.core.admin.ui.ControlPropertiesBean</value>
       </managed-property>
    </managed-bean>
+
+
+   <!-- Coordination -->
    <managed-bean>
+      <managed-bean-name>coordinationManager</managed-bean-name>
+      <managed-bean-class>org.jboss.portal.core.admin.ui.coordination.CoordinationManagerBean</managed-bean-class>
+      <managed-bean-scope>session</managed-bean-scope>
+      <managed-property>
+         <property-name>pomb</property-name>
+         <value>#{portalobjectmgr}</value>
+      </managed-property>
+      <managed-property>
+         <property-name>eventManager</property-name>
+         <value>#{eventManager}</value>
+      </managed-property>
+      <managed-property>
+         <property-name>parameterManager</property-name>
+         <value>#{parameterManager}</value>
+      </managed-property>
+      <managed-property>
+         <property-name>aliasManager</property-name>
+         <value>#{aliasManager}</value>
+      </managed-property>
+   </managed-bean>
+   <managed-bean>
       <managed-bean-name>eventManager</managed-bean-name>
       <managed-bean-class>org.jboss.portal.core.admin.ui.coordination.EventWiringManagerBean</managed-bean-class>
       <managed-bean-scope>session</managed-bean-scope>




More information about the portal-commits mailing list