Author: julien(a)jboss.com
Date: 2007-06-24 17:17:49 -0400 (Sun, 24 Jun 2007)
New Revision: 7519
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyInfo.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml
Log:
- make the PropertyAction bean lifecycle managed by the PortalObjectManager in order to
get it attached to the right POMGR and have the capability to edit dashboard properties
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-06-23
22:23:07 UTC (rev 7518)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-06-24
21:17:49 UTC (rev 7519)
@@ -39,6 +39,7 @@
import javax.faces.model.SelectItem;
import org.jboss.portal.core.admin.ui.actions.AddPageAction;
+import org.jboss.portal.core.admin.ui.actions.PropertyAction;
import org.jboss.portal.core.admin.ui.common.PageManagerBean;
import org.jboss.portal.core.admin.ui.portlet.PortletDefinitionInvoker;
import org.jboss.portal.core.impl.model.content.ContentProviderRegistryService;
@@ -139,6 +140,9 @@
private PropertiesBean selectedProperties;
/** . */
+ PropertyAction propertyAction;
+
+ /** . */
private ControlPropertiesBean controlProperties;
/** . */
@@ -182,11 +186,6 @@
return types;
}
-// public ContentEditorRegistry getContentEditors()
-// {
-// return ContentEditorRegistry.getInstance();
-// }
-
public String getSelectedContentEditorInstance()
{
if (selectedContentType != null)
@@ -481,6 +480,7 @@
public void refresh()
{
+ propertyAction = null;
instanceItems = null;
portalPageItems = null;
selectedObjectPath = null;
@@ -509,9 +509,8 @@
//
selectedProperties = new PropertiesBean(this);
-
- //
controlProperties = new ControlPropertiesBean(this);
+ propertyAction = new PropertyAction(this);
//
Collection pages = getSelectedObject().getChildren(PortalObject.PAGE_MASK);
@@ -706,5 +705,4 @@
{
return controlProperties;
}
-
}
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java 2007-06-23
22:23:07 UTC (rev 7518)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java 2007-06-24
21:17:49 UTC (rev 7519)
@@ -23,8 +23,11 @@
package org.jboss.portal.core.admin.ui;
import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.admin.ui.actions.PropertyAction;
import javax.faces.model.SelectItem;
+import javax.faces.context.FacesContext;
+import javax.faces.el.VariableResolver;
import java.util.ArrayList;
import java.util.List;
import java.util.Iterator;
@@ -44,17 +47,20 @@
private final SortedMap entryMap;
/** . */
- final PortalObjectManagerBean pomgr;
+ private final PortalObjectManagerBean pomgr;
/** . */
private final PropertiesInfo info;
/** . */
- int selectedIndex;
+ private int selectedIndex;
/** . */
private List items;
+ /** . */
+ private String propertyActionRef;
+
public PropertiesBean(PortalObjectManagerBean pomgr)
{
// Get the selected object
@@ -153,4 +159,9 @@
{
return pomgr.getSelectedObject();
}
+
+ public PropertyAction getAction()
+ {
+ return pomgr.propertyAction;
+ }
}
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyInfo.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyInfo.java 2007-06-23
22:23:07 UTC (rev 7518)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyInfo.java 2007-06-24
21:17:49 UTC (rev 7519)
@@ -47,22 +47,22 @@
public static final int READ_WRITE_ACCESS_MODE = 1;
/** . */
- private String name;
+ private final String name;
/** . */
- private int accessMode;
+ private final int accessMode;
/** . */
- private String type;
+ private final String type;
/** . */
- private LocalizedString displayName;
+ private final LocalizedString displayName;
/** . */
- private LocalizedString description;
+ private final LocalizedString description;
/** . */
- private int scope;
+ private final int scope;
public PropertyInfo(String name, LocalizedString displayName, LocalizedString
description, String type, int accessMode, int scope)
{
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java 2007-06-23
22:23:07 UTC (rev 7518)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java 2007-06-24
21:17:49 UTC (rev 7519)
@@ -56,16 +56,11 @@
/** . */
private static final String ERROR_EMPTY_NAME = "Property name cannot be
blank!";
- public PortalObjectManagerBean getPortalObjectManager()
+ public PropertyAction(PortalObjectManagerBean pomgr)
{
- return pomgr;
+ this.pomgr = pomgr;
}
- public void setPortalObjectManager(PortalObjectManagerBean portalObjectManager)
- {
- this.pomgr = portalObjectManager;
- }
-
public String getSelectedProperty()
{
return selectedProperty;
@@ -107,7 +102,7 @@
{
Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
String name = (String)pmap.get("name");
-
((PortalObjectImpl)getPortalObjectManager().getSelectedObject()).getDeclaredPropertyMap().remove(name);
+
((PortalObjectImpl)pomgr.getSelectedObject()).getDeclaredPropertyMap().remove(name);
}
public void updateProperty()
@@ -128,7 +123,7 @@
{
value = "";
}
- getPortalObjectManager().getSelectedObject().setDeclaredProperty(propertyName,
value);
+ pomgr.getSelectedObject().setDeclaredProperty(propertyName, value);
}
}
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-06-23
22:23:07 UTC (rev 7518)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-06-24
21:17:49 UTC (rev 7519)
@@ -249,16 +249,6 @@
</managed-property>
</managed-bean>
- <managed-bean>
- <managed-bean-name>propertyAction</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.PropertyAction</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- <managed-property>
- <property-name>portalObjectManager</property-name>
- <value>#{sessionScope.portalobjectmgr}</value>
- </managed-property>
- </managed-bean>
-
<!--
| Dashboard beans
-->
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml 2007-06-23
22:23:07 UTC (rev 7518)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml 2007-06-24
21:17:49 UTC (rev 7519)
@@ -39,7 +39,7 @@
</c:choose>
</td>
<td>
- <h:commandLink
action="#{propertyAction.removeProperty}"
rendered="#{!prop.inherited}">
+ <h:commandLink
action="#{properties.action.removeProperty}"
rendered="#{!prop.inherited}">
<h:outputText value="Delete"/>
<f:param name="name"
value="#{prop.name}"/>
</h:commandLink>
@@ -66,7 +66,7 @@
<h:outputLabel for="predefinedProperty"
styleClass="portlet-form-field-label">Select a predefined property:
</h:outputLabel>
</td>
<td>
- <h:selectOneMenu id="predefinedProperty"
styleClass="portlet-form-field"
value="#{propertyAction.selectedProperty}">
+ <h:selectOneMenu id="predefinedProperty"
styleClass="portlet-form-field"
value="#{properties.action.selectedProperty}">
<f:selectItems
value="#{properties.propertyItems}"/>
</h:selectOneMenu>
</td>
@@ -76,13 +76,13 @@
<h:outputLabel for="property"
styleClass="portlet-form-field-label">Or enter a property name:
</h:outputLabel>
</td>
<td>
- <h:inputText id="property"
styleClass="portlet-form-input-field"
value="#{propertyAction.otherPropertyName}" />
+ <h:inputText id="property"
styleClass="portlet-form-input-field"
value="#{properties.action.otherPropertyName}" />
</td>
</tr>
</tbody>
</table>
- <h:commandButton value="Add property"
styleClass="portlet-form-button"
action="#{propertyAction.updateProperty}"/>
+ <h:commandButton value="Add property"
styleClass="portlet-form-button"
action="#{properties.action.updateProperty}"/>
</h:form>
Show replies by date