[portal-commits] JBoss Portal SVN: r9143 - in branches/JBoss_Portal_Branch_2_6/core-admin/src: resources/portal-admin-war/WEB-INF/jsf and 1 other directory.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Tue Nov 27 20:12:15 EST 2007


Author: wesleyhales
Date: 2007-11-27 20:12:14 -0500 (Tue, 27 Nov 2007)
New Revision: 9143

Modified:
   branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalObjectDisplayNameAction.java
   branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/displayNameObject.xhtml
Log:
JBPORTAL-1805  Let a user define multiple display-name for a portal object in the admin portlet

Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalObjectDisplayNameAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalObjectDisplayNameAction.java	2007-11-28 00:52:22 UTC (rev 9142)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalObjectDisplayNameAction.java	2007-11-28 01:12:14 UTC (rev 9143)
@@ -55,16 +55,12 @@
 
    private String displayNameByLocale;
 
-
    public void addDisplayName() throws ConversionException
    {
 
-      if (newText != null || newText.equals(""))
+      if (newText != null)
       {
-         if (bean instanceof PortalObjectManagerBean)
-         {
-         selectedObject = ((PortalObjectManagerBean) bean).getSelectedObject();
-         }
+         getSelectedObject();
          Locale locale = LocaleFormat.DEFAULT.getLocale(newLocale);
          Map map = new HashMap();
          LocalizedString.Value lsv = new LocalizedString.Value(locale, newText);
@@ -80,6 +76,10 @@
 
    public PortalObject getSelectedObject()
    {
+      if (bean instanceof PortalObjectManagerBean)
+      {
+         selectedObject = ((PortalObjectManagerBean) bean).getSelectedObject();
+      }
       return selectedObject;
    }
 
@@ -100,15 +100,15 @@
 
    public SortedMap getLocales()
    {
-      SortedMap set = new TreeMap();
+      SortedMap smap = new TreeMap();
       Locale[] localList = (Locale[]) LocaleManager.getLocales().toArray(new Locale[0]);
 
       for (int i = 0; i < localList.length; i++)
       {
          Locale thisLocale = localList[i];
-         set.put(thisLocale.getLanguage(), thisLocale.getLanguage());
+         smap.put(thisLocale.getLanguage(), thisLocale.getLanguage());
       }
-      return set;
+      return smap;
    }
 
    public void setLocales(SortedMap locales)
@@ -144,6 +144,11 @@
       return null;
    }
 
+   public void setCurrentLocales(Map currentLocales)
+   {
+      this.currentLocales = currentLocales;
+   }
+
    public String getDisplayNameByLocale(Locale locale)
    {
         Map displayNames = selectedObject.getDisplayName().getValues();
@@ -153,7 +158,8 @@
 
    public String editDisplayNames() throws ConversionException
    {
-      getCurrentLocales();   
+      getSelectedObject();
+      getCurrentLocales();
       return "editDisplayNames";
    }
 

Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/displayNameObject.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/displayNameObject.xhtml	2007-11-28 00:52:22 UTC (rev 9142)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/displayNameObject.xhtml	2007-11-28 01:12:14 UTC (rev 9143)
@@ -22,7 +22,7 @@
             </div>
             <p class="portlet-area-header">Add Display Names</p>
             <div class="portlet-area-body">
-               <h:inputText id="newName" value="#{addDisplayNameAction.newText}"/>
+               <h:inputText id="newName" value="#{addDisplayNameAction.newText}" required="true"/>
                <h:selectOneMenu id="locales" value="#{addDisplayNameAction.newLocale}">
                   <f:selectItems value="#{addDisplayNameAction.locales}"/>
                </h:selectOneMenu>




More information about the portal-commits mailing list