Author: mwringe
Date: 2010-02-23 14:45:43 -0500 (Tue, 23 Feb 2010)
New Revision: 1826
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
Log:
GTNPORTAL-699: Check if the default portal name is explicitly set by an extension before
overriding the value set in the portal. This will prevent the sample extension from always
overriding the default portal name.
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2010-02-23
18:00:04 UTC (rev 1825)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/NewPortalConfigListener.java 2010-02-23
19:45:43 UTC (rev 1826)
@@ -68,6 +68,12 @@
private String pageTemplatesLocation_;
private String defaultPortal;
+
+ /**
+ * If true the default portal name has been explicitly set.
+ * If false the name has not been set and we are using the default.
+ */
+ private boolean defaultPortalSpecified = false;
private boolean isUseTryCatch;
@@ -83,12 +89,21 @@
if (valueParam != null)
pageTemplatesLocation_ = valueParam.getValue();
- defaultPortal = "classic";
valueParam = params.getValueParam("default.portal");
if (valueParam != null)
+ {
defaultPortal = valueParam.getValue();
+ }
+
if (defaultPortal == null || defaultPortal.trim().length() == 0)
+ {
defaultPortal = "classic";
+ }
+ else
+ {
+ defaultPortalSpecified = true;
+ }
+
configs = params.getObjectParamValues(NewPortalConfig.class);
templateConfigs = params.getObjectParamValues(SiteConfigTemplates.class);
@@ -230,7 +245,14 @@
*/
public void mergePlugin(NewPortalConfigListener other)
{
- this.defaultPortal = other.defaultPortal;
+ //if other didn't actually set anything for the default portal name
+ //then we should continue to use the current value. This way if an extension
+ //doesn't set it, it wont override the parent's set value.
+ if (other.defaultPortalSpecified)
+ {
+ this.defaultPortal = other.defaultPortal;
+ }
+
if (configs == null)
{
this.configs = other.configs;