Author: thomas.heute(a)jboss.com
Date: 2007-11-19 19:12:45 -0500 (Mon, 19 Nov 2007)
New Revision: 9031
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java
Log:
Oups, fixing PortalObject API
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-11-20
00:11:35 UTC (rev 9030)
+++
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/impl/model/portal/PortalObjectImpl.java 2007-11-20
00:12:45 UTC (rev 9031)
@@ -146,11 +146,24 @@
this.displayNames = displayNames;
}
+
public Map getDisplayNames()
{
return displayNames;
}
+ public void setDisplayName(LocalizedString displayName)
+ {
+ displayNames = new HashMap();
+ Map map = displayName.getValues();
+ Iterator it = map.values().iterator();
+ while (it.hasNext())
+ {
+ LocalizedString.Value value = (LocalizedString.Value)it.next();
+ displayNames.put(value.getLocale(), value.getString());
+ }
+ }
+
public LocalizedString getDisplayName()
{
return new LocalizedString(displayNames, Locale.ENGLISH);
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java 2007-11-20
00:11:35 UTC (rev 9030)
+++
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/PortalObject.java 2007-11-20
00:12:45 UTC (rev 9031)
@@ -99,7 +99,7 @@
*
* @param the localized display name
*/
- void setDisplayNames(Map localizedString);
+ void setDisplayName(LocalizedString localizedString);
/**
* Returns the listener id or null if there is none.
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java 2007-11-20
00:11:35 UTC (rev 9030)
+++
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java 2007-11-20
00:12:45 UTC (rev 9031)
@@ -30,6 +30,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.common.i18n.LocaleFormat;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.common.util.ConversionException;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.xml.XMLTools;
@@ -59,7 +60,7 @@
private Map properties;
private Map children;
private SecurityConstraintsMetaData securityConstraints;
- private Map displayNames;
+ private LocalizedString displayName;
public PortalObjectMetaData()
{
@@ -107,14 +108,14 @@
this.children = children;
}
- public void setDisplayNames(Map displayNames)
+ public void setDisplayName(LocalizedString displayName)
{
- this.displayNames = displayNames;
+ this.displayName = displayName;
}
- public Map getDisplayNames()
+ public LocalizedString getDisplayName()
{
- return displayNames;
+ return displayName;
}
public SecurityConstraintsMetaData getSecurityConstraints()
@@ -178,7 +179,7 @@
object.setListener(listener);
// Configure display name
- object.setDisplayNames(displayNames);
+ object.setDisplayName(displayName);
// Configure security
SecurityConstraintsMetaData securityConstraints = getSecurityConstraints();
@@ -310,7 +311,7 @@
}
if (localizedStringValues.size() != 0)
{
- portalObjectMD.setDisplayNames(localizedStringValues);
+ portalObjectMD.setDisplayName(new LocalizedString(localizedStringValues,
Locale.ENGLISH));
}
}