JBoss Portal SVN: r7106 - trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-27 09:39:35 -0400 (Fri, 27 Apr 2007)
New Revision: 7106
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml
Log:
minor
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml 2007-04-27 13:27:50 UTC (rev 7105)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml 2007-04-27 13:39:35 UTC (rev 7106)
@@ -32,14 +32,16 @@
<tr>
<td>
<div>
- <h:commandButton value="Up" id="u_#{regionName}"
- actionListener="#{pageManager.assignWindows}"
- styleClass="portlet-form-button"/>
+ <h:commandButton
+ value="Up" id="u_#{regionName}"
+ actionListener="#{pageManager.assignWindows}"
+ styleClass="portlet-form-button"/>
</div>
<div>
- <h:commandButton value="Down" id="d_#{regionName}"
- actionListener="#{pageManager.assignWindows}"
- styleClass="portlet-form-button"/>
+ <h:commandButton
+ value="Down" id="d_#{regionName}"
+ actionListener="#{pageManager.assignWindows}"
+ styleClass="portlet-form-button"/>
</div>
<div style="margin-top: 1em">
<h:commandButton
17 years
JBoss Portal SVN: r7105 - trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-27 09:27:50 -0400 (Fri, 27 Apr 2007)
New Revision: 7105
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml
Log:
make tooltip of the property name over the property display name work
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 13:24:32 UTC (rev 7104)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml 2007-04-27 13:27:50 UTC (rev 7105)
@@ -20,7 +20,7 @@
<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}">#{prop.displayName}</h:outputText>
+ <h:outputText title="#{prop.name}" value="#{prop.displayName}"/>
</td>
<td>
<h:outputText>#{prop.description}</h:outputText>
@@ -38,7 +38,7 @@
<td>#{prop.inherited ? 'Yes' : 'No'}</td>
<td>
<h:commandLink action="#{propertyAction.removeProperty}">
- <h:outputText>Delete</h:outputText>
+ <h:outputText value="Delete"/>
<f:param name="name" value="#{prop.name}"/>
</h:commandLink>
</td>
17 years
JBoss Portal SVN: r7104 - in trunk: core-admin/src/main/org/jboss/portal/core/admin/ui and 1 other directories.
by portal-commits@lists.jboss.org
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>
17 years
JBoss Portal SVN: r7103 - in trunk/core-admin/src: resources/portal-admin-war/WEB-INF/jsf/common and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-27 08:54:42 -0400 (Fri, 27 Apr 2007)
New Revision: 7103
Added:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java
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/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 portal object property metadata prototype
- extended the portal object UI property management
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-04-27 12:28:37 UTC (rev 7102)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-04-27 12:54:42 UTC (rev 7103)
@@ -485,7 +485,7 @@
}
//
- selectedProperties = new PropertiesBean(this, true);
+ selectedProperties = new PropertiesBean(this);
//
Collection pages = getSelectedObject().getChildren(PortalObject.PAGE_MASK);
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:28:37 UTC (rev 7102)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java 2007-04-27 12:54:42 UTC (rev 7103)
@@ -22,19 +22,14 @@
******************************************************************************/
package org.jboss.portal.core.admin.ui;
-import org.jboss.portal.common.i18n.LocalizedString;
-import org.jboss.portal.core.impl.model.portal.WindowImpl;
import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.theme.ThemeConstants;
-import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
import javax.faces.model.SelectItem;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
import java.util.Iterator;
import java.util.Map;
-import java.util.Locale;
+import java.util.HashMap;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -45,99 +40,69 @@
{
/** . */
- List entries;
+ List entryList;
/** . */
- int selectedIndex;
+ Map entryMap;
/** . */
- private boolean mutable;
+ int selectedIndex;
/** . */
final PortalObjectManagerBean pomgr;
- public PropertiesBean(PortalObjectManagerBean pomgr, boolean mutable)
+ /** . */
+ private final PropertiesInfo info;
+
+ /** . */
+ private List items;
+
+ public PropertiesBean(PortalObjectManagerBean pomgr)
{
// Get the selected object
PortalObject selectedObject = pomgr.getSelectedObject();
- // Look at declared properties
- List entries = new ArrayList();
- for (Iterator i = selectedObject.getDeclaredProperties().entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- String value = (String)entry.getValue();
- String name = (String)entry.getKey();
+ //
+ PropertiesInfo info = new PropertiesInfo(selectedObject);
- //
- String type = "java.lang.String";
- LocalizedString displayName = new LocalizedString(name, Locale.ENGLISH);
+ //
+ List entryList = new ArrayList(info.getNames().size());
+ Map entryMap = new HashMap(info.getNames().size());
- //
- if (name.equals(ThemeConstants.PORTAL_PROP_LAYOUT))
- {
- continue;
- }
- else if (name.equals(ThemeConstants.PORTAL_PROP_THEME))
- {
- continue;
- }
- else if (name.equals(ThemeConstants.PORTAL_PROP_RENDERSET))
- {
- continue;
- }
- else if (name.equals(ThemeConstants.PORTAL_PROP_REGION))
- {
- continue;
- }
- else if (name.equals(WindowImpl.PORTAL_PROP_WINDOW_CONTENT_TYPE))
- {
- continue;
- }
- else if (name.equals(ThemeConstants.PORTAL_PROP_ORDER))
- {
- displayName = new LocalizedString("Order", Locale.ENGLISH);
- }
- else if (name.equals(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME))
- {
- displayName = new LocalizedString("Default child name", Locale.ENGLISH);
- }
- else if (name.equals(DynaRenderOptions.PARTIAL_REFRESH_ENABLED))
- {
- displayName = new LocalizedString("Partial Refresh Enabled", Locale.ENGLISH);
- type = "java.lang.Boolean";
- }
- //
+ for (Iterator i = selectedObject.getProperties().keySet().iterator();i.hasNext();)
+ {
+ String propertyName = (String)i.next();
+ String propertyValue = selectedObject.getProperty(propertyName);
- if (!mutable)
- {
- throw new IllegalStateException("Cannot add non mutable entry to a mutable preferences bean");
- }
-
//
- PropertyInfo info = new PropertyInfo(name, displayName, type, false);
+ PropertyInfo propertyInfo = info.getPropertyInfo(propertyName);
//
- PropertyBean propertyBean = new PropertyBean(this, info, value);
+ boolean inherited = !selectedObject.getDeclaredProperties().containsKey(propertyName);
- //
- entries.add(propertyBean);
+ // 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.getScope() == PropertyInfo.PUBLIC_SCOPE)
+ {
+ PropertyBean propertyBean = new PropertyBean(this, propertyInfo, inherited, propertyValue);
+ entryList.add(propertyBean);
+ entryMap.put(propertyName, propertyBean);
+ }
+ }
}
- Collections.sort(entries);
//
+ this.info = info;
this.pomgr = pomgr;
- this.entries = entries;
+ this.entryList = entryList;
+ this.entryMap = entryMap;
this.selectedIndex = -1;
- this.mutable = mutable;
}
- public boolean isMutable()
- {
- return mutable;
- }
-
public int getSelectedIndex()
{
return selectedIndex;
@@ -145,7 +110,7 @@
public void setSelectedIndex(int selectedIndex)
{
- if (selectedIndex < 0 || selectedIndex >= entries.size())
+ if (selectedIndex < 0 || selectedIndex >= entryList.size())
{
throw new IllegalArgumentException();
}
@@ -159,31 +124,47 @@
public PreferenceBean getSelectedEntry()
{
- if (selectedIndex < 0 || selectedIndex >= entries.size())
+ if (selectedIndex < 0 || selectedIndex >= entryList.size())
{
return null;
}
- return (PreferenceBean)entries.get(selectedIndex);
+ return (PreferenceBean)entryList.get(selectedIndex);
}
public List getEntries()
{
- return entries;
+ return entryList;
}
public int getSize()
{
- return entries.size();
+ return entryList.size();
}
public SelectItem[] getPropertyItems()
{
- List items = new ArrayList();
- // items.add(new SelectItem(DynaRenderOptions.DND_ENABLED, "DnD enabled"));
- items.add(new SelectItem(DynaRenderOptions.PARTIAL_REFRESH_ENABLED, "Partial Refresh Enabled"));
- items.add(new SelectItem(ThemeConstants.PORTAL_PROP_ORDER, "Order"));
- items.add(new SelectItem(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME, "Default child name"));
+ if (items == null)
+ {
+ items = new ArrayList();
+ for (Iterator i = info.getNames().iterator();i.hasNext();)
+ {
+ String propertyName = (String)i.next();
+
+ // Add only missing property
+ if (!entryMap.containsKey(propertyName))
+ {
+ 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)
+ {
+ items.add(new SelectItem(propertyInfo.getName(), propertyInfo.getDisplayName().getDefaultString()));
+ }
+ }
+ }
+ }
+
+ //
return (SelectItem[])items.toArray(new SelectItem[items.size()]);
}
-
}
Added: 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 (rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java 2007-04-27 12:54:42 UTC (rev 7103)
@@ -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.PortalObject;
+import org.jboss.portal.core.impl.model.portal.WindowImpl;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.theme.ThemeConstants;
+import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Locale;
+import java.util.HashMap;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertiesInfo
+{
+
+ //
+
+ 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 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 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);
+
+ /** . */
+ private static final Map CONTEXT_PROPERTIES = new HashMap();
+
+ /** . */
+ private static final Map PORTAL_PROPERTIES = new HashMap();
+
+ /** . */
+ private static final Map PAGE_PROPERTIES = new HashMap();
+
+ /** . */
+ private static final Map WINDOW_PROPERTIES = new HashMap();
+
+ /** . */
+ private static final Map ALL_PROPERTIES = new HashMap();
+
+ static
+ {
+ 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);
+ PORTAL_PROPERTIES.put(DEFAULT_CHILD_NAME.getName(), DEFAULT_CHILD_NAME);
+ PORTAL_PROPERTIES.put(AJAX_PARTIAL_REFRESH.getName(), AJAX_PARTIAL_REFRESH);
+
+ //
+ PAGE_PROPERTIES.put(THEME_LAYOUT_ID.getName(), THEME_LAYOUT_ID);
+ PAGE_PROPERTIES.put(THEME_THEME_ID.getName(), THEME_THEME_ID);
+ PAGE_PROPERTIES.put(THEME_RENDER_SET_ID.getName(), THEME_RENDER_SET_ID);
+ PAGE_PROPERTIES.put(DEFAULT_CHILD_NAME.getName(), DEFAULT_CHILD_NAME);
+ PAGE_PROPERTIES.put(PAGE_ORDER.getName(), PAGE_ORDER);
+ PAGE_PROPERTIES.put(AJAX_PARTIAL_REFRESH.getName(), AJAX_PARTIAL_REFRESH);
+
+ //
+ WINDOW_PROPERTIES.put(AJAX_PARTIAL_REFRESH.getName(), AJAX_PARTIAL_REFRESH);
+ WINDOW_PROPERTIES.put(THEME_RENDER_REGION_ID.getName(), THEME_RENDER_REGION_ID);
+ WINDOW_PROPERTIES.put(THEME_RENDER_REGION_ORDER.getName(), THEME_RENDER_REGION_ORDER);
+ WINDOW_PROPERTIES.put(WINDOW_CONTENT_TYPE.getName(), WINDOW_CONTENT_TYPE);
+
+ //
+ ALL_PROPERTIES.putAll(CONTEXT_PROPERTIES);
+ ALL_PROPERTIES.putAll(PORTAL_PROPERTIES);
+ ALL_PROPERTIES.putAll(PAGE_PROPERTIES);
+ ALL_PROPERTIES.putAll(WINDOW_PROPERTIES);
+ }
+
+ /** . */
+ private Map entries;
+
+ public PropertiesInfo(PortalObject portalObject)
+ {
+ Map objectProps = null;
+ switch(portalObject.getType())
+ {
+ case PortalObject.TYPE_CONTEXT:
+ objectProps = CONTEXT_PROPERTIES;
+ break;
+ case PortalObject.TYPE_PORTAL:
+ objectProps = PORTAL_PROPERTIES;
+ break;
+ case PortalObject.TYPE_PAGE:
+ objectProps = PAGE_PROPERTIES;
+ break;
+ case PortalObject.TYPE_WINDOW:
+ objectProps = WINDOW_PROPERTIES;
+ break;
+ }
+
+ // Add predefined properties
+ Map entries = new HashMap(objectProps);
+
+ //
+ for (Iterator i = portalObject.getDeclaredProperties().entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String name = (String)entry.getKey();
+
+ // 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);
+ entries.put(name, info);
+ }
+ }
+
+ //
+ this.entries = entries;
+ }
+
+ public Set getNames()
+ {
+ return entries.keySet();
+ }
+
+ public PropertyInfo getPropertyInfo(String name)
+ {
+ return (PropertyInfo)entries.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-04-27 12:28:37 UTC (rev 7102)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java 2007-04-27 12:54:42 UTC (rev 7103)
@@ -41,11 +41,15 @@
/** . */
private final PropertyInfo info;
+
+ /** . */
+ private final boolean inherited;
- public PropertyBean(PropertiesBean container, PropertyInfo info, String value)
+ public PropertyBean(PropertiesBean container, PropertyInfo info, boolean inherited, String value)
{
this.container = container;
this.info = info;
+ this.inherited = inherited;
this.value = value;
}
@@ -56,7 +60,7 @@
public boolean isReadOnly()
{
- return info.isReadOnly();
+ return info.getAccessMode() == PropertyInfo.READ_ONLY_ACCESS_MODE;
}
public LocalizedString getDisplayName()
@@ -64,6 +68,11 @@
return info.getDisplayName();
}
+ public boolean isInherited()
+ {
+ return inherited;
+ }
+
public Object getValue()
{
if (info.getType().equals("java.lang.Boolean"))
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:28:37 UTC (rev 7102)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyInfo.java 2007-04-27 12:54:42 UTC (rev 7103)
@@ -32,10 +32,22 @@
{
/** . */
+ public static final int PUBLIC_SCOPE = 0;
+
+ /** . */
+ public static final int PRIVATE_SCOPE = 1;
+
+ /** . */
+ public static final int READ_ONLY_ACCESS_MODE = 0;
+
+ /** . */
+ public static final int READ_WRITE_ACCESS_MODE = 1;
+
+ /** . */
private String name;
/** . */
- private boolean readOnly;
+ private int accessMode;
/** . */
private String type;
@@ -43,12 +55,16 @@
/** . */
private LocalizedString displayName;
- public PropertyInfo(String name, LocalizedString displayName, String type, boolean readOnly)
+ /** . */
+ private int scope;
+
+ public PropertyInfo(String name, LocalizedString displayName, String type, int accessMode, int scope)
{
this.name = name;
- this.readOnly = readOnly;
+ this.accessMode = accessMode;
this.displayName = displayName;
this.type = type;
+ this.scope = scope;
}
public LocalizedString getDisplayName()
@@ -61,13 +77,18 @@
return name;
}
- public boolean isReadOnly()
+ public int getAccessMode()
{
- return readOnly;
+ return accessMode;
}
public String getType()
{
return type;
}
+
+ public int getScope()
+ {
+ return scope;
+ }
}
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:28:37 UTC (rev 7102)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml 2007-04-27 12:54:42 UTC (rev 7103)
@@ -12,6 +12,7 @@
<th>Name</th>
<th>Key</th>
<th>Value</th>
+ <th>Inherited</th>
<th>Delete</th>
</tr>
</thead>
@@ -27,13 +28,14 @@
<td>
<c:choose>
<c:when test="#{prop.type=='java.lang.Boolean'}">
- <h:selectBooleanCheckbox styleClass="portlet-form-button" value="#{prop.value}" />
+ <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}" />
+ <h:inputText styleClass="portlet-form-input-field" value="#{prop.value}" readonly="#{prop.readOnly}"/>
</c:otherwise>
</c:choose>
</td>
+ <td>#{prop.inherited ? 'Yes' : 'No'}</td>
<td>
<h:commandLink action="#{propertyAction.removeProperty}">
<h:outputText>Delete</h:outputText>
17 years
JBoss Portal SVN: r7102 - in trunk/core-cms/src: resources/portal-cms-war/WEB-INF/jsp/cms/editor and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-04-27 08:28:37 -0400 (Fri, 27 Apr 2007)
New Revision: 7102
Modified:
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp
Log:
Select a CMS content in 2 steps, clicking on a file displays the title and description. Clicking on the select link, adds it to the region
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java
===================================================================
--- trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java 2007-04-27 09:42:02 UTC (rev 7101)
+++ trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java 2007-04-27 12:28:37 UTC (rev 7102)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.util.List;
+import java.util.Locale;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
@@ -36,6 +37,8 @@
import org.jboss.portal.cms.CMS;
import org.jboss.portal.cms.Command;
+import org.jboss.portal.cms.model.Content;
+import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.model.Folder;
/**
@@ -60,12 +63,7 @@
{
if (req.getPortletMode().equals(EDIT_CONTENT))
{
- String uri = req.getParameter("content.uri");
String path = req.getParameter("path");
- if (uri != null)
- {
- resp.setRenderParameter("content.uri", uri);
- }
if (path != null)
{
resp.setRenderParameter("path", path);
@@ -90,6 +88,7 @@
resp.setContentType("text/html");
String sPath = req.getParameter("path");
+ String contentUri = req.getParameter("content.uri");
if (sPath == null)
{
sPath = "/";
@@ -104,8 +103,21 @@
req.setAttribute("folders", folders);
req.setAttribute("files", files);
req.setAttribute("currpath", sPath);
+ req.setAttribute("content.uri", contentUri);
-
+ if (contentUri != null)
+ {
+ Command getContentCMD = cmsService.getCommandFactory().createContentGetCommand(contentUri, null, req.getLocale());
+ Content content = (Content)cmsService.execute(getContentCMD);
+
+ if (content == null)
+ {
+ getContentCMD = cmsService.getCommandFactory().createFileGetCommand(contentUri, new Locale(cmsService.getDefaultLocale()));
+ content = (Content)cmsService.execute(getContentCMD);
+ }
+ req.setAttribute("content" , content);
+ }
+
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSEditorConstants.CMS_EDITOR_JSP_PATH + "/main.jsp");
prd.include(req, resp);
}
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp 2007-04-27 09:42:02 UTC (rev 7101)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp 2007-04-27 12:28:37 UTC (rev 7102)
@@ -1,5 +1,6 @@
<%@ page import="org.jboss.portal.cms.model.File" %>
<%@ page import="org.jboss.portal.cms.model.Folder" %>
+<%@ page import="org.jboss.portal.cms.model.Content" %>
<%@ page import="org.jboss.portal.core.cms.ui.admin.CMSAdminConstants" %>
<%@ page import="java.text.Format" %>
<%@ page import="java.text.SimpleDateFormat" %>
@@ -39,9 +40,9 @@
> <a href="<%= url %>"><%= sPathChunk %>
</a>
<%
-}
-else
-{
+ }
+ else
+ {
%>
> <%= sPathChunk %>
<%
@@ -89,10 +90,9 @@
{
File file = (File)files.get(j);
- PortletURL metaURL = renderResponse.createActionURL();
+ PortletURL metaURL = renderResponse.createRenderURL();
metaURL.setParameter("content.uri", file.getBasePath());
metaURL.setParameter("path", sCurrPath);
- metaURL.setParameter("content.action.select", "select");
if ((uri!=null) && (uri.equals(file.getBasePath())))
{
@@ -103,7 +103,6 @@
out.println("<tr onmouseover=\"this.className='portlet-section-alternate';\" onmouseout=\"this.className='portlet-section-body';\">");
}
%>
-<tr>
<td><img src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/file.gif"
alt="${n:i18n("CMS_FILE")}"
border="0"> <a href="<%= metaURL %>"><%=
@@ -117,7 +116,30 @@
%>
</table>
<%
-
- }
-
+if (uri != null)
+{
+ Content content = (Content)renderRequest.getAttribute("content");
%>
+ <p class="portlet-font">
+ Selected file: <%= uri %><br />
+<%
+ if (content.getTitle() != null)
+ {
+ out.println("File title: " + content.getTitle() + "<br />");
+ }
+ if (content.getDescription() != null)
+ {
+ out.println("File description: " + content.getDescription() + "<br />");
+ }
+%>
+ </p>
+<%
+ PortletURL submitURL = renderResponse.createActionURL();
+ submitURL.setParameter("content.uri", uri);
+ submitURL.setParameter("content.action.select", "select");
+%>
+<a href="<%= submitURL.toString() %>">Confirm</a>
+<%
+}
+}
+%>
17 years
JBoss Portal SVN: r7101 - in trunk/core/src/main/org/jboss/portal/core: model/portal/command/action and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-27 05:42:02 -0400 (Fri, 27 Apr 2007)
New Revision: 7101
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java
Log:
- fixed nav state bug
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java 2007-04-27 09:02:56 UTC (rev 7100)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java 2007-04-27 09:42:02 UTC (rev 7101)
@@ -177,18 +177,18 @@
WindowNavigationalState navigationalState = (WindowNavigationalState)nsResolver.getAttribute(nsKey);
//
- boolean update = true;
- if (navigationalState != null && navigationalState.getState() instanceof PortletParametersStateString)
- {
- PortletParametersStateString state = (PortletParametersStateString)navigationalState.getState();
- if (content.getURI().equals(state.getValue("uri")))
- {
- update = false;
- }
- }
+// boolean update = true;
+// if (navigationalState != null && navigationalState.getState() instanceof PortletParametersStateString)
+// {
+// PortletParametersStateString state = (PortletParametersStateString)navigationalState.getState();
+// if (content.getURI().equals(state.getValue("uri")))
+// {
+// update = false;
+// }
+// }
//
- if (update)
+ if (navigationalState == null)
{
PortletParametersStateString state = new PortletParametersStateString();
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java 2007-04-27 09:02:56 UTC (rev 7100)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java 2007-04-27 09:42:02 UTC (rev 7101)
@@ -92,8 +92,8 @@
//
StateString newState = oldNS != null ? oldNS.getState() : null;
- WindowState newWindowState = oldNS != null ? oldNS.getWindowState() : null;
- Mode newMode = oldNS != null ? oldNS.getMode() : null;
+ WindowState newWindowState = oldNS != null ? oldNS.getWindowState() : WindowState.NORMAL;
+ Mode newMode = oldNS != null ? oldNS.getMode() : Mode.VIEW;
//
if (navigationalState != null)
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java 2007-04-27 09:02:56 UTC (rev 7100)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java 2007-04-27 09:42:02 UTC (rev 7101)
@@ -54,6 +54,14 @@
public WindowNavigationalState(WindowState windowState, Mode mode, StateString navigationalState)
{
+ if (windowState == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (windowState == null)
+ {
+ throw new IllegalArgumentException();
+ }
this.windowState = windowState;
this.mode = mode;
this.state = navigationalState;
17 years
JBoss Portal SVN: r7100 - trunk/core/src/main/org/jboss/portal/core/model/portal/navstate.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-27 05:02:56 -0400 (Fri, 27 Apr 2007)
New Revision: 7100
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java
Log:
- fixed nav state bug
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java 2007-04-27 08:39:22 UTC (rev 7099)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java 2007-04-27 09:02:56 UTC (rev 7100)
@@ -79,23 +79,39 @@
return state;
}
- public static WindowState getWindowState(AttributeResolver context, Object id)
+ public static WindowState getWindowState(AttributeResolver resolver, Object id)
{
NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
//
- WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+ WindowNavigationalState wns = (WindowNavigationalState)resolver.getAttribute(key);
//
return wns != null ? wns.getWindowState() : null;
}
- public static void setWindowState(AttributeResolver context, Object id, WindowState windowState)
+ public static void setWindowState(AttributeResolver resolver, Object id, WindowState windowState)
{
- NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
+ setWindowState(resolver, new NavigationalStateKey(WindowNavigationalState.class, id), windowState);
+ }
+ public static void setWindowState(AttributeResolver resolver, NavigationalStateKey key, WindowState windowState)
+ {
+ if (resolver == null)
+ {
+ throw new IllegalArgumentException("No null resolver");
+ }
+ if (key == null)
+ {
+ throw new IllegalArgumentException("No null key");
+ }
+ if (windowState == null)
+ {
+ throw new IllegalArgumentException("No null window state");
+ }
+
//
- WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+ WindowNavigationalState wns = (WindowNavigationalState)resolver.getAttribute(key);
//
if (wns == null)
@@ -108,15 +124,15 @@
}
//
- context.setAttribute(key, wns);
+ resolver.setAttribute(key, wns);
}
- public static Mode getMode(AttributeResolver context, Object id)
+ public static Mode getMode(AttributeResolver resolver, Object id)
{
NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
//
- WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+ WindowNavigationalState wns = (WindowNavigationalState)resolver.getAttribute(key);
//
return wns != null ? wns.getMode() : null;
@@ -124,10 +140,26 @@
public static void setMode(AttributeResolver context, Object id, Mode mode)
{
- NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
+ setMode(context, new NavigationalStateKey(WindowNavigationalState.class, id), mode);
+ }
+ public static void setMode(AttributeResolver resolver, NavigationalStateKey key, Mode mode)
+ {
+ if (resolver == null)
+ {
+ throw new IllegalArgumentException("No null resolver");
+ }
+ if (key == null)
+ {
+ throw new IllegalArgumentException("No null key");
+ }
+ if (mode == null)
+ {
+ throw new IllegalArgumentException("No null mode");
+ }
+
//
- WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+ WindowNavigationalState wns = (WindowNavigationalState)resolver.getAttribute(key);
//
if (wns == null)
@@ -140,26 +172,42 @@
}
//
- context.setAttribute(key, wns);
+ resolver.setAttribute(key, wns);
}
- public static StateString getState(AttributeResolver context, Object id)
+ public static StateString getState(AttributeResolver resolver, Object id)
{
NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
//
- WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+ WindowNavigationalState wns = (WindowNavigationalState)resolver.getAttribute(key);
//
return wns != null ? wns.getState() : null;
}
- public static void setState(AttributeResolver context, Object id, StateString state)
+ public static void setState(AttributeResolver resolver, Object id, StateString state)
{
- NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
+ setState(resolver, new NavigationalStateKey(WindowNavigationalState.class, id), state);
+ }
+ public static void setState(AttributeResolver resolver, NavigationalStateKey key, StateString state)
+ {
+ if (resolver == null)
+ {
+ throw new IllegalArgumentException("No null resolver");
+ }
+ if (key == null)
+ {
+ throw new IllegalArgumentException("No null key");
+ }
+ if (state == null)
+ {
+ throw new IllegalArgumentException("No null state");
+ }
+
//
- WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+ WindowNavigationalState wns = (WindowNavigationalState)resolver.getAttribute(key);
//
if (wns == null)
@@ -172,6 +220,6 @@
}
//
- context.setAttribute(key, wns);
+ resolver.setAttribute(key, wns);
}
}
17 years
JBoss Portal SVN: r7099 - in trunk/core/src/main/org/jboss/portal/core: model/portal/navstate and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-27 04:39:22 -0400 (Fri, 27 Apr 2007)
New Revision: 7099
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/api/CoreNavigationalStateContext.java
trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java
Log:
- fixed window state change with NavStateContext bug
Modified: trunk/core/src/main/org/jboss/portal/core/impl/api/CoreNavigationalStateContext.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/api/CoreNavigationalStateContext.java 2007-04-27 08:29:34 UTC (rev 7098)
+++ trunk/core/src/main/org/jboss/portal/core/impl/api/CoreNavigationalStateContext.java 2007-04-27 08:39:22 UTC (rev 7099)
@@ -90,8 +90,7 @@
//
CorePortalNode pon = (CorePortalNode)window;
- NavigationalStateKey key = new NavigationalStateKey(WindowState.class, pon.getObjectId());
- navigationalStateResolver.setAttribute(key, windowState);
+ WindowNavigationalState.setWindowState(navigationalStateResolver, pon.getObjectId(), windowState);
}
public Mode getMode(PortalNode window) throws IllegalArgumentException
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java 2007-04-27 08:29:34 UTC (rev 7098)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java 2007-04-27 08:39:22 UTC (rev 7099)
@@ -79,7 +79,7 @@
return state;
}
- public static void setMode(AttributeResolver context, Object id, Mode mode)
+ public static WindowState getWindowState(AttributeResolver context, Object id)
{
NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
@@ -87,20 +87,31 @@
WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
//
+ return wns != null ? wns.getWindowState() : null;
+ }
+
+ public static void setWindowState(AttributeResolver context, Object id, WindowState windowState)
+ {
+ NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
+
+ //
+ WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+
+ //
if (wns == null)
{
- wns = new WindowNavigationalState(WindowState.NORMAL, mode, null);
+ wns = new WindowNavigationalState(windowState, Mode.VIEW, null);
}
else
{
- wns = new WindowNavigationalState(wns.getWindowState(), mode, wns.getState());
+ wns = new WindowNavigationalState(windowState, wns.getMode(), wns.getState());
}
//
context.setAttribute(key, wns);
}
- public static void setState(AttributeResolver context, Object id, StateString state)
+ public static Mode getMode(AttributeResolver context, Object id)
{
NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
@@ -108,20 +119,31 @@
WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
//
+ return wns != null ? wns.getMode() : null;
+ }
+
+ public static void setMode(AttributeResolver context, Object id, Mode mode)
+ {
+ NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
+
+ //
+ WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+
+ //
if (wns == null)
{
- wns = new WindowNavigationalState(WindowState.NORMAL, Mode.VIEW, state);
+ wns = new WindowNavigationalState(WindowState.NORMAL, mode, null);
}
else
{
- wns = new WindowNavigationalState(wns.getWindowState(), wns.getMode(), state);
+ wns = new WindowNavigationalState(wns.getWindowState(), mode, wns.getState());
}
//
context.setAttribute(key, wns);
}
- public static StateString setState(AttributeResolver context, Object id)
+ public static StateString getState(AttributeResolver context, Object id)
{
NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
@@ -131,4 +153,25 @@
//
return wns != null ? wns.getState() : null;
}
+
+ public static void setState(AttributeResolver context, Object id, StateString state)
+ {
+ NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
+
+ //
+ WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+
+ //
+ if (wns == null)
+ {
+ wns = new WindowNavigationalState(WindowState.NORMAL, Mode.VIEW, state);
+ }
+ else
+ {
+ wns = new WindowNavigationalState(wns.getWindowState(), wns.getMode(), state);
+ }
+
+ //
+ context.setAttribute(key, wns);
+ }
}
17 years
JBoss Portal SVN: r7098 - in trunk/theme/src: main/org/jboss/portal/theme/impl/render/dynamic and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-27 04:29:34 -0400 (Fri, 27 Apr 2007)
New Revision: 7098
Modified:
trunk/theme/src/bin/portal-ajax-war/dyna/style.css
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaDecorationRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java
Log:
- improve DnD handling fixes
Modified: trunk/theme/src/bin/portal-ajax-war/dyna/style.css
===================================================================
--- trunk/theme/src/bin/portal-ajax-war/dyna/style.css 2007-04-27 08:22:34 UTC (rev 7097)
+++ trunk/theme/src/bin/portal-ajax-war/dyna/style.css 2007-04-27 08:29:34 UTC (rev 7098)
@@ -11,6 +11,14 @@
cursor: move;
}
+.dnd-cleaner {
+ clear:both;
+ height:1px;
+ margin: -1px 0 0 0; padding:0;
+ border:none;
+ visibility: hidden;
+}
+
.dnd-droppable {
border: red 1px dashed;
background-color: Transparent;
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaDecorationRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaDecorationRenderer.java 2007-04-27 08:22:34 UTC (rev 7097)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaDecorationRenderer.java 2007-04-27 08:29:34 UTC (rev 7098)
@@ -72,7 +72,7 @@
delegate.render(rendererContext, drc);
// Clear the float that the div decoration renderer uses which prevent the handle to cover fully the zone
- markup.print("<div style=\"clear:both;\"/>");
+ markup.print("<hr class=\"dnd-cleaner\"/>");
//
markup.print("</div>\n");
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java 2007-04-27 08:22:34 UTC (rev 7097)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java 2007-04-27 08:29:34 UTC (rev 7098)
@@ -78,7 +78,7 @@
doCatchClicks(rendererContext, prc);
// Clear the float that the div decoration renderer uses which prevent the handle to cover fully the zone
- out.print("<div style=\"clear:both;\"/>");
+ out.print("<hr class=\"dnd-cleaner\"/>");
//
out.print("</div>");
17 years
JBoss Portal SVN: r7097 - in trunk: theme/src/main/org/jboss/portal/theme/impl/render/div and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-27 04:22:34 -0400 (Fri, 27 Apr 2007)
New Revision: 7097
Modified:
trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css
trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaDecorationRenderer.java
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java
Log:
- fix DnD handle for decoration : the div decoration renderer was floating elements which was causing the dnd zone to be only the portlet actions and the title. Adding a div having style clear:both in the dyna renderer solved the issue.
Modified: trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css
===================================================================
--- trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css 2007-04-27 04:19:34 UTC (rev 7096)
+++ trunk/core/src/bin/portal-core-war/themes/renaissance/portal_style.css 2007-04-27 08:22:34 UTC (rev 7097)
@@ -461,7 +461,6 @@
*****************************/
.portlet-container {
-/* margin: 10px;*/
padding: 10px;
}
@@ -496,14 +495,6 @@
height: 29px;
min-width: 9px;
background-position: bottom;
- /*
- background-color:#dfe8ed;
- border-top: 1px solid #98b7c6;
- border-bottom: 1px solid #98b7c6;
- border-left: 1px solid #98b7c6;
- width:20px;
- white-space: nowrap;
- */
}
.portlet-titlebar-center {
@@ -511,11 +502,6 @@
background-repeat: repeat-x;
height: 29px;
background-position: bottom;
- /* background-color:#dfe8ed;
- border-top: 1px solid #98b7c6;
- border-bottom: 1px solid #98b7c6;
- white-space: nowrap;
- */
}
.portlet-titlebar-right {
@@ -525,14 +511,6 @@
height: 30px;
min-width: 10px;
background-position: bottom left;
- /*
- background-color:#dfe8ed;
- border-top: 1px solid #98b7c6;
- border-right: 1px solid #98b7c6;
- border-bottom: 1px solid #98b7c6;
- width:10px;
- white-space: nowrap;
- */
}
.portlet-content-left {
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java 2007-04-27 04:19:34 UTC (rev 7096)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/render/div/DivDecorationRenderer.java 2007-04-27 08:22:34 UTC (rev 7097)
@@ -54,23 +54,27 @@
public void render(RendererContext rendererContext, DecorationRendererContext drc) throws RenderException
{
PrintWriter markup = rendererContext.getWriter();
+
+ //
renderTitle(rendererContext, drc);
+
+ //
markup.print("<div class=\"portlet-mode-container\">");
- renderModeAndStateLinks(rendererContext, drc, ActionRendererContext.MODES_KEY);
- renderModeAndStateLinks(rendererContext, drc, ActionRendererContext.WINDOWSTATES_KEY);
+ renderTriggerableActions(rendererContext, drc, ActionRendererContext.MODES_KEY);
+ renderTriggerableActions(rendererContext, drc, ActionRendererContext.WINDOWSTATES_KEY);
markup.print("</div>");
}
private static void renderTitle(RendererContext ctx, DecorationRendererContext drc)
{
PrintWriter out = ctx.getWriter();
- out.print("<div class=\"portlet-titlebar-decoration\">");
- out.print("<span class=\"portlet-titlebar-title\">");
+ out.print("<div class=\"portlet-titlebar-decoration\"></div>");
+ out.print("<span class=\"portlet-titlebar-title\">");
out.print(drc.getTitle());
- out.print("</span></div>");
+ out.print("</span>");
}
- private static void renderModeAndStateLinks(RendererContext ctx, DecorationRendererContext drc, String selector)
+ private static void renderTriggerableActions(RendererContext ctx, DecorationRendererContext drc, String selector)
{
Collection modesOrStates = drc.getTriggerableActions(selector);
if (modesOrStates == null)
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaDecorationRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaDecorationRenderer.java 2007-04-27 04:19:34 UTC (rev 7096)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaDecorationRenderer.java 2007-04-27 08:22:34 UTC (rev 7097)
@@ -67,7 +67,14 @@
//
markup.print("<div class=\"dnd-handle\">");
markup.print("<div class=\"dyna-decoration\">\n");
+
+ //
delegate.render(rendererContext, drc);
+
+ // Clear the float that the div decoration renderer uses which prevent the handle to cover fully the zone
+ markup.print("<div style=\"clear:both;\"/>");
+
+ //
markup.print("</div>\n");
markup.print("</div>\n");
}
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java 2007-04-27 04:19:34 UTC (rev 7096)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java 2007-04-27 08:22:34 UTC (rev 7097)
@@ -51,7 +51,6 @@
delegate = portletRenderer;
}
- /** @see org.jboss.portal.theme.render.renderer.PortletRenderer#render */
public void render(RendererContext rendererContext, PortletRendererContext prc) throws RenderException
{
doDND(rendererContext, prc);
@@ -74,7 +73,14 @@
//
out.print("<div class=\"dnd-handle\">");
+
+ //
doCatchClicks(rendererContext, prc);
+
+ // Clear the float that the div decoration renderer uses which prevent the handle to cover fully the zone
+ out.print("<div style=\"clear:both;\"/>");
+
+ //
out.print("</div>");
}
else
17 years