Author: julien(a)jboss.com
Date: 2007-04-27 09:24:32 -0400 (Fri, 27 Apr 2007)
New Revision: 7104
Modified:
trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedString.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/PropertyInfo.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml
Log:
- extended meta model with property description to help admin understand what's going
on
Modified: trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedString.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedString.java 2007-04-27
12:54:42 UTC (rev 7103)
+++ trunk/common/src/main/org/jboss/portal/common/i18n/LocalizedString.java 2007-04-27
13:24:32 UTC (rev 7104)
@@ -23,7 +23,6 @@
package org.jboss.portal.common.i18n;
import org.apache.log4j.Logger;
-import org.jboss.portal.common.i18n.LocaleInfo;
import java.util.Collections;
import java.util.HashMap;
@@ -57,6 +56,18 @@
private String cachedToString;
/**
+ * Convenience constructor for simple localized strings with only one value using the
<code>Locale.ENGLISH</code> locale.
+ *
+ * @param defaultValue the localized value using the specified default locale
+ * @throws IllegalArgumentException if no default value or locale is provided
+ * @since 2.6
+ */
+ public LocalizedString(String defaultValue) throws IllegalArgumentException
+ {
+ this(defaultValue, Locale.ENGLISH);
+ }
+
+ /**
* Convenience constructor for simple localized strings with only one value using the
default locale.
*
* @param defaultValue the localized value using the specified default locale
@@ -352,7 +363,7 @@
{
if (cachedToString == null)
{
- cachedToString = "LocalizedString: '" +
getMostAppropriateValueFor(new String[0]) + "' default: " +
getDefaultLocale();
+ cachedToString = "LocalizedString[value='" +
getMostAppropriateValueFor(new String[0]) + "',defaultLocale=" +
getDefaultLocale() + "]";
}
return cachedToString;
}
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-04-27
12:54:42 UTC (rev 7103)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java 2007-04-27
13:24:32 UTC (rev 7104)
@@ -158,7 +158,7 @@
// Add only property user can change state
if (propertyInfo.getScope() == PropertyInfo.PUBLIC_SCOPE &&
propertyInfo.getAccessMode() == PropertyInfo.READ_WRITE_ACCESS_MODE)
{
- items.add(new SelectItem(propertyInfo.getName(),
propertyInfo.getDisplayName().getDefaultString()));
+ 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-04-27
12:54:42 UTC (rev 7103)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java 2007-04-27
13:24:32 UTC (rev 7104)
@@ -30,7 +30,6 @@
import java.util.Iterator;
import java.util.Map;
-import java.util.Locale;
import java.util.HashMap;
import java.util.Set;
@@ -43,21 +42,21 @@
//
- public static final PropertyInfo THEME_LAYOUT_ID = new
PropertyInfo(ThemeConstants.PORTAL_PROP_LAYOUT, new LocalizedString("Layout id",
Locale.ENGLISH), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
- public static final PropertyInfo THEME_THEME_ID = new
PropertyInfo(ThemeConstants.PORTAL_PROP_THEME, new LocalizedString("Theme id",
Locale.ENGLISH), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
- public static final PropertyInfo THEME_RENDER_SET_ID = new
PropertyInfo(ThemeConstants.PORTAL_PROP_RENDERSET, new LocalizedString("Renderset
id", Locale.ENGLISH), "java.lang.String",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
- public static final PropertyInfo THEME_RENDER_REGION_ID = new
PropertyInfo(ThemeConstants.PORTAL_PROP_REGION, new LocalizedString("Region id",
Locale.ENGLISH), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
- public static final PropertyInfo THEME_RENDER_REGION_ORDER = new
PropertyInfo(ThemeConstants.PORTAL_PROP_ORDER, new LocalizedString("Region
order", Locale.ENGLISH), "java.lang.String",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
+ public static final PropertyInfo THEME_LAYOUT_ID = new
PropertyInfo(ThemeConstants.PORTAL_PROP_LAYOUT, new LocalizedString("Layout
id"), new LocalizedString("The layout value formats a page"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo THEME_THEME_ID = new
PropertyInfo(ThemeConstants.PORTAL_PROP_THEME, new LocalizedString("Theme id"),
new LocalizedString("The theme value skins a page"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo THEME_RENDER_SET_ID = new
PropertyInfo(ThemeConstants.PORTAL_PROP_RENDERSET, new LocalizedString("Renderset
id"), new LocalizedString("The render set id"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo THEME_RENDER_REGION_ID = new
PropertyInfo(ThemeConstants.PORTAL_PROP_REGION, new LocalizedString("Region
id"), new LocalizedString("The region that will the window"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo THEME_RENDER_REGION_ORDER = new
PropertyInfo(ThemeConstants.PORTAL_PROP_ORDER, new LocalizedString("Region
order"), new LocalizedString("The vertical or horizontal order of the window
within a region"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
//
- public static final PropertyInfo AJAX_PARTIAL_REFRESH = new
PropertyInfo(DynaRenderOptions.PARTIAL_REFRESH_ENABLED, new LocalizedString("Partial
refresh", Locale.ENGLISH), "java.lang.Boolean",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
+ public static final PropertyInfo AJAX_PARTIAL_REFRESH = new
PropertyInfo(DynaRenderOptions.PARTIAL_REFRESH_ENABLED, new LocalizedString("Partial
refresh"), new LocalizedString("Enable partial refresh for portlets"),
"java.lang.Boolean", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
//
- public static final PropertyInfo WINDOW_CONTENT_TYPE = new
PropertyInfo(WindowImpl.PORTAL_PROP_WINDOW_CONTENT_TYPE, new LocalizedString("Content
type", Locale.ENGLISH), "java.lang.String",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
- public static final PropertyInfo DEFAULT_CHILD_NAME = new
PropertyInfo(WindowImpl.PORTAL_PROP_DEFAULT_OBJECT_NAME, new LocalizedString("Default
child name", Locale.ENGLISH), "java.lang.String",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
- public static final PropertyInfo PAGE_ORDER = new PropertyInfo("order", new
LocalizedString("Tab order", Locale.ENGLISH), "java.lang.String",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
+ public static final PropertyInfo WINDOW_CONTENT_TYPE = new
PropertyInfo(WindowImpl.PORTAL_PROP_WINDOW_CONTENT_TYPE, new LocalizedString("Content
type"), new LocalizedString("The type of content of a window"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo DEFAULT_CHILD_NAME = new
PropertyInfo(WindowImpl.PORTAL_PROP_DEFAULT_OBJECT_NAME, new LocalizedString("Default
child name"), new LocalizedString("The child name used when no specific child
name is explicited"), "java.lang.String",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
+ public static final PropertyInfo PAGE_ORDER = new PropertyInfo("order", new
LocalizedString("Tab order"), new LocalizedString("The order value to
display pages in tabs"), "java.lang.String",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
/** . */
private static final Map CONTEXT_PROPERTIES = new HashMap();
@@ -137,8 +136,8 @@
// Add additional properties
if (!ALL_PROPERTIES.containsKey(name))
{
- LocalizedString displayName = new LocalizedString(name, Locale.ENGLISH);
- PropertyInfo info = new PropertyInfo(name, displayName,
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
+ LocalizedString displayName = new LocalizedString(name);
+ PropertyInfo info = new PropertyInfo(name, displayName, new
LocalizedString("The " + name + " property"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
entries.put(name, info);
}
}
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-04-27
12:54:42 UTC (rev 7103)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java 2007-04-27
13:24:32 UTC (rev 7104)
@@ -63,11 +63,16 @@
return info.getAccessMode() == PropertyInfo.READ_ONLY_ACCESS_MODE;
}
- public LocalizedString getDisplayName()
+ public String getDescription()
{
- return info.getDisplayName();
+ return info.getDescription().getDefaultString();
}
+ public String getDisplayName()
+ {
+ return info.getDisplayName().getDefaultString();
+ }
+
public boolean isInherited()
{
return inherited;
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-04-27
12:54:42 UTC (rev 7103)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyInfo.java 2007-04-27
13:24:32 UTC (rev 7104)
@@ -56,13 +56,17 @@
private LocalizedString displayName;
/** . */
+ private LocalizedString description;
+
+ /** . */
private int scope;
- public PropertyInfo(String name, LocalizedString displayName, String type, int
accessMode, int scope)
+ public PropertyInfo(String name, LocalizedString displayName, LocalizedString
description, String type, int accessMode, int scope)
{
this.name = name;
this.accessMode = accessMode;
this.displayName = displayName;
+ this.description = description;
this.type = type;
this.scope = scope;
}
@@ -72,6 +76,11 @@
return displayName;
}
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
public String getName()
{
return name;
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-04-27
12:54:42 UTC (rev 7103)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml 2007-04-27
13:24:32 UTC (rev 7104)
@@ -10,7 +10,7 @@
<thead class="portlet-section-header"
style="text-align:left;">
<tr>
<th>Name</th>
- <th>Key</th>
+ <th>Description</th>
<th>Value</th>
<th>Inherited</th>
<th>Delete</th>
@@ -20,10 +20,10 @@
<c:forEach items="#{properties.entries}" var="prop"
varStatus="status">
<tr class="#{status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
<td>
-
<h:outputText>#{prop.displayName.defaultString}</h:outputText>
+ <h:outputText
title="#{prop.name}">#{prop.displayName}</h:outputText>
</td>
<td>
- <h:outputText>#{prop.name}</h:outputText>
+ <h:outputText>#{prop.description}</h:outputText>
</td>
<td>
<c:choose>