Author: chris.laprun(a)jboss.com
Date: 2009-07-21 17:48:49 -0400 (Tue, 21 Jul 2009)
New Revision: 13570
Modified:
branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java
Log:
- JBPORTAL-2413: Fixed issue with predefined properties. Values should also be properly
validated now.
Modified:
branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java 2009-07-21
21:44:32 UTC (rev 13569)
+++
branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java 2009-07-21
21:48:49 UTC (rev 13570)
@@ -23,6 +23,7 @@
package org.jboss.portal.core.admin.ui.actions;
+import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
import org.jboss.portal.core.impl.model.portal.PortalObjectImpl;
import org.jboss.portal.faces.gui.ManagedBean;
@@ -51,6 +52,14 @@
public PropertyAction(PortalObjectManagerBean pomgr)
{
this.pomgr = pomgr;
+ setValidator(new DefaultPropertyValidator()
+ {
+ @Override
+ public String doSimpleChecks(String name)
+ {
+ return name.indexOf('/') != -1 ? null : name;
+ }
+ });
}
public String getSelectedProperty()
@@ -85,14 +94,21 @@
public void updateProperty()
{
- String propertyName = checkNameValidity(otherPropertyName,
"common-edit-prop-form:property");
- if (propertyName != null)
+ String propertyName = null;
+ if (!ParameterValidation.isNullOrEmpty(otherPropertyName))
{
- if (propertyName.length() == 0 && selectedProperty != null)
+ propertyName = checkNameValidity(otherPropertyName,
"common-edit-prop-form:property");
+ }
+ else
+ {
+ if (selectedProperty != null)
{
propertyName = selectedProperty.trim();
}
+ }
+ if (propertyName != null)
+ {
if (propertyName.length() > 0)
{
String value = "";