Author: julien(a)jboss.com
Date: 2007-06-21 09:15:18 -0400 (Thu, 21 Jun 2007)
New Revision: 7503
Added:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java
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/PropertiesInfo.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.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/editErrorHandling.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
Log:
- improved implementation of control properties by leveraging OO inheritence to avoid
duplicate code
- allow to edit properties of root context since it owns now state
- added inheritable state on PropertyBean to describe if a property can inherit or not the
value based on the presence or not of a parent which allow to set the inheritable boolean
checkbox to unchecked+disabled
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-06-21
11:58:51 UTC (rev 7502)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-06-21
13:15:18 UTC (rev 7503)
@@ -63,6 +63,7 @@
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.Collections;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -221,7 +222,17 @@
public Object getValue(Object bean)
{
PortalObject object = (PortalObject)bean;
- return getChildren(object, PortalObject.PORTAL_MASK);
+ PortalObjectId id = object.getId();
+
+ // We don't want to iterate the potentially large collection of
dashboard portals
+ if ("dashboard".equals(id.getNamespace()))
+ {
+ return Collections.EMPTY_LIST;
+ }
+ else
+ {
+ return getChildren(object, PortalObject.PORTAL_MASK);
+ }
}
});
setProperty("pages", new
AbstractPropertyDecorator(PortalObject.class)
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java 2007-06-21
11:58:51 UTC (rev 7502)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java 2007-06-21
13:15:18 UTC (rev 7503)
@@ -33,11 +33,13 @@
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
* @version $Revision: 0.1 $
*/
-public class ControlPropertiesBean
+public class ControlPropertiesBean extends PropertyBeanContainer
{
+ /** . */
private List portalSelectItems;
+ /** . */
private List pageSelectItems;
/** . */
@@ -91,12 +93,12 @@
PropertiesInfo info = new PropertiesInfo(object);
+ boolean inheritable = object.getType() != PortalObject.TYPE_CONTEXT;
boolean inherited = !object.getDeclaredProperties().containsKey(name);
String value = object.getProperty(name);
- return new ControlPropertyBean(this, info.getPropertyInfo(name), inherited,
value);
+ return new ControlPropertyBean(this, info.getPropertyInfo(name), inherited,
inheritable, value);
}
-
public ControlPropertyBean getPageControlAccessDenied()
{
return grabProperty(ControlConstants.PAGE_ACCESS_DENIED_CONTROL_KEY);
@@ -156,4 +158,9 @@
{
return grabProperty(ControlConstants.PORTAL_RESOURCE_URI_CONTROL_KEY);
}
+
+ protected PortalObject getRelatedObject()
+ {
+ return pomgr.getSelectedObject();
+ }
}
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java 2007-06-21
11:58:51 UTC (rev 7502)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java 2007-06-21
13:15:18 UTC (rev 7503)
@@ -23,7 +23,6 @@
package org.jboss.portal.core.admin.ui;
import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.impl.model.portal.PortalObjectImpl;
import javax.faces.event.ValueChangeEvent;
@@ -33,54 +32,19 @@
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
*/
-public class ControlPropertyBean implements Comparable
+public class ControlPropertyBean extends PropertyBean
{
/** . */
- private String value;
-
- /** . */
private final ControlPropertiesBean container;
- /** . */
- private final PropertyInfo info;
-
- /** . */
- private boolean inherited;
-
- public ControlPropertyBean(ControlPropertiesBean container, PropertyInfo info, boolean
inherited, String value)
+ public ControlPropertyBean(ControlPropertiesBean container, PropertyInfo info, boolean
inherited, boolean inheritable, String value)
{
+ super(container, info, inherited, inheritable, value);
+ //
this.container = container;
- this.info = info;
- this.inherited = inherited;
- this.value = value;
}
- public String getName()
- {
- return info.getName();
- }
-
- public boolean isReadOnly()
- {
- return info.getAccessMode() == PropertyInfo.READ_ONLY_ACCESS_MODE;
- }
-
- public String getDescription()
- {
- return info.getDescription().getDefaultString();
- }
-
- public String getDisplayName()
- {
- return info.getDisplayName().getDefaultString();
- }
-
- public boolean isInherited()
- {
- return inherited;
- }
-
public void setInherited(boolean inherited)
{
this.inherited = inherited;
@@ -88,8 +52,12 @@
public void inherit(ValueChangeEvent event)
{
+ PortalObject portalObject = container.getRelatedObject();
- PortalObject portalObject = container.pomgr.getSelectedObject();
+ //
+
+
+ //
if (event.getNewValue().toString().equalsIgnoreCase("true"))
{
portalObject.setDeclaredProperty(getName(), null);
@@ -100,18 +68,6 @@
}
}
- public Object getValue()
- {
- if (info.getType().equals("java.lang.Boolean"))
- {
- return Boolean.valueOf(value);
- }
- else
- {
- return value;
- }
- }
-
public void setValue(Object value)
{
if (!inherited)
@@ -125,17 +81,6 @@
}
- public int compareTo(Object o)
- {
- ControlPropertyBean that = (ControlPropertyBean)o;
- return info.getName().compareTo(that.getName());
- }
-
- public String getType()
- {
- return info.getType();
- }
-
public boolean isControlProperty()
{
return PropertiesInfo.isControlProperty(info.getName());
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-21
11:58:51 UTC (rev 7502)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-06-21
13:15:18 UTC (rev 7503)
@@ -70,8 +70,14 @@
/** The serialVersionUID */
private static final long serialVersionUID = -8923517554726982622L;
+ /** . */
private static final String CONTENT_URI = "content.uri";
+ // Configuration
+
+ /** . */
+ private String namespace;
+
// Wired services
/** . */
@@ -143,6 +149,16 @@
// Wired services
+ public String getNamespace()
+ {
+ return namespace;
+ }
+
+ public void setNamespace(String namespace)
+ {
+ this.namespace = namespace;
+ }
+
public List getAvailableContentTypes()
{
LinkedList types = new LinkedList();
@@ -422,7 +438,7 @@
public void selectRootObject(ActionEvent ae)
{
- PortalObject root = portalObjectContainer.getContext();
+ PortalObject root = portalObjectContainer.getContext(namespace);
selectObject(root);
}
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-21
11:58:51 UTC (rev 7502)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java 2007-06-21
13:15:18 UTC (rev 7503)
@@ -37,7 +37,7 @@
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
*/
-public class PropertiesBean
+public class PropertiesBean extends PropertyBeanContainer
{
/** . */
@@ -58,9 +58,6 @@
/** . */
private List items;
-
-
-
public PropertiesBean(PortalObjectManagerBean pomgr)
{
// Get the selected object
@@ -73,32 +70,24 @@
List entryList = new ArrayList(info.getNames().size());
Map entryMap = new HashMap(info.getNames().size());
+ //
+ boolean inheritable = selectedObject.getType() != PortalObject.TYPE_CONTEXT;
+ //
for (Iterator i = selectedObject.getProperties().keySet().iterator();i.hasNext();)
{
-
-
String propertyName = (String)i.next();
-
String propertyValue = selectedObject.getProperty(propertyName);
-
- //
PropertyInfo propertyInfo = info.getPropertyInfo(propertyName);
-
- //
boolean inherited =
!selectedObject.getDeclaredProperties().containsKey(propertyName);
// If null it is probably an inherited property that does not have meaning for
that particular object
// Filter, keep only public properties
if (propertyInfo != null && propertyInfo.getScope() ==
PropertyInfo.PUBLIC_SCOPE)
{
- //don't add control properties - managed in separate view
- if (!PropertiesInfo.isControlProperty(propertyName))
- {
- PropertyBean propertyBean = new PropertyBean(this, propertyInfo,
inherited, propertyValue);
- entryList.add(propertyBean);
- entryMap.put(propertyName, propertyBean);
- }
+ PropertyBean propertyBean = new PropertyBean(this, propertyInfo, inherited,
inheritable, propertyValue);
+ entryList.add(propertyBean);
+ entryMap.put(propertyName, propertyBean);
}
}
@@ -176,4 +165,9 @@
//
return (SelectItem[])items.toArray(new SelectItem[items.size()]);
}
+
+ protected PortalObject getRelatedObject()
+ {
+ return pomgr.getSelectedObject();
+ }
}
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java 2007-06-21
11:58:51 UTC (rev 7502)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java 2007-06-21
13:15:18 UTC (rev 7503)
@@ -62,21 +62,23 @@
//
- public static final PropertyInfo CONTROL_POLICY_PAGE_ACCESS_DENIED = new
PropertyInfo(ControlConstants.PAGE_ACCESS_DENIED_CONTROL_KEY, new
LocalizedString("When access to the window is denied"), new
LocalizedString("When access to the window is denied"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PAGE_UNAVAILABLE = new
PropertyInfo(ControlConstants.PAGE_UNAVAILABLE_CONTROL_KEY, new LocalizedString("When
the window is unavailable"), new LocalizedString("When the window is
unavailable"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PAGE_ERROR = new
PropertyInfo(ControlConstants.PAGE_ERROR_CONTROL_KEY, new LocalizedString("When there
is an error on the window"), new LocalizedString("When there is an error on the
window"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PAGE_INTERNAL_ERROR = new
PropertyInfo(ControlConstants.PAGE_INTERNAL_ERROR_CONTROL_KEY, new
LocalizedString("When there is an error within the window"), new
LocalizedString("When there is an error within the window"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PAGE_NOT_FOUND = new
PropertyInfo(ControlConstants.PAGE_NOT_FOUND_CONTROL_KEY, new LocalizedString("When
the window is not found"), new LocalizedString("When the window is not
found"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PAGE_RESOURCE_URI = new
PropertyInfo(ControlConstants.PAGE_RESOURCE_URI_CONTROL_KEY, new LocalizedString("On
error redirect to this resource"), new LocalizedString("On error redirect to
this resource"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_ACCESS_DENIED = new
PropertyInfo(ControlConstants.PAGE_ACCESS_DENIED_CONTROL_KEY, new
LocalizedString("When access to the window is denied"), new
LocalizedString("When access to the window is denied"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_UNAVAILABLE = new
PropertyInfo(ControlConstants.PAGE_UNAVAILABLE_CONTROL_KEY, new LocalizedString("When
the window is unavailable"), new LocalizedString("When the window is
unavailable"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_ERROR = new
PropertyInfo(ControlConstants.PAGE_ERROR_CONTROL_KEY, new LocalizedString("When there
is an error on the window"), new LocalizedString("When there is an error on the
window"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_INTERNAL_ERROR = new
PropertyInfo(ControlConstants.PAGE_INTERNAL_ERROR_CONTROL_KEY, new
LocalizedString("When there is an error within the window"), new
LocalizedString("When there is an error within the window"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_NOT_FOUND = new
PropertyInfo(ControlConstants.PAGE_NOT_FOUND_CONTROL_KEY, new LocalizedString("When
the window is not found"), new LocalizedString("When the window is not
found"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_RESOURCE_URI = new
PropertyInfo(ControlConstants.PAGE_RESOURCE_URI_CONTROL_KEY, new LocalizedString("On
error redirect to this resource"), new LocalizedString("On error redirect to
this resource"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PORTAL_ACCESS_DENIED = new
PropertyInfo(ControlConstants.PORTAL_ACCESS_DENIED_CONTROL_KEY, new
LocalizedString("When access to the page is denied"), new
LocalizedString("When access to the page is denied"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PORTAL_UNAVAILABLE = new
PropertyInfo(ControlConstants.PORTAL_UNAVAILABLE_CONTROL_KEY, new
LocalizedString("When the page is unavailable"), new LocalizedString("When
the page is unavailable"), "java.lang.String",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PORTAL_ERROR = new
PropertyInfo(ControlConstants.PORTAL_ERROR_CONTROL_KEY, new LocalizedString("When
there is an error on the page"), new LocalizedString("When there is an error on
the page"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PORTAL_INTERNAL_ERROR = new
PropertyInfo(ControlConstants.PORTAL_INTERNAL_ERROR_CONTROL_KEY, new
LocalizedString("When there is an error within the page"), new
LocalizedString("When there is an error within the page"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PORTAL_NOT_FOUND = new
PropertyInfo(ControlConstants.PORTAL_NOT_FOUND_CONTROL_KEY, new LocalizedString("When
the page is not found"), new LocalizedString("When the page is not found"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo CONTROL_POLICY_PORTAL_RESOURCE_URI = new
PropertyInfo(ControlConstants.PORTAL_RESOURCE_URI_CONTROL_KEY, new
LocalizedString("On error redirect to this resource"), new
LocalizedString("On error redirect to this resource"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
+ //
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_ACCESS_DENIED = new
PropertyInfo(ControlConstants.PORTAL_ACCESS_DENIED_CONTROL_KEY, new
LocalizedString("When access to the page is denied"), new
LocalizedString("When access to the page is denied"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_UNAVAILABLE = new
PropertyInfo(ControlConstants.PORTAL_UNAVAILABLE_CONTROL_KEY, new
LocalizedString("When the page is unavailable"), new LocalizedString("When
the page is unavailable"), "java.lang.String",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_ERROR = new
PropertyInfo(ControlConstants.PORTAL_ERROR_CONTROL_KEY, new LocalizedString("When
there is an error on the page"), new LocalizedString("When there is an error on
the page"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_INTERNAL_ERROR = new
PropertyInfo(ControlConstants.PORTAL_INTERNAL_ERROR_CONTROL_KEY, new
LocalizedString("When there is an error within the page"), new
LocalizedString("When there is an error within the page"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_NOT_FOUND = new
PropertyInfo(ControlConstants.PORTAL_NOT_FOUND_CONTROL_KEY, new LocalizedString("When
the page is not found"), new LocalizedString("When the page is not found"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_RESOURCE_URI = new
PropertyInfo(ControlConstants.PORTAL_RESOURCE_URI_CONTROL_KEY, new
LocalizedString("On error redirect to this resource"), new
LocalizedString("On error redirect to this resource"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+
/** . */
private static final Map CONTEXT_PROPERTIES = new HashMap();
@@ -103,6 +105,20 @@
static
{
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PORTAL_ACCESS_DENIED.getName(),
CONTROL_POLICY_PORTAL_ACCESS_DENIED);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PORTAL_UNAVAILABLE.getName(),
CONTROL_POLICY_PORTAL_UNAVAILABLE);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PORTAL_ERROR.getName(),
CONTROL_POLICY_PORTAL_ERROR);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PORTAL_INTERNAL_ERROR.getName(),
CONTROL_POLICY_PORTAL_INTERNAL_ERROR);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PORTAL_NOT_FOUND.getName(),
CONTROL_POLICY_PORTAL_NOT_FOUND);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PORTAL_RESOURCE_URI.getName(),
CONTROL_POLICY_PORTAL_RESOURCE_URI);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PAGE_ACCESS_DENIED.getName(),
CONTROL_POLICY_PAGE_ACCESS_DENIED);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PAGE_UNAVAILABLE.getName(),
CONTROL_POLICY_PAGE_UNAVAILABLE);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PAGE_ERROR.getName(),
CONTROL_POLICY_PAGE_ERROR);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PAGE_INTERNAL_ERROR.getName(),
CONTROL_POLICY_PAGE_INTERNAL_ERROR);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PAGE_NOT_FOUND.getName(),
CONTROL_POLICY_PAGE_NOT_FOUND);
+ CONTEXT_PROPERTIES.put(CONTROL_POLICY_PAGE_RESOURCE_URI.getName(),
CONTROL_POLICY_PAGE_RESOURCE_URI);
+
+ //
PORTAL_PROPERTIES.put(THEME_LAYOUT_ID.getName(), THEME_LAYOUT_ID);
PORTAL_PROPERTIES.put(THEME_THEME_ID.getName(), THEME_THEME_ID);
PORTAL_PROPERTIES.put(THEME_RENDER_SET_ID.getName(), THEME_RENDER_SET_ID);
@@ -157,8 +173,8 @@
CONTROL_PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_RESOURCE_URI.getName(),
CONTROL_POLICY_PORTAL_RESOURCE_URI);
//
+ CONTROL_PROPERTIES.putAll(CONTROL_PORTAL_PROPERTIES);
CONTROL_PROPERTIES.putAll(CONTROL_PAGE_PROPERTIES);
- CONTROL_PROPERTIES.putAll(CONTROL_PORTAL_PROPERTIES);
//
ALL_PROPERTIES.putAll(CONTEXT_PROPERTIES);
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java 2007-06-21
11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java 2007-06-21
13:15:18 UTC (rev 7503)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.core.admin.ui;
-import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.core.model.portal.PortalObject;
/**
@@ -35,25 +34,34 @@
{
/** . */
- private String value;
+ protected String value;
/** . */
- private final PropertiesBean container;
+ private final PropertyBeanContainer container;
/** . */
- private final PropertyInfo info;
+ protected final PropertyInfo info;
/** . */
- private final boolean inherited;
-
- public PropertyBean(PropertiesBean container, PropertyInfo info, boolean inherited,
String value)
+ protected boolean inherited;
+
+ /** . */
+ protected boolean inheritable;
+
+ public PropertyBean(PropertyBeanContainer container, PropertyInfo info, boolean
inherited, boolean inheritable, String value)
{
this.container = container;
this.info = info;
this.inherited = inherited;
+ this.inheritable = inheritable;
this.value = value;
}
-
+
+ public boolean isInheritable()
+ {
+ return inheritable;
+ }
+
public String getName()
{
return info.getName();
@@ -96,7 +104,7 @@
this.value = value.toString();
// Need to use the container as it will contain the refreshed object
- PortalObject portalObject = container.pomgr.getSelectedObject();
+ PortalObject portalObject = container.getRelatedObject();
//if value is inherited check if updated value is the same - if yes, don't
update to keep inheritance
if (isInherited())
Added:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java 2007-06-21
13:15:18 UTC (rev 7503)
@@ -0,0 +1,36 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.admin.ui;
+
+import org.jboss.portal.core.model.portal.PortalObject;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class PropertyBeanContainer
+{
+
+ protected abstract PortalObject getRelatedObject();
+
+}
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-21
11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-06-21
13:15:18 UTC (rev 7503)
@@ -48,6 +48,10 @@
<managed-bean-class>org.jboss.portal.core.admin.ui.PortalObjectManagerBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
+ <property-name>namespace</property-name>
+ <value></value>
+ </managed-property>
+ <managed-property>
<property-name>roleModule</property-name>
<value>#{applicationScope.RoleModule}</value>
</managed-property>
@@ -117,7 +121,6 @@
</managed-property>
</managed-bean>
-
<!-- The instance manager managed bean -->
<managed-bean>
<managed-bean-name>instancemgr</managed-bean-name>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editErrorHandling.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editErrorHandling.xhtml 2007-06-21
11:58:51 UTC (rev 7502)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editErrorHandling.xhtml 2007-06-21
13:15:18 UTC (rev 7503)
@@ -6,7 +6,7 @@
xmlns:c="http://java.sun.com/jstl/core">
- <f:subview id="errorHandlingView"
rendered="#{portalobjectmgr.selectedObject.type ==
PortalObject.TYPE_PORTAL}">
+ <f:subview id="errorHandlingView"
rendered="#{portalobjectmgr.selectedObject.type == PortalObject.TYPE_CONTEXT or
portalobjectmgr.selectedObject.type == PortalObject.TYPE_PORTAL}">
<!-- Separation -->
<hr/>
@@ -29,7 +29,7 @@
<h:outputText
value="#{properties.portalControlAccessDenied.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button"
onchange="submit();"
valueChangeListener="#{properties.portalControlAccessDenied.inherit}"
value="#{properties.portalControlAccessDenied.inherited}"/>inherit action
from parent
+ <h:selectBooleanCheckbox
disabled="#{!properties.portalControlAccessDenied.inheritable}"
styleClass="portlet-form-button" onchange="submit();"
valueChangeListener="#{properties.portalControlAccessDenied.inherit}"
value="#{properties.portalControlAccessDenied.inherited}"/>inherit action
from parent
</td>
<td>
<h:selectOneMenu
value="#{properties.portalControlAccessDenied.value}"
disabled="#{properties.portalControlAccessDenied.inherited}"
onchange="submit();">
@@ -42,7 +42,7 @@
<h:outputText
value="#{properties.portalControlUnavailable.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button"
onchange="submit();"
valueChangeListener="#{properties.portalControlUnavailable.inherit}"
value="#{properties.portalControlUnavailable.inherited}"/>inherit action from
parent
+ <h:selectBooleanCheckbox
disabled="#{!properties.portalControlUnavailable.inheritable}"
styleClass="portlet-form-button" onchange="submit();"
valueChangeListener="#{properties.portalControlUnavailable.inherit}"
value="#{properties.portalControlUnavailable.inherited}"/>inherit action from
parent
</td>
<td>
<h:selectOneMenu
value="#{properties.portalControlUnavailable.value}"
disabled="#{properties.portalControlUnavailable.inherited}"
onchange="submit();">
@@ -55,7 +55,7 @@
<h:outputText
value="#{properties.portalControlError.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button"
onchange="submit();"
valueChangeListener="#{properties.portalControlError.inherit}"
value="#{properties.portalControlError.inherited}"/>inherit action from
parent
+ <h:selectBooleanCheckbox
disabled="#{!properties.portalControlError.inheritable}"
styleClass="portlet-form-button" onchange="submit();"
valueChangeListener="#{properties.portalControlError.inherit}"
value="#{properties.portalControlError.inherited}"/>inherit action from
parent
</td>
<td>
<h:selectOneMenu
value="#{properties.portalControlError.value}"
disabled="#{properties.portalControlError.inherited}"
onchange="submit();">
@@ -68,7 +68,7 @@
<h:outputText
value="#{properties.portalControlInternalError.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button"
onchange="submit();"
valueChangeListener="#{properties.portalControlInternalError.inherit}"
value="#{properties.portalControlInternalError.inherited}"/>inherit action
from parent
+ <h:selectBooleanCheckbox
disabled="#{!properties.portalControlInternalError.inheritable}"
styleClass="portlet-form-button" onchange="submit();"
valueChangeListener="#{properties.portalControlInternalError.inherit}"
value="#{properties.portalControlInternalError.inherited}"/>inherit action
from parent
</td>
<td>
<h:selectOneMenu
value="#{properties.portalControlInternalError.value}"
disabled="#{properties.portalControlInternalError.inherited}"
onchange="submit();">
@@ -81,7 +81,7 @@
<h:outputText
value="#{properties.portalControlNotFound.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button"
onchange="submit();"
valueChangeListener="#{properties.portalControlNotFound.inherit}"
value="#{properties.portalControlNotFound.inherited}"/>inherit action from
parent
+ <h:selectBooleanCheckbox
disabled="#{!properties.portalControlNotFound.inheritable}"
styleClass="portlet-form-button" onchange="submit();"
valueChangeListener="#{properties.portalControlNotFound.inherit}"
value="#{properties.portalControlNotFound.inherited}"/>inherit action from
parent
</td>
<td>
<h:selectOneMenu
value="#{properties.portalControlNotFound.value}"
disabled="#{properties.portalControlNotFound.inherited}"
onchange="submit();">
@@ -94,7 +94,7 @@
<h:outputText
value="#{properties.portalControlResourceURI.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button"
onchange="submit();"
valueChangeListener="#{properties.portalControlResourceURI.inherit}"
value="#{properties.portalControlResourceURI.inherited}"/>inherit action from
parent
+ <h:selectBooleanCheckbox
disabled="#{!properties.portalControlResourceURI.inheritable}"
styleClass="portlet-form-button" onchange="submit();"
valueChangeListener="#{properties.portalControlResourceURI.inherit}"
value="#{properties.portalControlResourceURI.inherited}"/>inherit action from
parent
</td>
<td>
<h:inputText
value="#{properties.portalControlResourceURI.value}"
disabled="#{properties.portalControlResourceURI.inherited}"/>
@@ -129,7 +129,7 @@
<h:outputText
value="#{properties.pageControlAccessDenied.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button"
onchange="submit();"
valueChangeListener="#{properties.pageControlAccessDenied.inherit}"
value="#{properties.pageControlAccessDenied.inherited}"/>inherit action from
parent
+ <h:selectBooleanCheckbox
disabled="#{!properties.pageControlAccessDenied.inheritable}"
styleClass="portlet-form-button" onchange="submit();"
valueChangeListener="#{properties.pageControlAccessDenied.inherit}"
value="#{properties.pageControlAccessDenied.inherited}"/>inherit action from
parent
</td>
<td>
<h:selectOneMenu
value="#{properties.pageControlAccessDenied.value}"
disabled="#{properties.pageControlAccessDenied.inherited}"
onchange="submit();">
@@ -142,7 +142,7 @@
<h:outputText
value="#{properties.pageControlUnavailable.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button"
onchange="submit();"
valueChangeListener="#{properties.pageControlUnavailable.inherit}"
value="#{properties.pageControlUnavailable.inherited}"/>inherit action from
parent
+ <h:selectBooleanCheckbox
disabled="#{!properties.pageControlUnavailable.inheritable}"
styleClass="portlet-form-button" onchange="submit();"
valueChangeListener="#{properties.pageControlUnavailable.inherit}"
value="#{properties.pageControlUnavailable.inherited}"/>inherit action from
parent
</td>
<td>
<h:selectOneMenu
value="#{properties.pageControlUnavailable.value}"
disabled="#{properties.pageControlUnavailable.inherited}"
onchange="submit();">
@@ -155,7 +155,7 @@
<h:outputText
value="#{properties.pageControlError.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button"
onchange="submit();"
valueChangeListener="#{properties.pageControlError.inherit}"
value="#{properties.pageControlError.inherited}"/>inherit action from parent
+ <h:selectBooleanCheckbox
disabled="#{!properties.pageControlError.inheritable}"
styleClass="portlet-form-button" onchange="submit();"
valueChangeListener="#{properties.pageControlError.inherit}"
value="#{properties.pageControlError.inherited}"/>inherit action from parent
</td>
<td>
<h:selectOneMenu
value="#{properties.pageControlError.value}"
disabled="#{properties.pageControlError.inherited}"
onchange="submit();">
@@ -168,7 +168,7 @@
<h:outputText
value="#{properties.pageControlInternalError.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button"
onchange="submit();"
valueChangeListener="#{properties.pageControlInternalError.inherit}"
value="#{properties.pageControlInternalError.inherited}"/>inherit action from
parent
+ <h:selectBooleanCheckbox
disabled="#{!properties.pageControlInternalError.inheritable}"
styleClass="portlet-form-button" onchange="submit();"
valueChangeListener="#{properties.pageControlInternalError.inherit}"
value="#{properties.pageControlInternalError.inherited}"/>inherit action from
parent
</td>
<td>
<h:selectOneMenu
value="#{properties.pageControlInternalError.value}"
disabled="#{properties.pageControlInternalError.inherited}"
onchange="submit();">
@@ -181,7 +181,7 @@
<h:outputText
value="#{properties.pageControlNotFound.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button"
onchange="submit();"
valueChangeListener="#{properties.pageControlNotFound.inherit}"
value="#{properties.pageControlNotFound.inherited}"/>inherit action from
parent
+ <h:selectBooleanCheckbox
disabled="#{!properties.pageControlNotFound.inheritable}"
styleClass="portlet-form-button" onchange="submit();"
valueChangeListener="#{properties.pageControlNotFound.inherit}"
value="#{properties.pageControlNotFound.inherited}"/>inherit action from
parent
</td>
<td>
<h:selectOneMenu
value="#{properties.pageControlNotFound.value}"
disabled="#{properties.pageControlNotFound.inherited}"
onchange="submit();">
@@ -194,7 +194,7 @@
<h:outputText
value="#{properties.pageControlResourceURI.displayName}"/>
</td>
<td>
- <h:selectBooleanCheckbox styleClass="portlet-form-button"
onchange="submit();"
valueChangeListener="#{properties.pageControlResourceURI.inherit}"
value="#{properties.pageControlResourceURI.inherited}"/>inherit action from
parent
+ <h:selectBooleanCheckbox
disabled="#{!properties.pageControlResourceURI.inheritable}"
styleClass="portlet-form-button" onchange="submit();"
valueChangeListener="#{properties.pageControlResourceURI.inherit}"
value="#{properties.pageControlResourceURI.inherited}"/>inherit action from
parent
</td>
<td>
<h:inputText
value="#{properties.pageControlResourceURI.value}"
disabled="#{properties.pageControlResourceURI.inherited}"/>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml 2007-06-21
11:58:51 UTC (rev 7502)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml 2007-06-21
13:15:18 UTC (rev 7503)
@@ -1,5 +1,6 @@
<div
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
@@ -7,6 +8,13 @@
<ui:define name="content">
+ <h:form>
+ <h:commandLink action="editProperties"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id"
value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandLink>
+ </h:form>
+
<!-- Sub page addition -->
<div style="padding:1em 0 0 0">
<h:form id="portal_form">
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-06-21
11:58:51 UTC (rev 7502)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-06-21
13:15:18 UTC (rev 7503)
@@ -30,8 +30,6 @@
</h:commandLink>
</h:form>
-
-
<!-- Sub page addition -->
<div style="padding:1em 0 0 0">
<table>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml 2007-06-21
11:58:51 UTC (rev 7502)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml 2007-06-21
13:15:18 UTC (rev 7503)
@@ -16,6 +16,9 @@
<li>
<h:commandLink value="Portlet Definitions"
action="portlets"/>
</li>
+ <li>
+ <h:commandLink value="Dashboard"
action="dashboard"/>
+ </li>
</ul>
</h:form>