From portal-commits at lists.jboss.org Fri Mar 2 21:38:57 2007 Content-Type: multipart/mixed; boundary="===============0115006748516263452==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r6492 - in trunk/core-admin/src: main/org/jboss/portal/core/admin/ui/actions and 3 other directories. Date: Fri, 02 Mar 2007 21:38:55 -0500 Message-ID: --===============0115006748516263452== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2007-03-02 21:38:55 -0500 (Fri, 02 Mar 2007) New Revision: 6492 Added: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceBean.= java Removed: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferencesBean= .java trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/Prefere= nceAction.java Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManager= Bean.java trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerB= ean.java trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editP= references.xhtml trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xh= tml trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xht= ml Log: redone the UI preferences editor which was crappy Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Instance= ManagerBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManage= rBean.java 2007-03-02 20:28:32 UTC (rev 6491) +++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManage= rBean.java 2007-03-03 02:38:55 UTC (rev 6492) @@ -29,6 +29,7 @@ import java.util.Map; import java.util.Comparator; import java.util.Collections; +import java.util.Set; = import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; @@ -36,14 +37,10 @@ import javax.faces.application.FacesMessage; = import org.jboss.logging.Logger; -import org.jboss.portal.common.value.Value; import org.jboss.portal.core.model.instance.Instance; import org.jboss.portal.core.model.instance.InstanceContainer; import org.jboss.portal.core.model.instance.NoSuchInstanceException; import org.jboss.portal.core.model.instance.InstanceDefinition; -import org.jboss.portal.faces.matrix.Cell; -import org.jboss.portal.faces.matrix.Row; -import org.jboss.portal.faces.matrix.RowSetModel; import org.jboss.portal.faces.el.DelegatingPropertyResolver; import org.jboss.portal.faces.el.decorator.SimpleBeanDecorator; import org.jboss.portal.faces.el.decorator.AbstractPropertyDecorator; @@ -51,9 +48,12 @@ import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletInvokerException; import org.jboss.portal.portlet.info.PreferencesInfo; +import org.jboss.portal.portlet.info.PreferenceInfo; import org.jboss.portal.portlet.state.PropertyMap; +import org.jboss.portal.portlet.state.PropertyChange; import org.jboss.portal.security.AuthorizationDomainRegistry; import org.jboss.portal.security.spi.provider.DomainConfigurator; +import org.jboss.portal.common.value.Value; = /** * @author Julien Viet @@ -97,10 +97,10 @@ // Runtime fields depending on the navigational state = /** . */ - private Instance selectedInstance; + private PreferencesBean selectedPrefs; = /** . */ - private PreferencesBean selectedPreferences; + private Instance selectedInstance; = /** . */ private List instances; @@ -203,70 +203,37 @@ return selectedInstance; } = - public PreferencesBean getSelectedPreferences() + public PreferencesBean getSelectedPrefs() { Instance selectedInstance =3D getSelectedInstance(); = // - if (selectedInstance !=3D null) + if (selectedPrefs =3D=3D null && selectedInstance !=3D null) { try { + selectedPrefs =3D new PreferencesBean(true); + + // PreferencesInfo prefsInfo =3D selectedInstance.getPortlet().ge= tInfo().getPreferences(); - if (prefsInfo !=3D null) + Set keys =3D prefsInfo.getKeys(); + PropertyMap props =3D selectedInstance.getProperties(); + for (Iterator i =3D keys.iterator();i.hasNext();) { - RowSetModel model =3D new RowSetModel(null, prefsInfo.getKe= ys().size()); - PropertyMap prefs =3D getSelectedInstance().getProperties(); - - // - int index =3D 0; - for (Iterator i =3D prefsInfo.getKeys().iterator(); i.hasNe= xt(); index++) - { - String key =3D (String)i.next(); - - // Get info for this key -// PreferenceInfo info =3D prefsInfo.getPreference(key); -// boolean readOnly =3D info.isReadOnly(); - boolean readOnly =3D false; -// Value value =3D info.getValue(); - - // Get value from the state - Value value =3D prefs.getProperty(key); - - // - Row row =3D model.getRow(index); - row.setReadOnly(readOnly); - - // - Cell cell =3D 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 =3D new PreferencesBean(model); - - // - if (selectedRow !=3D null) - { - selectedPreferences.selectRow(selectedRow); - } + String key =3D (String)i.next(); + PreferenceInfo prefInfo =3D prefsInfo.getPreference(key); + Value value =3D props.getProperty(key); + selectedPrefs.addEntry(prefInfo, value); } } catch (PortletInvokerException e) { - log.warn("Couldn't access portlet invoker associated to instan= ce " + selectedInstance.getId() - + ". This instance won't be refreshed.\nReason:\n\t" + e.ge= tLocalizedMessage()); + e.printStackTrace(); } } - return selectedPreferences; + + // + return selectedPrefs; } = public AbstractAuthorizationBean getAuth() @@ -306,7 +273,6 @@ /** Refresh the selected prefs. */ public void refresh() { - selectedPreferences =3D null; selectedInstance =3D null; instances =3D null; } @@ -334,7 +300,7 @@ Map params =3D ectx.getRequestParameterMap(); selectedId =3D (String)params.get("id"); selectedPlugin =3D (String)params.get("plugin"); - selectedPreferences =3D null; + selectedPrefs =3D null; } = public void deleteInstance() @@ -351,8 +317,9 @@ = // selectedId =3D null; - selectedPreferences =3D null; + selectedPrefs =3D null; selectedFrom =3D 0; + selectedPlugin =3D null; } catch (NoSuchInstanceException e) { @@ -364,6 +331,45 @@ } } = + public void updatePrefs() + { + try + { + List tmp =3D new ArrayList(); + List entries =3D selectedPrefs.getEntries(); + for (int i =3D 0;i < entries.size();i++) + { + PreferenceBean entry =3D (PreferenceBean)entries.get(i); + if (entry.isStale()) + { + PropertyChange change =3D PropertyChange.newUpdate(entry.ge= tName(), entry.getValue()); + tmp.add(change); + } + } + PropertyChange[] changes =3D (PropertyChange[])tmp.toArray(new Pr= opertyChange[tmp.size()]); + getSelectedInstance().setProperties(changes); + + // Todo handle that change was ok in the UI + } + catch (PortletInvokerException e) + { + // Todo handle issue in the UI + e.printStackTrace(); + } + + // + selectedId =3D null; + selectedPrefs =3D null; + selectedPlugin =3D null; + } + + public void cancelPrefs() + { + selectedId =3D null; + selectedPrefs =3D null; + selectedPlugin =3D null; + } + /** A comparator for portlets. */ static final Comparator INSTANCE_COMPARATOR =3D new Comparator() { Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletM= anagerBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManager= Bean.java 2007-03-02 20:28:32 UTC (rev 6491) +++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManager= Bean.java 2007-03-03 02:38:55 UTC (rev 6492) @@ -35,12 +35,7 @@ import javax.faces.model.SelectItem; = import org.jboss.logging.Logger; -import org.jboss.portal.common.value.Value; -import org.jboss.portal.common.value.StringValue; import org.jboss.portal.core.model.instance.InstanceContainer; -import org.jboss.portal.faces.matrix.Cell; -import org.jboss.portal.faces.matrix.Row; -import org.jboss.portal.faces.matrix.RowSetModel; import org.jboss.portal.identity.RoleModule; import org.jboss.portal.portlet.Portlet; import org.jboss.portal.portlet.PortletContext; @@ -242,38 +237,13 @@ // If the portlet has preferences info then we display them if (prefsInfo !=3D null) { - RowSetModel model =3D new RowSetModel(null, prefsInfo.getKeys(= ).size()); - model.setMutable(false); - - // - int index =3D 0; - for (Iterator i =3D prefsInfo.getKeys().iterator(); i.hasNext(= ); index++) + selectedPreferences =3D new PreferencesBean(false); + for (Iterator i =3D prefsInfo.getKeys().iterator(); i.hasNext(= );) { String key =3D (String)i.next(); - - // - PreferenceInfo prefs =3D prefsInfo.getPreference(key); - Value value =3D new StringValue("not available"); - Boolean readOnly =3D prefs.isReadOnly(); - - // - Row row =3D model.getRow(index); - - // - Cell cell =3D 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()); + PreferenceInfo preferenceInfo =3D prefsInfo.getPreference(k= ey); + selectedPreferences.addEntry(preferenceInfo); } - - // - selectedPreferences =3D new PreferencesBean(model); } } return selectedPreferences; Added: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceB= ean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceBean= .java (rev 0) +++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceBean= .java 2007-03-03 02:38:55 UTC (rev 6492) @@ -0,0 +1,226 @@ +/*************************************************************************= ***** + * 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.common.value.Value; +import org.jboss.portal.common.value.StringValue; +import org.jboss.portal.common.util.LocalizedString; +import org.jboss.portal.faces.el.dynamic.DynamicBean; +import org.jboss.portal.faces.el.PropertyValue; +import org.jboss.portal.portlet.info.PreferenceInfo; + +import javax.faces.event.ActionEvent; +import java.util.List; +import java.util.ArrayList; + +/** + * @author Julien Viet + * @version $Revision: 1.1 $ + */ +public class PreferenceBean implements Comparable, DynamicBean +{ + + /** . */ + private String name; + + /** . */ + private boolean readOnly; + + /** . */ + private LocalizedString displayName; + + /** . */ + private LocalizedString description; + + /** . */ + private Value value; + + /** . */ + private String line; + + /** . */ + PreferencesBean container; + + /** . */ + private boolean stale; + + public PreferenceBean(PreferenceInfo prefInfo, Value value) + { + this.name =3D prefInfo.getKey(); + this.readOnly =3D Boolean.TRUE.equals(prefInfo.isReadOnly()); + this.displayName =3D prefInfo.getDisplayName(); + this.description =3D prefInfo.getDescription(); + this.value =3D value; + } + + public String getName() + { + return name; + } + + public boolean isReadOnly() + { + return readOnly; + } + + public void setReadOnly(boolean readOnly) + { + this.readOnly =3D readOnly; + } + + public LocalizedString getDisplayName() + { + return displayName; + } + + public void setDisplayName(LocalizedString displayName) + { + this.displayName =3D displayName; + } + + public LocalizedString getDescription() + { + return description; + } + + public void setDescription(LocalizedString description) + { + this.description =3D description; + } + + public Value getValue() + { + return value; + } + + public void setValue(Value value) + { + this.value =3D value; + } + + public boolean isStale() + { + return stale; + } + + public List getIndices() + { + List list =3D new ArrayList(value.size()); + for (int i =3D 0;i < value.size();i++) + { + list.add("index_" + i); + } + return list; + } + + public String getLine() + { + return line; + } + + public void setLine(String line) + { + this.line =3D line; + } + + public void select() + { + if (container =3D=3D null) + { + throw new IllegalStateException("Not attached to a container"); + } + container.selectedIndex =3D container.entries.indexOf(this); + } + + public void deleteLine(ActionEvent event) + { + String s =3D event.getComponent().getId(); + int index =3D Integer.parseInt(s.substring(4)); + List list =3D new ArrayList(value.asStringList()); + list.remove(index); + String[] strings =3D (String[])list.toArray(new String[list.size()]); + value =3D new StringValue(strings); + stale =3D true; + } + + public void appendLine() + { + List list =3D new ArrayList(value.asStringList()); + list.add(line); + String[] strings =3D (String[])list.toArray(new String[list.size()]); + value =3D new StringValue(strings); + stale =3D true; + line =3D null; + } + + public Class getType(Object propertyName) throws IllegalArgumentExcepti= on + { + if (propertyName instanceof String) + { + String s =3D (String)propertyName; + if (s.startsWith("index_")) + { + return String.class; + } + } + return null; + } + + public PropertyValue getValue(Object propertyName) throws IllegalArgume= ntException + { + if (propertyName instanceof String) + { + String s =3D (String)propertyName; + if (s.startsWith("index_")) + { + int index =3D Integer.parseInt(s.substring(6)); + return new PropertyValue(value.asStringList().get(index)); + } + } + return null; + } + + public boolean setValue(Object propertyName, Object value) throws Illeg= alArgumentException + { + if (propertyName instanceof String) + { + String s =3D (String)propertyName; + if (s.startsWith("index_")) + { + String[] tmp =3D this.value.asStringArray(); + int index =3D Integer.parseInt(s.substring(6)); + tmp[index] =3D (String)value; + this.value =3D new StringValue(tmp); + stale =3D true; + return true; + } + } + return false; + } + + public int compareTo(Object o) + { + PreferenceBean that =3D (PreferenceBean)o; + return name.compareTo(that.name); + } +} Deleted: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Preferenc= esBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferencesBea= n.java 2007-03-02 20:28:32 UTC (rev 6491) +++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferencesBea= n.java 2007-03-03 02:38:55 UTC (rev 6492) @@ -1,74 +0,0 @@ -/*************************************************************************= ***** - * 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.faces.matrix.Cell; -import org.jboss.portal.faces.matrix.Row; -import org.jboss.portal.faces.matrix.RowSetModel; - -/** - * @author Julien Viet - * @version $Revision: 5448 $ - */ -public class PreferencesBean -{ - - /** . */ - private RowSetModel model; - - /** . */ - private Cell selectedPreference; - - public PreferencesBean(RowSetModel selectedPreferences) - { - this.model =3D selectedPreferences; - } - - public Cell getSelectedPreference() - { - return selectedPreference; - } - - public void setSelectedPreference(Cell selectedPreference) - { - this.selectedPreference =3D selectedPreference; - } - - public RowSetModel getModel() - { - return model; - } - - public void selectRow(Integer index) - { - if (index !=3D null) - { - Row row =3D model.getRow(index.intValue()); - selectedPreference =3D row.getCell(); - } - else - { - selectedPreference =3D null; - } - } -} Deleted: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/P= referenceAction.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/Prefer= enceAction.java 2007-03-02 20:28:32 UTC (rev 6491) +++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/Prefer= enceAction.java 2007-03-03 02:38:55 UTC (rev 6492) @@ -1,181 +0,0 @@ -/*************************************************************************= ***** - * 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.actions; - -import org.jboss.portal.common.value.StringValue; -import org.jboss.portal.common.value.Value; -import org.jboss.portal.core.model.instance.Instance; -import org.jboss.portal.core.admin.ui.InstanceManagerBean; -import org.jboss.portal.faces.matrix.AbstractCellAction; -import org.jboss.portal.faces.matrix.Cell; -import org.jboss.portal.faces.matrix.Row; -import org.jboss.portal.faces.matrix.RowSetModel; -import org.jboss.portal.portlet.PortletInvokerException; -import org.jboss.portal.portlet.state.PropertyChange; -import org.jboss.portal.portlet.state.PropertyMap; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * @author Julien Viet - * @version $Revision: 5448 $ - */ -public class PreferenceAction extends AbstractCellAction -{ - - /** The instance manager bean. */ - private InstanceManagerBean manager; - - public InstanceManagerBean getManager() - { - return manager; - } - - public void setManager(InstanceManagerBean manager) - { - this.manager =3D manager; - } - - public void appendLine(String appendedValue) - { - try - { - // - Row row =3D getSelectedRow(); - String key =3D row.getHandback(); - - // - Instance instance =3D manager.getSelectedInstance(); - PropertyMap prefs =3D instance.getProperties(); - - Value value =3D prefs.getProperty(key); - String[] strings =3D value.asStringArray(); - String[] strings2 =3D new String[strings.length + 1]; - System.arraycopy(strings, 0, strings2, 0, strings.length); - strings2[strings.length] =3D appendedValue; - Value value2 =3D new StringValue(strings2); - - // - PropertyChange change =3D PropertyChange.newUpdate(key, value2); - instance.setProperties(new PropertyChange[]{change}); - } - catch (PortletInvokerException e) - { - throw new Error("Handle me gracefully please", e); - } - } - - public void deleteLine(int index) - { - try - { - Row row =3D getSelectedRow(); - String key =3D row.getHandback(); - - // - Instance instance =3D manager.getSelectedInstance(); - PropertyMap prefs =3D instance.getProperties(); - - // - Value value =3D prefs.getProperty(key); - String[] strings =3D value.asStringArray(); - List list =3D new ArrayList(Arrays.asList(strings)); - list.remove(index); - String[] strings2 =3D (String[])list.toArray(new String[list.size= ()]); - Value value2 =3D new StringValue(strings2); - - // - PropertyChange change =3D PropertyChange.newUpdate(key, value2); - instance.setProperties(new PropertyChange[]{change}); - } - catch (PortletInvokerException e) - { - throw new Error("Handle me gracefully please", e); - } - } - - public void updateCell() - { - try - { - Cell cell =3D manager.getSelectedPreferences().getSelectedPrefere= nce(); - StringValue value =3D new StringValue(cell.getValue()); - - // - Row row =3D cell.getRow(); - String key =3D row.getHandback(); - - // - Instance instance =3D manager.getSelectedInstance(); - - // - PropertyChange change =3D PropertyChange.newUpdate(key, value); - instance.setProperties(new PropertyChange[]{change}); - - // Unselect the current row has we consider that the update work = is done - manager.setSelectedRow(null); - } - catch (PortletInvokerException e) - { - throw new Error("Handle me gracefully please", e); - } - } - - - public void selectRow(int rowIndex) - { - manager.setSelectedRow(new Integer(rowIndex)); - } - - public void deleteRow(int rowIndex) - { - try - { - // - Instance instance =3D manager.getSelectedInstance(); - - // - Row row =3D manager.getSelectedPreferences().getModel().getRow(ro= wIndex); - - // - String key =3D row.getHandback(); - - // - PropertyChange change =3D PropertyChange.newReset(key); - instance.setProperties(new PropertyChange[]{change}); - } - catch (PortletInvokerException e) - { - throw new Error("Handle me gracefully please", e); - } - } - - private Row getSelectedRow() - { - int selectedRow =3D manager.getSelectedRow().intValue(); - RowSetModel model =3D manager.getSelectedPreferences().getModel(); - return model.getRow(selectedRow); - } -} Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-con= fig.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xm= l 2007-03-02 20:28:32 UTC (rev 6491) +++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xm= l 2007-03-03 02:38:55 UTC (rev 6492) @@ -140,15 +140,6 @@ #{applicationScope.AuthorizationDomainRegistry} - - preferenceAction - org.jboss.portal.core.admin.ui.actions.Preferenc= eAction - request - - manager - #{instancemgr} - - = Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/commo= n/editPreferences.xhtml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/edit= Preferences.xhtml 2007-03-02 20:28:32 UTC (rev 6491) +++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/edit= Preferences.xhtml 2007-03-03 02:38:55 UTC (rev 6492) @@ -12,65 +12,76 @@ Key Name ReadOnly - - Actions + + Value - Value - + - + + + #{pref.name} + + #{pref.name} + - + - + - + - Edit | - Reset + - - - = - + + - - - - - - - - - - + + + + + + + + + + +
+ + + + + +
+
+ - - + + +
+ Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/insta= nces.xhtml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.x= html 2007-03-02 20:28:32 UTC (rev 6491) +++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.x= html 2007-03-03 02:38:55 UTC (rev 6492) @@ -88,9 +88,12 @@

Editing preferences of #{instancemgr.selectedInstance.id}: - - + + + + + = Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portl= ets.xhtml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xh= tml 2007-03-02 20:28:32 UTC (rev 6491) +++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xh= tml 2007-03-03 02:38:55 UTC (rev 6492) @@ -80,7 +80,7 @@

Portlet preferences

- +
--===============0115006748516263452==--