Author: julien_viet
Date: 2010-03-10 16:35:07 -0500 (Wed, 10 Mar 2010)
New Revision: 2129
Removed:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/Decorated.java
Modified:
portal/trunk/component/portal/src/main/java/conf/gatein-nodetypes.xml
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/MappedAttributes.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
portal/trunk/component/portal/src/test/java/conf/exo.portal.component.portal-configuration1.xml
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
Log:
actually need to remove some of the properties that were migrated as a mixin as they are
not really a mixin but really state that could be cascaded
Modified: portal/trunk/component/portal/src/main/java/conf/gatein-nodetypes.xml
===================================================================
--- portal/trunk/component/portal/src/main/java/conf/gatein-nodetypes.xml 2010-03-10
21:12:29 UTC (rev 2128)
+++ portal/trunk/component/portal/src/main/java/conf/gatein-nodetypes.xml 2010-03-10
21:35:07 UTC (rev 2129)
@@ -40,23 +40,6 @@
</propertyDefinitions>
</nodeType>
- <nodeType name="gtn:decorated" isMixin="true"
hasOrderableChildNodes="false" primaryItemName="">
- <propertyDefinitions>
- <propertyDefinition name="gtn:showinfobar"
requiredType="Boolean" autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="gtn:showwindowstate"
requiredType="Boolean" autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="gtn:showmode"
requiredType="Boolean" autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="gtn:theme" requiredType="String"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- </nodeType>
-
<nodeType name="gtn:visible" isMixin="true"
hasOrderableChildNodes="false" primaryItemName="">
<propertyDefinitions>
<propertyDefinition name="gtn:startpublicationdate"
requiredType="Date" autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false"
multiple="false">
Deleted:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/Decorated.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/Decorated.java 2010-03-10
21:12:29 UTC (rev 2128)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/mop/Decorated.java 2010-03-10
21:35:07 UTC (rev 2129)
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.portal.mop;
-
-import org.chromattic.api.annotations.MixinType;
-import org.chromattic.api.annotations.Property;
-
-/**
- * An object that has a surrounding configurable decoration.
- *
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
- * @version $Revision$
- */
-@MixinType(name = "gtn:decorated")
-public abstract class Decorated
-{
-
- @Property(name = "gtn:showinfobar", defaultValue = "false")
- public abstract boolean getShowInfoBar();
-
- public abstract void setShowInfoBar(boolean showInfoBar);
-
- @Property(name = "gtn:showmode", defaultValue = "false")
- public abstract boolean getShowMode();
-
- public abstract void setShowMode(boolean showMode);
-
- @Property(name = "gtn:showwindowstate", defaultValue = "false")
- public abstract boolean getShowWindowState();
-
- public abstract void setShowWindowState(boolean showWindowState);
-
- @Property(name = "gtn:theme")
- public abstract String getTheme();
-
- public abstract void setTheme(String theme);
-
-}
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/MappedAttributes.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/MappedAttributes.java 2010-03-10
21:12:29 UTC (rev 2128)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/MappedAttributes.java 2010-03-10
21:35:07 UTC (rev 2129)
@@ -75,4 +75,16 @@
/** . */
public static final Key<String> TYPE = Key.create("type",
ValueType.STRING);
+
+ /** . */
+ public static final Key<Boolean> SHOW_INFO_BAR =
Key.create("showinfobar", ValueType.BOOLEAN);
+
+ /** . */
+ public static final Key<Boolean> SHOW_MODE = Key.create("showmode",
ValueType.BOOLEAN);
+
+ /** . */
+ public static final Key<Boolean> SHOW_WINDOW_STATE =
Key.create("showwindowstate", ValueType.BOOLEAN);
+
+ /** . */
+ public static final Key<String> THEME = Key.create("theme",
ValueType.STRING);
}
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2010-03-10
21:12:29 UTC (rev 2128)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2010-03-10
21:35:07 UTC (rev 2129)
@@ -457,19 +457,12 @@
);
//
- boolean showInfoBar = false;
- boolean showMode = false;
- boolean showWindowState = false;
- String theme = null;
- if (srcContainer.isAdapted(Decorated.class))
- {
- Decorated decorated = srcContainer.adapt(Decorated.class);
- showInfoBar = decorated.getShowInfoBar();
- showMode = decorated.getShowMode();
- showWindowState = decorated.getShowInfoBar();
- theme = decorated.getTheme();
- }
+ boolean showInfoBar = attrs.getValue(MappedAttributes.SHOW_INFO_BAR,
false);
+ boolean showMode = attrs.getValue(MappedAttributes.SHOW_MODE, false);
+ boolean showWindowState =
attrs.getValue(MappedAttributes.SHOW_WINDOW_STATE, false);
+ String theme = attrs.getValue(MappedAttributes.THEME, null);
+ //
mo = new ApplicationData<Portlet>(
srcContainer.getObjectId(),
component.getName(),
@@ -679,11 +672,11 @@
{
UIContainer dstDashboard =
session.findObjectById(ObjectType.CONTAINER, app.getStorageId());
srcChild = loadDashboard(dstDashboard);
- Decorated decorated = dstDashboard.adapt(Decorated.class);
- decorated.setShowWindowState(app.isShowApplicationState());
- decorated.setShowInfoBar(app.isShowInfoBar());
- decorated.setShowMode(app.isShowApplicationMode());
- decorated.setTheme(app.getTheme());
+ Attributes attrs = dstDashboard.getAttributes();
+ attrs.setValue(MappedAttributes.SHOW_INFO_BAR,
app.isShowInfoBar());
+ attrs.setValue(MappedAttributes.SHOW_MODE,
app.isShowApplicationMode());
+ attrs.setValue(MappedAttributes.SHOW_WINDOW_STATE,
app.isShowApplicationState());
+ attrs.setValue(MappedAttributes.THEME, app.getTheme());
}
else
{
@@ -870,18 +863,10 @@
Described described = src.adapt(Described.class);
//
- boolean showInfoBar = false;
- boolean showWindowState = false;
- boolean showMode = false;
- String theme = null;
- if (src.isAdapted(Decorated.class))
- {
- Decorated decorated = src.adapt(Decorated.class);
- showInfoBar = decorated.getShowInfoBar();
- showWindowState = decorated.getShowWindowState();
- showMode = decorated.getShowMode();
- theme = decorated.getTheme();
- }
+ boolean showInfoBar = attrs.getValue(MappedAttributes.SHOW_INFO_BAR, false);
+ boolean showWindowState = attrs.getValue(MappedAttributes.SHOW_WINDOW_STATE,
false);
+ boolean showMode = attrs.getValue(MappedAttributes.SHOW_MODE, false);
+ String theme = attrs.getValue(MappedAttributes.THEME, null);
//
return new ApplicationData<S>(
@@ -914,14 +899,12 @@
described.setName(src.getTitle());
described.setDescription(src.getDescription());
- Decorated decorated = dst.adapt(Decorated.class);
- decorated.setShowInfoBar(src.isShowInfoBar());
- decorated.setShowMode(src.isShowApplicationMode());
- decorated.setShowWindowState(src.isShowApplicationState());
- decorated.setTheme(src.getTheme());
-
//
Attributes attrs = dst.getAttributes();
+ attrs.setValue(MappedAttributes.SHOW_INFO_BAR, src.isShowInfoBar());
+ attrs.setValue(MappedAttributes.SHOW_WINDOW_STATE, src.isShowApplicationState());
+ attrs.setValue(MappedAttributes.SHOW_MODE, src.isShowApplicationMode());
+ attrs.setValue(MappedAttributes.THEME, src.getTheme());
attrs.setValue(MappedAttributes.ICON, src.getIcon());
attrs.setValue(MappedAttributes.WIDTH, src.getWidth());
attrs.setValue(MappedAttributes.HEIGHT, src.getHeight());
Modified:
portal/trunk/component/portal/src/test/java/conf/exo.portal.component.portal-configuration1.xml
===================================================================
---
portal/trunk/component/portal/src/test/java/conf/exo.portal.component.portal-configuration1.xml 2010-03-10
21:12:29 UTC (rev 2128)
+++
portal/trunk/component/portal/src/test/java/conf/exo.portal.component.portal-configuration1.xml 2010-03-10
21:35:07 UTC (rev 2129)
@@ -180,7 +180,6 @@
<value>org.exoplatform.portal.pom.spi.wsrp.WSRPState</value>
<value>org.exoplatform.portal.mop.ProtectedResource</value>
<value>org.exoplatform.portal.mop.Described</value>
- <value>org.exoplatform.portal.mop.Decorated</value>
<value>org.exoplatform.portal.mop.Visible</value>
</values-param>
</init-params>
Modified:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java
===================================================================
---
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java 2010-03-10
21:12:29 UTC (rev 2128)
+++
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestSavedPOM.java 2010-03-10
21:35:07 UTC (rev 2129)
@@ -215,12 +215,11 @@
Described application1Described = application1.adapt(Described.class);
assertEquals("application_1_title", application1Described.getName());
assertEquals("application_1_description",
application1Described.getDescription());
- Decorated application1Decorated = application1.adapt(Decorated.class);
- assertEquals("application_1_theme", application1Decorated.getTheme());
- assertEquals(true, application1Decorated.getShowInfoBar());
- assertEquals(true, application1Decorated.getShowMode());
- assertEquals(true, application1Decorated.getShowWindowState());
Attributes application1Attrs = application1.getAttributes();
+ assertEquals("application_1_theme",
application1Attrs.getString("theme"));
+ assertEquals(true,
(boolean)application1Attrs.getBoolean("showinfobar"));
+ assertEquals(true, (boolean)application1Attrs.getBoolean("showmode"));
+ assertEquals(true,
(boolean)application1Attrs.getBoolean("showwindowstate"));
assertEquals("application_1_icon",
application1Attrs.getString("icon"));
assertEquals("application_1_width",
application1Attrs.getString("width"));
assertEquals("application_1_height",
application1Attrs.getString("height"));
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2010-03-10
21:12:29 UTC (rev 2128)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/portal-configuration.xml 2010-03-10
21:35:07 UTC (rev 2129)
@@ -253,7 +253,6 @@
<value>org.exoplatform.portal.pom.spi.wsrp.WSRPState</value>
<value>org.exoplatform.portal.mop.ProtectedResource</value>
<value>org.exoplatform.portal.mop.Described</value>
- <value>org.exoplatform.portal.mop.Decorated</value>
<value>org.exoplatform.portal.mop.Visible</value>
</values-param>
<properties-param>