Author: julien(a)jboss.com
Date: 2007-03-02 11:44:52 -0500 (Fri, 02 Mar 2007)
New Revision: 6490
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.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/instances.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml
Log:
improve admin app performances by defining a clear lifecycle for runtime state and also
make the clear distinction between the different scopes of state : nav state fields /
runtime state fields / wired services.
it allows to cache the runtime fields for the life cycle of the web request, probably will
improve it by moving this state into a separate bean scoped at request and wired with the
session beans which hold the navigational state
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-03-02
15:59:50 UTC (rev 6489)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-03-02
16:44:52 UTC (rev 6490)
@@ -27,6 +27,8 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Comparator;
+import java.util.Collections;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
@@ -64,6 +66,8 @@
/** . */
private Logger log = Logger.getLogger(getClass());
+ // Wired services
+
/** . */
private InstanceContainer instanceContainer;
@@ -73,6 +77,8 @@
/** . */
private RoleModule roleModule;
+ // Navigational state of the user
+
/** . */
private String selectedId;
@@ -83,17 +89,59 @@
private int selectedFrom;
/** . */
+ private Integer selectedRow;
+
+ /** . */
+ private final int paginationSize = 10;
+
+ // Runtime fields depending on the navigational state
+
+ /** . */
+ private Instance selectedInstance;
+
+ /** . */
private PreferencesBean selectedPreferences;
/** . */
- private Integer selectedRow;
+ private List instances;
/** . */
private AbstractAuthorizationBean auth = new AuthorizationBean();
- /** . */
- private final int paginationSize = 10;
+ // Services accessors
+ public AuthorizationDomainRegistry getAuthorizationDomainRegistry()
+ {
+ return authorizationDomainRegistry;
+ }
+
+ public void setAuthorizationDomainRegistry(AuthorizationDomainRegistry
authorizationDomainRegistry)
+ {
+ this.authorizationDomainRegistry = authorizationDomainRegistry;
+ }
+
+ public RoleModule getRoleModule()
+ {
+ return roleModule;
+ }
+
+ public void setRoleModule(RoleModule roleModule)
+ {
+ this.roleModule = roleModule;
+ }
+
+ public InstanceContainer getInstanceContainer()
+ {
+ return instanceContainer;
+ }
+
+ public void setInstanceContainer(InstanceContainer instanceContainer)
+ {
+ this.instanceContainer = instanceContainer;
+ }
+
+ // Navigational state accessor
+
public int getPaginationSize()
{
return paginationSize;
@@ -119,16 +167,6 @@
this.selectedRow = selectedRow;
}
- public InstanceContainer getInstanceContainer()
- {
- return instanceContainer;
- }
-
- public void setInstanceContainer(InstanceContainer instanceContainer)
- {
- this.instanceContainer = instanceContainer;
- }
-
public String getSelectedId()
{
return selectedId;
@@ -139,26 +177,18 @@
this.selectedId = selectedId;
}
- public AuthorizationDomainRegistry getAuthorizationDomainRegistry()
+ public String getSelectedPlugin()
{
- return authorizationDomainRegistry;
+ return selectedPlugin;
}
- public void setAuthorizationDomainRegistry(AuthorizationDomainRegistry
authorizationDomainRegistry)
+ public void setSelectedPlugin(String selectedPlugin)
{
- this.authorizationDomainRegistry = authorizationDomainRegistry;
+ this.selectedPlugin = selectedPlugin;
}
- public RoleModule getRoleModule()
- {
- return roleModule;
- }
+ // Runtime fields
- public void setRoleModule(RoleModule roleModule)
- {
- this.roleModule = roleModule;
- }
-
public DomainConfigurator getDomainConfigurator()
{
return
authorizationDomainRegistry.getDomain("instance").getConfigurator();
@@ -166,62 +196,123 @@
public Instance getSelectedInstance()
{
- if (selectedId != null)
+ if (selectedInstance == null && selectedId != null)
{
- return instanceContainer.getDefinition(selectedId);
+ selectedInstance = instanceContainer.getDefinition(selectedId);
}
- else
- {
- return null;
- }
+ return selectedInstance;
}
public PreferencesBean getSelectedPreferences()
{
+ Instance selectedInstance = getSelectedInstance();
+
+ //
+ if (selectedInstance != null)
+ {
+ try
+ {
+ PreferencesInfo prefsInfo =
selectedInstance.getPortlet().getInfo().getPreferences();
+ if (prefsInfo != null)
+ {
+ RowSetModel model = new RowSetModel(null, prefsInfo.getKeys().size());
+ PropertyMap prefs = getSelectedInstance().getProperties();
+
+ //
+ int index = 0;
+ for (Iterator i = prefsInfo.getKeys().iterator(); i.hasNext(); index++)
+ {
+ String key = (String)i.next();
+
+ // Get info for this key
+// PreferenceInfo info = prefsInfo.getPreference(key);
+// boolean readOnly = info.isReadOnly();
+ boolean readOnly = false;
+// Value value = info.getValue();
+
+ // Get value from the state
+ Value value = prefs.getProperty(key);
+
+ //
+ Row row = model.getRow(index);
+ row.setReadOnly(readOnly);
+
+ //
+ Cell cell = row.getCell();
+ cell.setHandback("" + i);
+ cell.setValue(value.asStringArray());
+
+ //
+ row.setHandback(key);
+ row.setKey(key);
+ row.setName("Description");
+ row.setReadOnly(false);
+ row.setValue(value.asStringArray());
+ }
+
+ //
+ selectedPreferences = new PreferencesBean(model);
+
+ //
+ if (selectedRow != null)
+ {
+ selectedPreferences.selectRow(selectedRow);
+ }
+ }
+ }
+ catch (PortletInvokerException e)
+ {
+ log.warn("Couldn't access portlet invoker associated to instance
" + selectedInstance.getId()
+ + ". This instance won't be refreshed.\nReason:\n\t" +
e.getLocalizedMessage());
+ }
+ }
return selectedPreferences;
}
- public String getSelectedPlugin()
+ public AbstractAuthorizationBean getAuth()
{
- return selectedPlugin;
+ return auth;
}
- public void setSelectedPlugin(String selectedPlugin)
+ private List getInstances()
{
- this.selectedPlugin = selectedPlugin;
- }
+ if (instances == null)
+ {
+ instances = new ArrayList(instanceContainer.getDefinitions());
+ Collections.sort(instances, comparator);
+ }
- public AbstractAuthorizationBean getAuth()
- {
- return auth;
+ //
+ return instances;
}
/** Return an array of all instances known in this container. */
- public Collection getInstances()
+ public Collection getSelectedInstances()
{
- List instances = new ArrayList(instanceContainer.getDefinitions());
+ List list = getInstances();
-// try
-// {
-// sortInstances(instances, sortColumn, sortAscending);
-// }
-// catch (Exception e)
-// {
-// log.warn("Error during sorting instances list");
-// }
-
//
- int to = Math.min(selectedFrom + 10, instances.size());
+ int to = Math.min(selectedFrom + 10, list.size());
//
- return instances.subList(selectedFrom, to);
+ return list.subList(selectedFrom, to);
}
public int getInstanceCount()
{
- return instanceContainer.getDefinitions().size();
+ return getInstances().size();
}
+ /** Refresh the selected prefs. */
+ public void refresh()
+ {
+ selectedPreferences = null;
+ selectedInstance = null;
+ instances = null;
+ }
+
+ // UI operations
+
public void selectFrom()
{
Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
@@ -273,125 +364,17 @@
}
}
- /** Refresh the selected prefs. */
- public void refresh()
+ /** A comparator for portlets. */
+ final Comparator comparator = new Comparator()
{
- selectedPreferences = null;
-
- //
- if ("preferences".equals(selectedPlugin))
+ public int compare(Object o1, Object o2)
{
- Instance selectedInstance = getSelectedInstance();
-
- //
- if (selectedInstance != null)
- {
- try
- {
- PreferencesInfo prefsInfo =
selectedInstance.getPortlet().getInfo().getPreferences();
- if (prefsInfo != null)
- {
- RowSetModel model = new RowSetModel(null, prefsInfo.getKeys().size());
- PropertyMap prefs = getSelectedInstance().getProperties();
-
- //
- int index = 0;
- for (Iterator i = prefsInfo.getKeys().iterator(); i.hasNext();
index++)
- {
- String key = (String)i.next();
-
- // Get info for this key
- // PreferenceInfo info = prefsInfo.getPreference(key);
- // boolean readOnly = info.isReadOnly();
- boolean readOnly = false;
- // Value value = info.getValue();
-
- // Get value from the state
- Value value = prefs.getProperty(key);
-
- //
- Row row = model.getRow(index);
- row.setReadOnly(readOnly);
-
- //
- Cell cell = row.getCell();
- cell.setHandback("" + i);
- cell.setValue(value.asStringArray());
-
- //
- row.setHandback(key);
- row.setKey(key);
- row.setName("Description");
- row.setReadOnly(false);
- row.setValue(value.asStringArray());
- }
-
- //
- selectedPreferences = new PreferencesBean(model);
-
- //
- if (selectedRow != null)
- {
- selectedPreferences.selectRow(selectedRow);
- }
- }
- }
- catch (PortletInvokerException e)
- {
- log.warn("Couldn't access portlet invoker associated to instance
" + selectedInstance.getId()
- + ". This instance won't be refreshed.\nReason:\n\t" +
e.getLocalizedMessage());
- }
- }
+ Instance i1 = (Instance)o1;
+ Instance i2 = (Instance)o2;
+ return i1.getId().compareToIgnoreCase(i2.getId());
}
- }
+ };
-// public static void sortInstances(List instances, final String column, final boolean
ascending)
-// {
-// Comparator comparator = new Comparator()
-// {
-// public int compare(Object o1, Object o2)
-// {
-// if (column == null)
-// {
-// return 0;
-// }
-// if (column.equals("id"))
-// {
-// Instance i1 = (Instance)((Object[])o1)[0];
-// Instance i2 = (Instance)((Object[])o2)[0];
-// return ascending ? i1.getId().compareToIgnoreCase(i2.getId()) :
i2.getId()
-// .compareToIgnoreCase(i1.getId());
-// }
-// if (column.equals("portlet"))
-// {
-// Portlet p1 = (Portlet)((Object[])o1)[1];
-// Portlet p2 = (Portlet)((Object[])o2)[1];
-//
-// LocalizedString displayName =
p1.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
-// FacesContext ctx = FacesContext.getCurrentInstance();
-// Locale locale = ctx.getExternalContext().getRequestLocale();
-// String name1 = displayName.getString(locale, true);
-// displayName =
p2.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
-// String name2 = displayName.getString(locale, true);
-//
-// if (name1 == null || name2 == null)
-// {
-// return 0;
-// }
-//
-// return ascending ? name1.compareToIgnoreCase(name2) : name2
-// .compareToIgnoreCase(name1);
-// }
-//
-// else
-// {
-// return 0;
-// }
-// }
-// };
-// Collections.sort(instances, comparator);
-// }
-
public class AuthorizationBean extends AbstractAuthorizationBean
{
@@ -461,4 +444,52 @@
DelegatingPropertyResolver.registerDecorator(InstanceDefinition.class,
instanceDecorator);
}
+// public static void sortInstances(List instances, final String column, final boolean
ascending)
+// {
+// Comparator comparator = new Comparator()
+// {
+// public int compare(Object o1, Object o2)
+// {
+// if (column == null)
+// {
+// return 0;
+// }
+// if (column.equals("id"))
+// {
+// Instance i1 = (Instance)((Object[])o1)[0];
+// Instance i2 = (Instance)((Object[])o2)[0];
+// return ascending ? i1.getId().compareToIgnoreCase(i2.getId()) :
i2.getId()
+// .compareToIgnoreCase(i1.getId());
+// }
+// if (column.equals("portlet"))
+// {
+// Portlet p1 = (Portlet)((Object[])o1)[1];
+// Portlet p2 = (Portlet)((Object[])o2)[1];
+//
+// LocalizedString displayName =
p1.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
+// FacesContext ctx = FacesContext.getCurrentInstance();
+// Locale locale = ctx.getExternalContext().getRequestLocale();
+// String name1 = displayName.getString(locale, true);
+// displayName =
p2.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
+// String name2 = displayName.getString(locale, true);
+//
+// if (name1 == null || name2 == null)
+// {
+// return 0;
+// }
+//
+// return ascending ? name1.compareToIgnoreCase(name2) : name2
+// .compareToIgnoreCase(name1);
+// }
+//
+// else
+// {
+// return 0;
+// }
+// }
+// };
+// Collections.sort(instances, comparator);
+// }
+
+
}
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-03-02
15:59:50 UTC (rev 6489)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-03-02
16:44:52 UTC (rev 6490)
@@ -65,6 +65,8 @@
/** . */
private Logger log = Logger.getLogger(getClass());
+ // Wired services
+
/** . */
private InstanceContainer instanceContainer;
@@ -72,47 +74,70 @@
private AuthorizationDomainRegistry authorizationDomainRegistry;
/** . */
+ private RoleModule roleModule;
+
+ /** . */
+ private FederatingPortletInvoker federatingPortletInvoker;
+
+ // Navigational state
+
+ /** . */
+ private int selectedFrom;
+
+ /** . */
+ private final int paginationSize = 10;
+
+ /** . */
private String selectedPortletId;
/** The current tab name. */
private String selectedPlugin;
/** . */
- private RoleModule roleModule;
+ private String selectedPortletInvokerId;
+ // Runtime state
+
/** . */
- private PreferencesBean selectedPreferences;
+ private AbstractAuthorizationBean auth = new AuthorizationBean();
/** . */
- private String selectedFederatedId;
+ private PreferencesBean selectedPreferences;
/** . */
- private AbstractAuthorizationBean auth = new AuthorizationBean();
+ private Portlet selectedPortlet;
/** . */
- private FederatingPortletInvoker federatingPortletInvoker;
+ private Collection portletInvokerItems;
/** . */
- private int selectedFrom;
+ private List portlets;
/** . */
- private final int paginationSize = 10;
+ private FederatedPortletInvoker selectedPortletInvoker;
- public int getPaginationSize()
+ // Wired services
+
+ public InstanceContainer getInstanceContainer()
{
- return paginationSize;
+ return instanceContainer;
}
- public int getSelectedFrom()
+ public void setInstanceContainer(InstanceContainer instanceContainer)
{
- return selectedFrom;
+ this.instanceContainer = instanceContainer;
}
- public void setSelectedFrom(int selectedFrom)
+ public AuthorizationDomainRegistry getAuthorizationDomainRegistry()
{
- this.selectedFrom = selectedFrom;
+ return authorizationDomainRegistry;
}
+ public void setAuthorizationDomainRegistry(AuthorizationDomainRegistry
authorizationDomainRegistry)
+ {
+ this.authorizationDomainRegistry = authorizationDomainRegistry;
+ }
+
public RoleModule getRoleModule()
{
return roleModule;
@@ -123,44 +148,31 @@
this.roleModule = roleModule;
}
- private PortletInvoker getPortletInvoker()
+ public FederatingPortletInvoker getFederatingPortletInvoker()
{
- return federatingPortletInvoker.getFederatedInvoker(selectedFederatedId);
+ return federatingPortletInvoker;
}
- public Collection getFederatedIds()
+ public void setFederatingPortletInvoker(FederatingPortletInvoker
federatingPortletInvoker)
{
- ArrayList toto = new ArrayList();
- toto.add(new SelectItem("local"));
- for (Iterator i = federatingPortletInvoker.getFederatedInvokers().iterator();
i.hasNext();)
- {
- FederatedPortletInvoker federated = (FederatedPortletInvoker)i.next();
- if ("local".equals(federated.getId()) == false)
- {
- toto.add(new SelectItem(federated.getId()));
- }
- }
- return toto;
+ this.federatingPortletInvoker = federatingPortletInvoker;
}
- public InstanceContainer getInstanceContainer()
- {
- return instanceContainer;
- }
+ // Navigational state
- public void setInstanceContainer(InstanceContainer instanceContainer)
+ public int getPaginationSize()
{
- this.instanceContainer = instanceContainer;
+ return paginationSize;
}
- public AuthorizationDomainRegistry getAuthorizationDomainRegistry()
+ public int getSelectedFrom()
{
- return authorizationDomainRegistry;
+ return selectedFrom;
}
- public void setAuthorizationDomainRegistry(AuthorizationDomainRegistry
authorizationDomainRegistry)
+ public void setSelectedFrom(int selectedFrom)
{
- this.authorizationDomainRegistry = authorizationDomainRegistry;
+ this.selectedFrom = selectedFrom;
}
public String getSelectedPlugin()
@@ -173,46 +185,110 @@
this.selectedPlugin = selectedPlugin;
}
- public String getSelectedFederatedId()
+ public String getSelectedPortletInvokerId()
{
- return selectedFederatedId;
+ return selectedPortletInvokerId;
}
- public void setSelectedFederatedId(String selectedFederatedId)
+ public void setSelectedPortletInvokerId(String selectedPortletInvokerId)
{
- this.selectedFederatedId = selectedFederatedId;
+ this.selectedPortletInvokerId = selectedPortletInvokerId;
}
- public FederatingPortletInvoker getFederatingPortletInvoker()
+ // Runtime state
+
+ private PortletInvoker getSelectedPortletInvoker()
{
- return federatingPortletInvoker;
+ if (selectedPortletInvoker == null)
+ {
+ selectedPortletInvoker =
federatingPortletInvoker.getFederatedInvoker(selectedPortletInvokerId);
+ }
+ return selectedPortletInvoker;
}
- public void setFederatingPortletInvoker(FederatingPortletInvoker
federatingPortletInvoker)
+ public Collection getPortletInvokerItems()
{
- this.federatingPortletInvoker = federatingPortletInvoker;
+ if (portletInvokerItems == null)
+ {
+ portletInvokerItems = new ArrayList();
+ portletInvokerItems.add(new SelectItem("local"));
+ for (Iterator i = federatingPortletInvoker.getFederatedInvokers().iterator();
i.hasNext();)
+ {
+ FederatedPortletInvoker federated = (FederatedPortletInvoker)i.next();
+ if ("local".equals(federated.getId()) == false)
+ {
+ portletInvokerItems.add(new SelectItem(federated.getId()));
+ }
+ }
+ }
+ return portletInvokerItems;
}
public PreferencesBean getSelectedPreferences()
{
+ // Get user locale
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ Locale locale = ctx.getExternalContext().getRequestLocale();
+
+ // Get portlet
+ Portlet portlet = getSelectedPortlet();
+
+ //
+ if (portlet != null)
+ {
+ // Get preferences info
+ PreferencesInfo prefsInfo = portlet.getInfo().getPreferences();
+
+ // If the portlet has preferences info then we display them
+ if (prefsInfo != null)
+ {
+ RowSetModel model = new RowSetModel(null, prefsInfo.getKeys().size());
+ model.setMutable(false);
+
+ //
+ int index = 0;
+ for (Iterator i = prefsInfo.getKeys().iterator(); i.hasNext(); index++)
+ {
+ String key = (String)i.next();
+
+ //
+ PreferenceInfo prefs = prefsInfo.getPreference(key);
+ Value value = new StringValue("not available");
+ Boolean readOnly = prefs.isReadOnly();
+
+ //
+ Row row = model.getRow(index);
+
+ //
+ Cell cell = row.getCell();
+ cell.setHandback("" + i);
+ cell.setValue(value.asStringArray());
+
+ //
+ row.setHandback(key);
+ row.setKey(key);
+ row.setName(prefs.getDisplayName().getString(locale, true));
+ row.setReadOnly(Boolean.TRUE.equals(readOnly));
+ row.setValue(value.asStringArray());
+ }
+
+ //
+ selectedPreferences = new PreferencesBean(model);
+ }
+ }
return selectedPreferences;
}
- public Collection getPortlets()
+ private List getPortlets()
{
try
{
- // Get portlets
- List portlets = new ArrayList(getPortletInvoker().getPortlets());
-
- // Sort
- Collections.sort(portlets, comparator);
-
- // Compute upper bound
- int to = Math.min(selectedFrom + 10, portlets.size());
-
- // Range
- return portlets.subList(selectedFrom, to);
+ if (portlets == null)
+ {
+ portlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
+ Collections.sort(portlets, comparator);
+ }
+ return portlets;
}
catch (PortletInvokerException e)
{
@@ -221,16 +297,20 @@
}
}
+ public Collection getSelectedPortlets()
+ {
+ List portlets = getPortlets();
+
+ // Compute upper bound
+ int to = Math.min(selectedFrom + 10, portlets.size());
+
+ // Range
+ return portlets.subList(selectedFrom, to);
+ }
+
public int getPortletCount()
{
- try
- {
- return getPortletInvoker().getPortlets().size();
- }
- catch (PortletInvokerException e)
- {
- return 0;
- }
+ return getPortlets().size();
}
public DomainConfigurator getDomainConfigurator()
@@ -245,26 +325,24 @@
public Portlet getSelectedPortlet()
{
- if (selectedPortletId != null)
+ if (selectedPortlet == null && selectedPortletId != null)
{
try
{
- return
getPortletInvoker().getPortlet(PortletContext.createPortletContext(selectedPortletId));
+ selectedPortlet =
getSelectedPortletInvoker().getPortlet(PortletContext.createPortletContext(selectedPortletId));
}
catch (PortletInvokerException e)
{
// todo: find a way to report these errors to the user
log.warn("Portlet invoker unavailable for portlet: " +
selectedPortletId
+ ". Returning null instead.\nReason:\n\t" +
e.getLocalizedMessage());
- return null;
}
}
- else
- {
- return null;
- }
+ return selectedPortlet;
}
+ // UI actions
+
public String selectPortlet()
{
FacesContext ctx = FacesContext.getCurrentInstance();
@@ -279,10 +357,10 @@
FederatedPortlet portlet =
(FederatedPortlet)federatingPortletInvoker.getPortlet(portletCtx);
//
- selectedFederatedId = portlet.getFederatedId();
+ selectedPortletInvokerId = portlet.getFederatedId();
// Get sorted portlets
- List portlets = new ArrayList(getPortletInvoker().getPortlets());
+ List portlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
Collections.sort(portlets, comparator);
// Find the portlet index in the list
@@ -317,61 +395,10 @@
public void refresh()
{
selectedPreferences = null;
-
- //
- if ("preferences".equals(selectedPlugin))
- {
- // Get user locale
- FacesContext ctx = FacesContext.getCurrentInstance();
- Locale locale = ctx.getExternalContext().getRequestLocale();
-
- // Get portlet
- Portlet portlet = getSelectedPortlet();
-
- //
- if (portlet != null)
- {
- // Get preferences info
- PreferencesInfo prefsInfo = portlet.getInfo().getPreferences();
-
- // If the portlet has preferences info then we display them
- if (prefsInfo != null)
- {
- RowSetModel model = new RowSetModel(null, prefsInfo.getKeys().size());
- model.setMutable(false);
-
- //
- int index = 0;
- for (Iterator i = prefsInfo.getKeys().iterator(); i.hasNext(); index++)
- {
- String key = (String)i.next();
-
- //
- PreferenceInfo prefs = prefsInfo.getPreference(key);
- Value value = new StringValue("not available");
- Boolean readOnly = prefs.isReadOnly();
-
- //
- Row row = model.getRow(index);
-
- //
- Cell cell = row.getCell();
- cell.setHandback("" + i);
- cell.setValue(value.asStringArray());
-
- //
- row.setHandback(key);
- row.setKey(key);
- row.setName(prefs.getDisplayName().getString(locale, true));
- row.setReadOnly(Boolean.TRUE.equals(readOnly));
- row.setValue(value.asStringArray());
- }
-
- //
- selectedPreferences = new PreferencesBean(model);
- }
- }
- }
+ selectedPortlet = null;
+ selectedPortletInvoker = null;
+ portlets = null;
+ portletInvokerItems = null;
}
/** A comparator for portlets. */
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-03-02
15:59:50 UTC (rev 6489)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-03-02
16:44:52 UTC (rev 6490)
@@ -167,7 +167,7 @@
<value>#{applicationScope.FederatingPortletInvoker}</value>
</managed-property>
<managed-property>
- <property-name>selectedFederatedId</property-name>
+ <property-name>selectedPortletInvokerId</property-name>
<value>local</value>
</managed-property>
</managed-bean>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-03-02
15:59:50 UTC (rev 6489)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-03-02
16:44:52 UTC (rev 6490)
@@ -20,7 +20,7 @@
</tr>
</thead>
<tbody>
- <c:forEach items="#{instancemgr.instances}"
var="instance" varStatus="status">
+ <c:forEach items="#{instancemgr.selectedInstances}"
var="instance" varStatus="status">
<tr class="#{instance.id == instancemgr.selectedId ?
'portlet-section-selected' : (status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate')}">
<td>
<h:commandLink
action="#{instancemgr.selectInstance}">
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml 2007-03-02
15:59:50 UTC (rev 6489)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml 2007-03-02
16:44:52 UTC (rev 6490)
@@ -15,8 +15,8 @@
<h:outputLabel for="menu">
<h:outputText value="Portlet provider: "
styleClass="portlet-form-field-label"/>
</h:outputLabel>
- <h:selectOneMenu id="menu" styleClass="portlet-form-field"
value="#{portletmgr.selectedFederatedId}">
- <f:selectItems value="#{portletmgr.federatedIds}"/>
+ <h:selectOneMenu id="menu" styleClass="portlet-form-field"
value="#{portletmgr.selectedPortletInvokerId}">
+ <f:selectItems value="#{portletmgr.portletInvokerItems}"/>
</h:selectOneMenu>
<h:commandButton value="Change"
styleClass="portlet-form-button"/>
</h:form>
@@ -33,7 +33,7 @@
</tr>
</thead>
<tbody>
- <c:forEach items="#{portletmgr.portlets}"
var="portlet" varStatus="status">
+ <c:forEach items="#{portletmgr.selectedPortlets}"
var="portlet" varStatus="status">
<tr class="#{portlet.context.id ==
portletmgr.selectedPortlet.context.id ? 'portlet-section-selected' : (status.index
% 2 == 0 ? 'portlet-section-body' :
'portlet-section-alternate')}">
<td>
<h:commandLink