Author: bdaw
Date: 2007-06-15 15:22:59 -0400 (Fri, 15 Jun 2007)
New Revision: 7447
Added:
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/resources/portal-admin-war/WEB-INF/jsf/common/editErrorHandling.xhtml
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/PropertiesInfo.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.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
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml
Log:
*partialy* working error handling configuration in property editor
Added:
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
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java 2007-06-15
19:22:59 UTC (rev 7447)
@@ -0,0 +1,159 @@
+/*
+* 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.control.ControlConstants;
+import org.jboss.portal.core.model.portal.PortalObject;
+
+import javax.faces.model.SelectItem;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 0.1 $
+ */
+public class ControlPropertiesBean
+{
+
+ private List portalSelectItems;
+
+ private List pageSelectItems;
+
+ /** . */
+ final PortalObjectManagerBean pomgr;
+
+ public ControlPropertiesBean(PortalObjectManagerBean pomgr)
+ {
+ this.pomgr = pomgr;
+
+ }
+
+ public List getPortalSelectItems()
+ {
+ if (portalSelectItems == null)
+ {
+ portalSelectItems = new ArrayList();
+ portalSelectItems.add(new SelectItem(ControlConstants.IGNORE_CONTROL_VALUE,
"display the default error message."));
+ portalSelectItems.add(new SelectItem(ControlConstants.HIDE_CONTROL_VALUE,
"remove the resource from page."));
+ }
+ return portalSelectItems;
+ }
+
+ public List getPageSelectItems()
+ {
+ if (pageSelectItems == null)
+ {
+ pageSelectItems = new ArrayList();
+ pageSelectItems.add(new SelectItem(ControlConstants.IGNORE_CONTROL_VALUE,
"display the default error message."));
+ pageSelectItems.add(new SelectItem(ControlConstants.HIDE_CONTROL_VALUE,
"remove the resource from page."));
+ pageSelectItems.add(new SelectItem(ControlConstants.JSP_CONTROL_VALUE,
"redirect to the specified resource"));
+ }
+ return pageSelectItems;
+ }
+
+ private ControlPropertyBean grabProperty(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("name cannot be null");
+ }
+
+ if (!PropertiesInfo.isControlProperty(name))
+ {
+ throw new IllegalStateException("trying to process non control property:
" + name );
+ }
+
+ PortalObject object = pomgr.getSelectedObject();
+
+ object = pomgr.getPortalObjectContainer().getObject(object.getId());
+
+ PropertiesInfo info = new PropertiesInfo(object);
+
+
+ boolean inherited = !object.getDeclaredProperties().containsKey(name);
+ String value = object.getProperty(name);
+ return new ControlPropertyBean(this, info.getPropertyInfo(name), inherited,
value);
+ }
+
+
+ public ControlPropertyBean getPageControlAccessDenied()
+ {
+ return grabProperty(ControlConstants.PAGE_ACCESS_DENIED_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPageControlUnavailable()
+ {
+ return grabProperty(ControlConstants.PAGE_UNAVAILABLE_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPageControlError()
+ {
+ return grabProperty(ControlConstants.PAGE_ERROR_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPageControlInternalError()
+ {
+ return grabProperty(ControlConstants.PAGE_INTERNAL_ERROR_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPageControlNotFound()
+ {
+ return grabProperty(ControlConstants.PAGE_NOT_FOUND_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPageControlResourceURI()
+ {
+ return grabProperty(ControlConstants.PAGE_RESOURCE_URI_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPortalControlAccessDenied()
+ {
+ return grabProperty(ControlConstants.PORTAL_ACCESS_DENIED_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPortalControlUnavailable()
+ {
+ return grabProperty(ControlConstants.PORTAL_UNAVAILABLE_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPortalControlError()
+ {
+ return grabProperty(ControlConstants.PORTAL_ERROR_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPortalControlInternalError()
+ {
+ return grabProperty(ControlConstants.PORTAL_INTERNAL_ERROR_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPortalControlNotFound()
+ {
+ return grabProperty(ControlConstants.PORTAL_NOT_FOUND_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPortalControlResourceURI()
+ {
+ return grabProperty(ControlConstants.PORTAL_RESOURCE_URI_CONTROL_KEY);
+ }
+}
Added: 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
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java 2007-06-15
19:22:59 UTC (rev 7447)
@@ -0,0 +1,135 @@
+/*
+* 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;
+import org.jboss.portal.core.impl.model.portal.PortalObjectImpl;
+
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+public class ControlPropertyBean implements Comparable
+{
+
+ /** . */
+ private String value;
+
+ /** . */
+ private final ControlPropertiesBean container;
+
+ /** . */
+ private final PropertyInfo info;
+
+ /** . */
+ private final boolean inherited;
+
+ public ControlPropertyBean(ControlPropertiesBean container, PropertyInfo info, boolean
inherited, String 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 inherit(ValueChangeEvent event)
+ {
+
+ PortalObject portalObject = container.pomgr.getSelectedObject();
+ if (event.getNewValue().toString().equalsIgnoreCase("true"))
+ {
+ portalObject.setDeclaredProperty(getName(), null);
+ }
+ else
+ {
+ portalObject.setDeclaredProperty(getName(), value);
+ }
+ }
+
+ public Object getValue()
+ {
+ if (info.getType().equals("java.lang.Boolean"))
+ {
+ return Boolean.valueOf(value);
+ }
+ else
+ {
+ return value;
+ }
+ }
+
+ public void setValue(Object value)
+ {
+ this.value = value.toString();
+
+ // Need to use the container as it will contain the refreshed object
+ PortalObject portalObject = container.pomgr.getSelectedObject();
+ portalObject.setDeclaredProperty(getName(), value.toString());
+
+ }
+
+ 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-15
17:38:50 UTC (rev 7446)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-06-15
19:22:59 UTC (rev 7447)
@@ -133,6 +133,9 @@
private PropertiesBean selectedProperties;
/** . */
+ private ControlPropertiesBean controlProperties;
+
+ /** . */
private PortletInvoker portletDefinitionInvoker;
/** . */
@@ -467,6 +470,7 @@
selectedObjectPath = null;
selectedObject = null;
selectedProperties = null;
+ controlProperties = null;
//
if (selectedId == null)
@@ -491,6 +495,9 @@
selectedProperties = new PropertiesBean(this);
//
+ controlProperties = new ControlPropertiesBean(this);
+
+ //
Collection pages = getSelectedObject().getChildren(PortalObject.PAGE_MASK);
ArrayList list = new ArrayList(pages.size() + 1);
for (Iterator iterator = pages.iterator(); iterator.hasNext();)
@@ -650,4 +657,38 @@
// //in case it fails let's point to some nice page ;)
return "http://www.jboss.org";
}
+
+
+ /**
+ * Helper method to recognize object type in EL easily
+ * @return
+ */
+ public String getSelectedObjectType()
+ {
+ PortalObject object = getSelectedObject();
+ if (object != null)
+ {
+ switch(object.getType())
+ {
+ case PortalObject.TYPE_CONTEXT:
+ return "context";
+ case PortalObject.TYPE_PORTAL:
+ return "portal";
+ case PortalObject.TYPE_PAGE:
+ return "page";
+ case PortalObject.TYPE_WINDOW:
+ return "window";
+ }
+ }
+
+ //to make it safe
+ return "none";
+ }
+
+
+ public ControlPropertiesBean getControlProperties()
+ {
+ 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-15
17:38:50 UTC (rev 7446)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java 2007-06-15
19:22:59 UTC (rev 7447)
@@ -34,6 +34,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
*/
public class PropertiesBean
@@ -57,6 +58,9 @@
/** . */
private List items;
+
+
+
public PropertiesBean(PortalObjectManagerBean pomgr)
{
// Get the selected object
@@ -72,7 +76,10 @@
for (Iterator i = selectedObject.getProperties().keySet().iterator();i.hasNext();)
{
+
+
String propertyName = (String)i.next();
+
String propertyValue = selectedObject.getProperty(propertyName);
//
@@ -82,11 +89,11 @@
boolean inherited =
!selectedObject.getDeclaredProperties().containsKey(propertyName);
// If null it is probably an inherited property that does not have meaning for
that particular object
- if (propertyInfo != null)
+ // Filter, keep only public properties
+ if (propertyInfo != null && propertyInfo.getScope() ==
PropertyInfo.PUBLIC_SCOPE)
{
-
- // Filter, keep only public properties
- if (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);
@@ -95,6 +102,8 @@
}
}
+ //initiate control
+
//
this.info = info;
this.pomgr = pomgr;
@@ -156,7 +165,7 @@
PropertyInfo propertyInfo = info.getPropertyInfo(propertyName);
// Add only property user can change state
- if (propertyInfo.getScope() == PropertyInfo.PUBLIC_SCOPE &&
propertyInfo.getAccessMode() == PropertyInfo.READ_WRITE_ACCESS_MODE)
+ if (propertyInfo.getScope() == PropertyInfo.PUBLIC_SCOPE &&
propertyInfo.getAccessMode() == PropertyInfo.READ_WRITE_ACCESS_MODE &&
!PropertiesInfo.isControlProperty(propertyName))
{
items.add(new SelectItem(propertyInfo.getName(),
propertyInfo.getDisplayName().getDefaultString(),
propertyInfo.getDescription().getDefaultString()));
}
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-15
17:38:50 UTC (rev 7446)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java 2007-06-15
19:22:59 UTC (rev 7447)
@@ -108,11 +108,18 @@
PORTAL_PROPERTIES.put(THEME_RENDER_SET_ID.getName(), THEME_RENDER_SET_ID);
PORTAL_PROPERTIES.put(DEFAULT_CHILD_NAME.getName(), DEFAULT_CHILD_NAME);
PORTAL_PROPERTIES.put(AJAX_PARTIAL_REFRESH.getName(), AJAX_PARTIAL_REFRESH);
+ PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_ACCESS_DENIED.getName(),
CONTROL_POLICY_PORTAL_ACCESS_DENIED);
+ PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_UNAVAILABLE.getName(),
CONTROL_POLICY_PORTAL_UNAVAILABLE);
+ PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_ERROR.getName(),
CONTROL_POLICY_PORTAL_ERROR);
+ PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_INTERNAL_ERROR.getName(),
CONTROL_POLICY_PORTAL_INTERNAL_ERROR);
+ PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_NOT_FOUND.getName(),
CONTROL_POLICY_PORTAL_NOT_FOUND);
+ PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_RESOURCE_URI.getName(),
CONTROL_POLICY_PORTAL_RESOURCE_URI);
PORTAL_PROPERTIES.put(CONTROL_POLICY_PAGE_ACCESS_DENIED.getName(),
CONTROL_POLICY_PAGE_ACCESS_DENIED);
PORTAL_PROPERTIES.put(CONTROL_POLICY_PAGE_UNAVAILABLE.getName(),
CONTROL_POLICY_PAGE_UNAVAILABLE);
PORTAL_PROPERTIES.put(CONTROL_POLICY_PAGE_ERROR.getName(),
CONTROL_POLICY_PAGE_ERROR);
PORTAL_PROPERTIES.put(CONTROL_POLICY_PAGE_INTERNAL_ERROR.getName(),
CONTROL_POLICY_PAGE_INTERNAL_ERROR);
PORTAL_PROPERTIES.put(CONTROL_POLICY_PAGE_NOT_FOUND.getName(),
CONTROL_POLICY_PAGE_NOT_FOUND);
+ PORTAL_PROPERTIES.put(CONTROL_POLICY_PAGE_RESOURCE_URI.getName(),
CONTROL_POLICY_PAGE_RESOURCE_URI);
//
PAGE_PROPERTIES.put(THEME_LAYOUT_ID.getName(), THEME_LAYOUT_ID);
@@ -126,7 +133,7 @@
PAGE_PROPERTIES.put(CONTROL_POLICY_PAGE_ERROR.getName(),
CONTROL_POLICY_PAGE_ERROR);
PAGE_PROPERTIES.put(CONTROL_POLICY_PAGE_INTERNAL_ERROR.getName(),
CONTROL_POLICY_PAGE_INTERNAL_ERROR);
PAGE_PROPERTIES.put(CONTROL_POLICY_PAGE_NOT_FOUND.getName(),
CONTROL_POLICY_PAGE_NOT_FOUND);
-
+ PAGE_PROPERTIES.put(CONTROL_POLICY_PAGE_RESOURCE_URI.getName(),
CONTROL_POLICY_PAGE_RESOURCE_URI);
//
WINDOW_PROPERTIES.put(AJAX_PARTIAL_REFRESH.getName(), AJAX_PARTIAL_REFRESH);
WINDOW_PROPERTIES.put(THEME_RENDER_REGION_ID.getName(), THEME_RENDER_REGION_ID);
@@ -139,13 +146,15 @@
CONTROL_PAGE_PROPERTIES.put(CONTROL_POLICY_PAGE_INTERNAL_ERROR.getName(),
CONTROL_POLICY_PAGE_INTERNAL_ERROR);
CONTROL_PAGE_PROPERTIES.put(CONTROL_POLICY_PAGE_NOT_FOUND.getName(),
CONTROL_POLICY_PAGE_NOT_FOUND);
CONTROL_PAGE_PROPERTIES.put(CONTROL_POLICY_PAGE_UNAVAILABLE.getName(),
CONTROL_POLICY_PAGE_UNAVAILABLE);
+ CONTROL_PAGE_PROPERTIES.put(CONTROL_POLICY_PAGE_RESOURCE_URI.getName(),
CONTROL_POLICY_PAGE_RESOURCE_URI);
//
CONTROL_PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_ACCESS_DENIED.getName(),
CONTROL_POLICY_PORTAL_ACCESS_DENIED);
CONTROL_PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_ERROR.getName(),
CONTROL_POLICY_PORTAL_ERROR);
CONTROL_PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_INTERNAL_ERROR.getName(),
CONTROL_POLICY_PORTAL_INTERNAL_ERROR);
CONTROL_PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_NOT_FOUND.getName(),
CONTROL_POLICY_PORTAL_NOT_FOUND);
- CONTROL_PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_UNAVAILABLE.getName(),
CONTROL_POLICY_PAGE_UNAVAILABLE);
+ CONTROL_PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_UNAVAILABLE.getName(),
CONTROL_POLICY_PORTAL_UNAVAILABLE);
+ CONTROL_PORTAL_PROPERTIES.put(CONTROL_POLICY_PORTAL_RESOURCE_URI.getName(),
CONTROL_POLICY_PORTAL_RESOURCE_URI);
//
CONTROL_PROPERTIES.putAll(CONTROL_PAGE_PROPERTIES);
@@ -156,6 +165,7 @@
ALL_PROPERTIES.putAll(PORTAL_PROPERTIES);
ALL_PROPERTIES.putAll(PAGE_PROPERTIES);
ALL_PROPERTIES.putAll(WINDOW_PROPERTIES);
+
}
/** . */
@@ -217,4 +227,9 @@
return CONTROL_PROPERTIES.containsKey(name);
}
+ public static PropertyInfo getControlPropertyInfo(String name)
+ {
+ return (PropertyInfo)CONTROL_PROPERTIES.get(name);
+ }
+
}
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-15
17:38:50 UTC (rev 7446)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java 2007-06-15
19:22:59 UTC (rev 7447)
@@ -28,6 +28,7 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
* @version $Revision: 1.1 $
*/
public class PropertyBean implements Comparable
@@ -121,4 +122,9 @@
{
return info.getType();
}
+
+ public boolean isControlProperty()
+ {
+ return PropertiesInfo.isControlProperty(info.getName());
+ }
}
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-15
17:38:50 UTC (rev 7446)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java 2007-06-15
19:22:59 UTC (rev 7447)
@@ -26,11 +26,13 @@
import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
import org.jboss.portal.core.impl.model.portal.PortalObjectImpl;
+import org.jboss.portal.core.model.portal.PortalObject;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.ValidatorException;
+import javax.faces.event.ValueChangeEvent;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw
Dawidowicz</a>
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-15
17:38:50 UTC (rev 7446)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-06-15
19:22:59 UTC (rev 7447)
@@ -117,6 +117,7 @@
</managed-property>
</managed-bean>
+
<!-- The instance manager managed bean -->
<managed-bean>
<managed-bean-name>instancemgr</managed-bean-name>
@@ -280,6 +281,34 @@
<value>org.jboss.portal.core.model.portal.PortalObject</value>
</managed-property>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>ControlConstants</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.faces.el.ClassConstantPublisherBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ <managed-property>
+ <property-name>className</property-name>
+
<value>org.jboss.portal.core.model.portal.control.ControlConstants</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>PropertiesInfo</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.faces.el.ClassConstantPublisherBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ <managed-property>
+ <property-name>className</property-name>
+ <value>org.jboss.portal.core.admin.ui.PropertiesInfo</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>ControlPropertiesBean</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.faces.el.ClassConstantPublisherBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ <managed-property>
+ <property-name>className</property-name>
+ <value>org.jboss.portal.core.admin.ui.ControlPropertiesBean</value>
+ </managed-property>
+ </managed-bean>
+
<navigation-rule>
<navigation-case>
Added:
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
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editErrorHandling.xhtml 2007-06-15
19:22:59 UTC (rev 7447)
@@ -0,0 +1,213 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:c="http://java.sun.com/jstl/core">
+
+
+ <f:subview id="errorHandlingView"
rendered="#{portalobjectmgr.selectedObject.type ==
PortalObject.TYPE_PORTAL}">
+ <!-- Separation -->
+ <hr/>
+
+ <h3>Edit Portal Error Handling</h3>
+
+ <p>Configure how the system handles errors on portal level.</p>
+
+ <h:form>
+ <table width="100%">
+ <thead class="portlet-section-header"
style="text-align:left;">
+ <tr>
+ <th>Case</th>
+ <th>Inheritance</th>
+ <th>Action</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr class="portlet-section-body">
+ <td>
+ <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
+ </td>
+ <td>
+ <h:selectOneMenu
value="#{properties.portalControlAccessDenied.value}"
disabled="#{properties.portalControlAccessDenied.inherited}"
onchange="submit();">
+ <f:selectItems
value="#{properties.portalSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr class="portlet-section-body">
+ <td>
+ <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
+ </td>
+ <td>
+ <h:selectOneMenu
value="#{properties.portalControlUnavailable.value}"
disabled="#{properties.portalControlUnavailable.inherited}"
onchange="submit();">
+ <f:selectItems
value="#{properties.portalSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr class="portlet-section-body">
+ <td>
+ <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
+ </td>
+ <td>
+ <h:selectOneMenu
value="#{properties.portalControlError.value}"
disabled="#{properties.portalControlError.inherited}"
onchange="submit();">
+ <f:selectItems
value="#{properties.portalSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr class="portlet-section-body">
+ <td>
+ <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
+ </td>
+ <td>
+ <h:selectOneMenu
value="#{properties.portalControlInternalError.value}"
disabled="#{properties.portalControlInternalError.inherited}"
onchange="submit();">
+ <f:selectItems
value="#{properties.portalSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr class="portlet-section-body">
+ <td>
+ <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
+ </td>
+ <td>
+ <h:selectOneMenu
value="#{properties.portalControlNotFound.value}"
disabled="#{properties.portalControlNotFound.inherited}"
onchange="submit();">
+ <f:selectItems
value="#{properties.portalSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr class="portlet-section-body">
+ <td>
+ <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
+ </td>
+ <td>
+ <h:inputText
value="#{properties.portalControlResourceURI.value}"
disabled="#{properties.portalControlResourceURI.inherited}"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <h:commandButton value="Update"
styleClass="portlet-form-button"/>
+ </h:form>
+ </f:subview>
+
+ <f:subview id="errorHandlingView"
rendered="#{!(portalobjectmgr.selectedObject.type ==
PortalObject.TYPE_WINDOW)}">
+ <!-- Separation -->
+ <hr/>
+
+ <h3>Edit Page Error Handling</h3>
+
+ <p>Configure how the system handles errors on page level.</p>
+
+ <h:form>
+ <table width="100%">
+ <thead class="portlet-section-header"
style="text-align:left;">
+ <tr>
+ <th>Case</th>
+ <th>Inheritance</th>
+ <th>Action</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr class="portlet-section-body">
+ <td>
+ <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
+ </td>
+ <td>
+ <h:selectOneMenu
value="#{properties.pageControlAccessDenied.value}"
disabled="#{properties.pageControlAccessDenied.inherited}"
onchange="submit();">
+ <f:selectItems
value="#{properties.pageSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr class="portlet-section-body">
+ <td>
+ <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
+ </td>
+ <td>
+ <h:selectOneMenu
value="#{properties.pageControlUnavailable.value}"
disabled="#{properties.pageControlUnavailable.inherited}"
onchange="submit();">
+ <f:selectItems
value="#{properties.pageSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr class="portlet-section-body">
+ <td>
+ <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
+ </td>
+ <td>
+ <h:selectOneMenu
value="#{properties.pageControlError.value}"
disabled="#{properties.pageControlError.inherited}"
onchange="submit();">
+ <f:selectItems
value="#{properties.pageSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr class="portlet-section-body">
+ <td>
+ <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
+ </td>
+ <td>
+ <h:selectOneMenu
value="#{properties.pageControlInternalError.value}"
disabled="#{properties.pageControlInternalError.inherited}"
onchange="submit();">
+ <f:selectItems
value="#{properties.pageSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr class="portlet-section-body">
+ <td>
+ <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
+ </td>
+ <td>
+ <h:selectOneMenu
value="#{properties.pageControlNotFound.value}"
disabled="#{properties.pageControlNotFound.inherited}"
onchange="submit();">
+ <f:selectItems
value="#{properties.pageSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr class="portlet-section-body">
+ <td>
+ <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
+ </td>
+ <td>
+ <h:inputText
value="#{properties.pageControlResourceURI.value}"
disabled="#{properties.pageControlResourceURI.inherited}"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <h:commandButton value="Update"
styleClass="portlet-form-button"/>
+ </h:form>
+ </f:subview>
+
+
+
+
+
+</div>
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-15
17:38:50 UTC (rev 7446)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml 2007-06-15
19:22:59 UTC (rev 7447)
@@ -5,44 +5,46 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core">
+ <h3>Edit properties</h3>
+
<h:form>
<table width="100%">
<thead class="portlet-section-header"
style="text-align:left;">
<tr>
<th>Name</th>
<th>Description</th>
- <th>Value</th>
<th>Inherited</th>
+ <th>Value</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<c:forEach items="#{properties.entries}" var="prop"
varStatus="status">
- <tr class="#{status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
- <td>
- <h:outputText title="#{prop.name}"
value="#{prop.displayName}"/>
- </td>
- <td>
- <h:outputText>#{prop.description}</h:outputText>
- </td>
- <td>#{prop.inherited ? 'Yes' : 'No'}</td>
- <td>
- <c:choose>
- <c:when
test="#{prop.type=='java.lang.Boolean'}">
- <h:selectBooleanCheckbox
styleClass="portlet-form-button" value="#{prop.value}"
readonly="#{prop.readOnly}"/>
- </c:when>
- <c:otherwise>
- <h:inputText styleClass="portlet-form-input-field"
value="#{prop.value}" readonly="#{prop.readOnly}"/>
- </c:otherwise>
- </c:choose>
- </td>
- <td>
- <h:commandLink
action="#{propertyAction.removeProperty}"
rendered="#{!prop.inherited}">
- <h:outputText value="Delete"/>
- <f:param name="name"
value="#{prop.name}"/>
- </h:commandLink>
- </td>
- </tr>
+ <tr class="#{status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
+ <td>
+ <h:outputText title="#{prop.name}"
value="#{prop.displayName}"/>
+ </td>
+ <td>
+ <h:outputText>#{prop.description}</h:outputText>
+ </td>
+ <td>#{prop.inherited ? 'Yes' :
'No'}</td>
+ <td>
+ <c:choose>
+ <c:when
test="#{prop.type=='java.lang.Boolean'}">
+ <h:selectBooleanCheckbox
styleClass="portlet-form-button" value="#{prop.value}"
readonly="#{prop.readOnly}"/>
+ </c:when>
+ <c:otherwise>
+ <h:inputText
styleClass="portlet-form-input-field" value="#{prop.value}"
readonly="#{prop.readOnly}"/>
+ </c:otherwise>
+ </c:choose>
+ </td>
+ <td>
+ <h:commandLink
action="#{propertyAction.removeProperty}"
rendered="#{!prop.inherited}">
+ <h:outputText value="Delete"/>
+ <f:param name="name"
value="#{prop.name}"/>
+ </h:commandLink>
+ </td>
+ </tr>
</c:forEach>
</tbody>
</table>
@@ -83,11 +85,5 @@
<h:commandButton value="Add property"
styleClass="portlet-form-button"
action="#{propertyAction.updateProperty}"/>
</h:form>
- <!-- Separation -->
- <hr/>
- <h:form>
- <h:commandButton value="Cancel"
styleClass="portlet-form-button" action="objects"
immediate="true"/>
- </h:form>
-
</div>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml 2007-06-15
17:38:50 UTC (rev 7446)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml 2007-06-15
19:22:59 UTC (rev 7447)
@@ -12,24 +12,17 @@
<ui:param name="properties"
value="#{portalobjectmgr.selectedProperties}"/>
</ui:include>
+ <ui:include src="common/editErrorHandling.xhtml">
+ <ui:param name="properties"
value="#{portalobjectmgr.controlProperties}"/>
+ </ui:include>
+
+ <!-- Separation -->
<hr/>
- <h3>Configure error handling at portal level</h3>
- <ul>
- <li>Access denied:</li>
- <li>Error:</li>
- <li>Internal error:</li>
- <li>Not found:</li>
- <li>Unavailable:</li>
- </ul>
- <hr/>
- <h3>Configure error handling at window level</h3>
- <ul>
- <li>Access denied:</li>
- <li>Error:</li>
- <li>Internal error:</li>
- <li>Not found:</li>
- <li>Unavailable:</li>
- </ul>
+
+ <h:form>
+ <h:commandButton value="Cancel"
styleClass="portlet-form-button" action="objects"
immediate="true"/>
+ </h:form>
+
</ui:define>
</ui:composition>