gatein SVN: r2136 - portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-03-10 18:32:57 -0500 (Wed, 10 Mar 2010)
New Revision: 2136
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
Log:
GTNPORTAL-862: JBoss Cache table name too long for Oracle
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2010-03-10 23:02:24 UTC (rev 2135)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2010-03-10 23:32:57 UTC (rev 2136)
@@ -352,7 +352,7 @@
<property name="jgroups-multiplexer-stack" value="true"/>
<property name="jbosscache-cluster-namejbosscache-cluster-name"
value="jcrlock-${container.name.suffix}-system"/>
- <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlock_portlet_states_system"/>
+ <property name="jbosscache-cl-cache.jdbc.table.name" value="jcrlock_portlet_state_system"/>
<property name="jbosscache-cl-cache.jdbc.table.create" value="true"/>
<property name="jbosscache-cl-cache.jdbc.table.drop" value="false"/>
<property name="jbosscache-cl-cache.jdbc.table.primarykey" value="pk"/>
14 years, 9 months
gatein SVN: r2135 - portal/trunk.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-03-10 18:02:24 -0500 (Wed, 10 Mar 2010)
New Revision: 2135
Modified:
portal/trunk/pom.xml
Log:
Oupssss
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-03-10 22:41:50 UTC (rev 2134)
+++ portal/trunk/pom.xml 2010-03-10 23:02:24 UTC (rev 2135)
@@ -31,7 +31,7 @@
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.parent</artifactId>
- <version>3.0.0-GA</version>
+ <version>3.0.0-CR02-SNAPSHOT</version>
<packaging>pom</packaging>
<name>GateIn - Portal</name>
14 years, 9 months
gatein SVN: r2134 - components/wsrp/trunk.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-10 17:41:50 -0500 (Wed, 10 Mar 2010)
New Revision: 2134
Modified:
components/wsrp/trunk/pom.xml
Log:
- Updated dependencies.
Modified: components/wsrp/trunk/pom.xml
===================================================================
--- components/wsrp/trunk/pom.xml 2010-03-10 22:40:59 UTC (rev 2133)
+++ components/wsrp/trunk/pom.xml 2010-03-10 22:41:50 UTC (rev 2134)
@@ -47,9 +47,9 @@
</scm>
<properties>
- <version.gatein.pc>2.1.0-CR06-SNAPSHOT</version.gatein.pc>
+ <version.gatein.pc>2.1.0-GA</version.gatein.pc>
<version.gatein.common>2.0.0-GA</version.gatein.common>
- <version.gatein.wci>2.0.0-CR02</version.gatein.wci>
+ <version.gatein.wci>2.0.0-GA</version.gatein.wci>
<version.jsf>1.2_12</version.jsf>
<version.apache.commons-fileupload>1.2.1</version.apache.commons-fileupload>
14 years, 9 months
gatein SVN: r2133 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application.
by do-not-reply@jboss.org
Author: mwringe
Date: 2010-03-10 17:40:59 -0500 (Wed, 10 Mar 2010)
New Revision: 2133
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java
Log:
GTNPORTAL-863: there is some inconsistencies with how the portal code handles a non specified window state, until this is fixed we shouldn't be trying to simplify the url by removing the default window state.
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java 2010-03-10 22:19:31 UTC (rev 2132)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java 2010-03-10 22:40:59 UTC (rev 2133)
@@ -193,7 +193,7 @@
RenderURL renderURL = (RenderURL)containerURL;
WindowState windowState = renderURL.getWindowState();
- if (windowState != null && !windowState.equals(WindowState.NORMAL))
+ if (windowState != null)//&& !windowState.equals(WindowState.NORMAL))
{
appendParameter(baseURL, Constants.WINDOW_STATE_PARAMETER, windowState.toString());
}
14 years, 9 months
gatein SVN: r2132 - in components/wsrp/trunk: consumer/src/main/java/org/gatein/wsrp/consumer and 2 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-10 17:19:31 -0500 (Wed, 10 Mar 2010)
New Revision: 2132
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPUtils.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RenderHandler.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RenderHandlerTestCase.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPPortletInvocationContext.java
Log:
- Added WSRPResourceURL.createAbsoluteURLFrom method for better code reuse.
- Reverted resource handling to previous behavior of not generating an actual resource URL but creating a URL
that we might be able to work with (only works for static resources, of course).
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java 2010-03-10 22:11:47 UTC (rev 2131)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java 2010-03-10 22:19:31 UTC (rev 2132)
@@ -25,6 +25,7 @@
import org.gatein.common.net.URLTools;
import org.gatein.common.net.media.MediaType;
+import org.gatein.common.util.ParameterValidation;
import org.gatein.pc.api.Mode;
import org.gatein.pc.api.PortletContext;
import org.gatein.pc.api.ResourceURL;
@@ -55,10 +56,12 @@
private boolean requiresRewrite = false;
private URL resourceURL;
- private static final Map<String, MediaType> SUPPORTED_RESOURCE_TYPES = new HashMap<String, MediaType>(8);
+ private static final Map<String, MediaType> SUPPORTED_RESOURCE_TYPES = new HashMap<String, MediaType>(11);
static
{
+ SUPPORTED_RESOURCE_TYPES.put("html", MediaType.TEXT_HTML);
+ SUPPORTED_RESOURCE_TYPES.put("htm", MediaType.TEXT_HTML);
SUPPORTED_RESOURCE_TYPES.put("css", MediaType.TEXT_CSS);
SUPPORTED_RESOURCE_TYPES.put("js", MediaType.TEXT_JAVASCRIPT);
SUPPORTED_RESOURCE_TYPES.put("png", MediaType.create("image/png"));
@@ -203,19 +206,13 @@
*/
public void buildURLWith(HttpServletRequest request, PortletContext portletContext)
{
- String url = URLTools.getServerAddressFrom(request) + URLTools.SLASH + portletContext.getApplicationName();
-
- if (resourceId != null)
- {
- url += resourceId;
- }
-
+ String url = createAbsoluteURLFrom(resourceId, URLTools.getServerAddressFrom(request), portletContext.getApplicationName());
try
{
resourceURL = new URL(url);
String extension = URLTools.getFileExtensionOrNullFrom(resourceURL);
MediaType type = SUPPORTED_RESOURCE_TYPES.get(extension);
- if (MediaType.TEXT_CSS.equals(type) || MediaType.TEXT_JAVASCRIPT.equals(type))
+ if (MediaType.TEXT_CSS.equals(type) || MediaType.TEXT_JAVASCRIPT.equals(type) || MediaType.TEXT_HTML.equals(type))
{
requiresRewrite = true;
}
@@ -228,6 +225,31 @@
log.info("Attempted to build resource URL that could be accessed directly from consumer: " + resourceURL);
}
+ public static String createAbsoluteURLFrom(String initial, String serverAddress, String portletApplicationName)
+ {
+ String url = serverAddress;
+
+ if (portletApplicationName != null)
+ {
+ url += URLTools.SLASH + portletApplicationName;
+ }
+
+ if (!ParameterValidation.isNullOrEmpty(initial))
+ {
+ if (initial.startsWith(URLTools.SLASH))
+ {
+ url += initial;
+ }
+ else
+ {
+ url += URLTools.SLASH + initial;
+ }
+ }
+
+ return url;
+
+ }
+
/**
* @return
* @deprecated
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPUtils.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPUtils.java 2010-03-10 22:11:47 UTC (rev 2131)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPUtils.java 2010-03-10 22:19:31 UTC (rev 2132)
@@ -481,6 +481,24 @@
return localizedString;
}
+ public static String getAbsoluteURLFor(String url, boolean checkWSRPToken, String serverAddress)
+ {
+ // We don't encode URL through this API when it is a wsrp URL
+ if (checkWSRPToken && url.startsWith(WSRPRewritingConstants.BEGIN_WSRP_REWRITE))
+ {
+ return url;
+ }
+
+ if (!URLTools.isNetworkURL(url) && url.startsWith(URLTools.SLASH))
+ {
+ return serverAddress + url;
+ }
+ else
+ {
+ return url;
+ }
+ }
+
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
@@ -507,25 +525,7 @@
*/
public String getAbsoluteURLFor(String url)
{
- return getAbsoluteURLFor(url, true, serverAddress);
+ return WSRPUtils.getAbsoluteURLFor(url, true, serverAddress);
}
-
- public static String getAbsoluteURLFor(String url, boolean checkWSRPToken, String serverAddress)
- {
- // We don't encode URL through this API when it is a wsrp URL
- if (checkWSRPToken && url.startsWith(WSRPRewritingConstants.BEGIN_WSRP_REWRITE))
- {
- return url;
- }
-
- if (!URLTools.isNetworkURL(url) && url.startsWith(URLTools.SLASH))
- {
- return serverAddress + url;
- }
- else
- {
- return url;
- }
- }
}
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RenderHandler.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RenderHandler.java 2010-03-10 22:11:47 UTC (rev 2131)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RenderHandler.java 2010-03-10 22:19:31 UTC (rev 2132)
@@ -25,7 +25,6 @@
import org.gatein.common.net.URLTools;
import org.gatein.common.text.TextTools;
-import org.gatein.common.util.ParameterValidation;
import org.gatein.pc.api.PortletInvokerException;
import org.gatein.pc.api.URLFormat;
import org.gatein.pc.api.cache.CacheScope;
@@ -52,9 +51,8 @@
import org.oasis.wsrp.v1.UserContext;
import javax.xml.ws.Holder;
-import java.net.URI;
-import java.net.URL;
import java.util.List;
+import java.util.Set;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -195,9 +193,15 @@
URLFormat format = new URLFormat(invocation.getSecurityContext().isSecure(),
invocation.getSecurityContext().isAuthenticated(), true, true);
- // replace URL marked for rewriting by proper ones
- markup = TextTools.replaceBoundedString(markup, WSRPRewritingConstants.BEGIN_WSRP_REWRITE,
- WSRPRewritingConstants.END_WSRP_REWRITE, new ResourceURLStringReplacementGenerator(invocation.getContext(), format, consumer), true, false);
+ // replace URL marked for rewriting by proper ones
+ markup = TextTools.replaceBoundedString(
+ markup,
+ WSRPRewritingConstants.BEGIN_WSRP_REWRITE,
+ WSRPRewritingConstants.END_WSRP_REWRITE,
+ new ResourceURLStringReplacementGenerator(invocation.getContext(), format, consumer, invocation.getTarget()),
+ true,
+ false
+ );
}
return markup;
@@ -241,30 +245,44 @@
static class ResourceURLStringReplacementGenerator implements TextTools.StringReplacementGenerator
{
- private PortletInvocationContext context;
- private URLFormat format;
- private WSRPConsumer consumer;
+ private final PortletInvocationContext context;
+ private final URLFormat format;
+ private final Set<String> supportedCustomModes;
+ private final Set<String> supportedCustomWindowStates;
+ private final String serverAddress;
+ private final String portletApplicationName;
- private ResourceURLStringReplacementGenerator(PortletInvocationContext context, URLFormat format, WSRPConsumer consumer)
+ private ResourceURLStringReplacementGenerator(PortletInvocationContext context, URLFormat format, WSRPConsumer consumer, org.gatein.pc.api.PortletContext target)
{
this.context = context;
this.format = format;
- this.consumer = consumer;
+ ProducerInfo info = consumer.getProducerInfo();
+ supportedCustomModes = info.getSupportedCustomModes();
+ supportedCustomWindowStates = info.getSupportedCustomWindowStates();
+ serverAddress = info.getEndpointConfigurationInfo().getRemoteHostAddress();
+ portletApplicationName = target.getApplicationName();
}
public String getReplacementFor(String match)
{
- ProducerInfo info = consumer.getProducerInfo();
- WSRPPortletURL portletURL = WSRPPortletURL.create(match, info.getSupportedCustomModes(), info.getSupportedCustomWindowStates());
+
+ WSRPPortletURL portletURL = WSRPPortletURL.create(match, supportedCustomModes, supportedCustomWindowStates);
if (portletURL instanceof WSRPResourceURL)
{
- if (log.isDebugEnabled())
+ WSRPResourceURL resource = (WSRPResourceURL)portletURL;
+ String replacement = getResourceURL(match, resource);
+
+ // if the URL starts with /, prepend the remote host address and the portlet application name so that we
+ // can attempt to create a remotely available URL
+ if (replacement.startsWith(URLTools.SLASH))
{
- log.debug("URL '" + match + "' seems to refer to a resource which are not currently well supported.");
+ replacement = WSRPResourceURL.createAbsoluteURLFrom(replacement, serverAddress, portletApplicationName);
}
- WSRPResourceURL resource = (WSRPResourceURL)portletURL;
+ return replacement;
+ /*
+ todo: use this code to reactivate primitive use of resources
// get the parsed URL and add marker to it so that the consumer can know it needs to be intercepted
URL url = resource.getResourceURL();
String query = url.getQuery();
@@ -289,12 +307,20 @@
catch (Exception e)
{
throw new IllegalArgumentException("Cannot parse specified Resource as a URI: " + url);
- }
+ }*/
}
return context.renderURL(portletURL, format);
}
}
+ private static String getResourceURL(String urlAsString, WSRPResourceURL resource)
+ {
+ String resourceURL = resource.getResourceURL().toExternalForm();
+ log.info("URL '" + urlAsString + "' refers to a resource which are not currently well supported. " +
+ "Attempting to craft a URL that we might be able to work with: '" + resourceURL + "'");
+ // right now the resourceURL should be output as is, because it will be used directly but it really should be encoded
+ return resourceURL;
+ }
}
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RenderHandlerTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RenderHandlerTestCase.java 2010-03-10 22:11:47 UTC (rev 2131)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RenderHandlerTestCase.java 2010-03-10 22:19:31 UTC (rev 2132)
@@ -40,7 +40,7 @@
"&ns=_next%3D%2Fdk%2Fskat%2Fportal%2Ffront%2Fportlets%2Fexample%2Findex.jsp" +
"&is=_action%3D%252Fdk%252Fskat%252Fportal%252Ffront%252Fportlets%252Fexample%252FprocessLink" +
"%26jbpns_2fdefault_2fTest_2fEXAMPLE_2fEXAMPLEsnpbjname%3DChris\">Press to use default name.</a>";
- String result = URLTools.replaceURLsBy(markup, new RenderHandler.ResourceURLRewriter());
+ String result = URLTools.replaceURLsBy(markup, new RenderHandler.WSRPURLRewriter());
assertEquals(markup, result);*/
}
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPPortletInvocationContext.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPPortletInvocationContext.java 2010-03-10 22:11:47 UTC (rev 2131)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPPortletInvocationContext.java 2010-03-10 22:19:31 UTC (rev 2132)
@@ -94,8 +94,8 @@
{
if (url != null && !url.startsWith(WSRPRewritingConstants.BEGIN_WSRP_REWRITE))
{
- // make root relative URLs absolute. Optimization: we don't recheck the precense of the WSRP token.
- url = WSRPUtils.AbsoluteURLReplacementGenerator.getAbsoluteURLFor(url, false, URLTools.getServerAddressFrom(getClientRequest()));
+ // make root relative URLs absolute. Optimization: we don't recheck the presence of the WSRP token.
+ url = WSRPUtils.getAbsoluteURLFor(url, false, URLTools.getServerAddressFrom(getClientRequest()));
// properly encode the URL
url = URLTools.encodeXWWWFormURL(url);
14 years, 9 months
gatein SVN: r2131 - in portal/trunk: web/portal/src/main/webapp/WEB-INF/conf/organization and 1 other directories.
by do-not-reply@jboss.org
Author: bdaw
Date: 2010-03-10 17:11:47 -0500 (Wed, 10 Mar 2010)
New Revision: 2131
Modified:
portal/trunk/pom.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-cluster.xml
Log:
- use PicketLink IDM 1.1.1.GA
- uncomment cluster JBossCache configuration for IDM
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-03-10 21:39:05 UTC (rev 2130)
+++ portal/trunk/pom.xml 2010-03-10 22:11:47 UTC (rev 2131)
@@ -46,7 +46,7 @@
<org.gatein.common.version>2.0.0-GA</org.gatein.common.version>
<org.gatein.wci.version>2.0.0-GA</org.gatein.wci.version>
<org.gatein.pc.version>2.1.0-GA</org.gatein.pc.version>
- <org.picketlink.idm>1.1.0.GA</org.picketlink.idm>
+ <org.picketlink.idm>1.1.1.GA</org.picketlink.idm>
<org.gatein.wsrp.version>1.0.0-Beta09</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.0-CR03</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2010-03-10 21:39:05 UTC (rev 2130)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2010-03-10 22:11:47 UTC (rev 2131)
@@ -88,10 +88,10 @@
<value>war:/conf/organization/picketlink-idm/jboss-cache.xml</value>
</value-param>
- <!--<value-param profiles="cluster">
+ <value-param profiles="cluster">
<name>cacheConfig</name>
<value>war:/conf/organization/picketlink-idm/jboss-cache-cluster.xml</value>
- </value-param>-->
+ </value-param>
</init-params>
</component>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-cluster.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-cluster.xml 2010-03-10 21:39:05 UTC (rev 2130)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-cluster.xml 2010-03-10 22:11:47 UTC (rev 2131)
@@ -1,6 +1,6 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
- <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
+ <clustering mode="replication" clusterName="idm-cluster">
<stateRetrieval timeout="20000" fetchInMemoryState="false" />
<jgroupsConfig multiplexerStack="jcr.stack" />
<sync />
14 years, 9 months
gatein SVN: r2130 - in components/mop/trunk/core/src: main/java/org/gatein/mop/core/api/workspace and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-03-10 16:39:05 -0500 (Wed, 10 Mar 2010)
New Revision: 2130
Added:
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/Attribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/AttributesImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/BooleanAttribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/DateAttribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/IntegerAttribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/PathAttribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/StringAttribute.java
Removed:
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/Attribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/AttributesImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/BooleanAttribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/DateAttribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/IntegerAttribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PathAttribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/StringAttribute.java
Modified:
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/TemplatizedImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java
Log:
move attribute stuff to upper package in the impl
Copied: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/Attribute.java (from rev 2128, components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/Attribute.java)
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/Attribute.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/Attribute.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2010 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.gatein.mop.core.api;
+
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Property;
+import org.gatein.mop.api.Scope;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:attribute")
+public abstract class Attribute<T>
+{
+
+ public abstract T getValue();
+
+ public abstract void setValue(T value);
+
+ @Property(name = "mop:scope")
+ public abstract Scope getScope();
+
+ public abstract void setScope(Scope scope);
+
+}
Copied: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/AttributesImpl.java (from rev 2128, components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/AttributesImpl.java)
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/AttributesImpl.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/AttributesImpl.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2010 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.gatein.mop.core.api;
+
+import org.chromattic.api.NameConflictResolution;
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.FormattedBy;
+import org.chromattic.api.annotations.NamingPolicy;
+import org.chromattic.api.annotations.OneToMany;
+import org.chromattic.api.annotations.PrimaryType;
+import org.gatein.mop.core.api.MOPFormatter;
+import org.gatein.mop.core.util.AbstractAttributes;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:attributes")
+(a)FormattedBy(MOPFormatter.class)
+@NamingPolicy(onDuplicate = NameConflictResolution.REPLACE)
+public abstract class AttributesImpl extends AbstractAttributes
+{
+
+ @OneToMany
+ public abstract Map<String, Attribute> getChildren();
+
+ @Create
+ public abstract IntegerAttribute createInteger();
+
+ @Create
+ public abstract BooleanAttribute createBoolean();
+
+ @Create
+ public abstract DateAttribute createDate();
+
+ @Create
+ public abstract StringAttribute createString();
+
+ @Override
+ protected Object get(String name)
+ {
+ Map<String, Attribute> children = getChildren();
+ Attribute child = children.get(name);
+ return child != null ? child.getValue() : null;
+ }
+
+ @Override
+ protected void set(String name, Object o)
+ {
+ Map<String, Attribute> children = getChildren();
+ if (o != null)
+ {
+ if (o instanceof Integer)
+ {
+ IntegerAttribute i = createInteger();
+ children.put(name, i);
+ i.setValue((Integer)o);
+ }
+ else if (o instanceof Boolean)
+ {
+ BooleanAttribute b = createBoolean();
+ children.put(name, b);
+ b.setValue((Boolean)o);
+ }
+ else if (o instanceof Date)
+ {
+ DateAttribute d = createDate();
+ children.put(name, d);
+ d.setValue((Date)o);
+ }
+ else
+ {
+ StringAttribute s = createString();
+ children.put(name, s);
+ s.setValue((String)o);
+ }
+ }
+ else
+ {
+ children.remove(name);
+ }
+ }
+
+ public Set<String> getKeys()
+ {
+ Map<String, Attribute> children = getChildren();
+ return children.keySet();
+ }
+}
Copied: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/BooleanAttribute.java (from rev 2128, components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/BooleanAttribute.java)
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/BooleanAttribute.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/BooleanAttribute.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 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.gatein.mop.core.api;
+
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Property;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:booleanattribute")
+public abstract class BooleanAttribute extends Attribute<Boolean>
+{
+
+ @Property(name = "mop:value")
+ public abstract Boolean getValue();
+
+ public abstract void setValue(Boolean value);
+}
\ No newline at end of file
Copied: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/DateAttribute.java (from rev 2128, components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/DateAttribute.java)
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/DateAttribute.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/DateAttribute.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2010 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.gatein.mop.core.api;
+
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Property;
+
+import java.util.Date;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:dateattribute")
+public abstract class DateAttribute extends Attribute<Date>
+{
+
+ @Property(name = "mop:value")
+ public abstract Date getValue();
+
+ public abstract void setValue(Date value);
+}
\ No newline at end of file
Copied: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/IntegerAttribute.java (from rev 2128, components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/IntegerAttribute.java)
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/IntegerAttribute.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/IntegerAttribute.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 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.gatein.mop.core.api;
+
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Property;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:integerattribute")
+public abstract class IntegerAttribute extends Attribute<Integer>
+{
+
+ @Property(name = "mop:value")
+ public abstract Integer getValue();
+
+ public abstract void setValue(Integer value);
+}
\ No newline at end of file
Copied: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/PathAttribute.java (from rev 2128, components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PathAttribute.java)
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/PathAttribute.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/PathAttribute.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010 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.gatein.mop.core.api;
+
+import org.chromattic.api.RelationshipType;
+import org.chromattic.api.annotations.ManyToOne;
+import org.chromattic.api.annotations.MappedBy;
+import org.chromattic.api.annotations.PrimaryType;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:pathattribute")
+public abstract class PathAttribute extends Attribute<Object>
+{
+
+ @ManyToOne(type = RelationshipType.PATH)
+ @MappedBy("mop:value")
+ public abstract Object getValue();
+
+ public abstract void setValue(Object value);
+
+}
Copied: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/StringAttribute.java (from rev 2128, components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/StringAttribute.java)
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/StringAttribute.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/StringAttribute.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 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.gatein.mop.core.api;
+
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Property;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:stringattribute")
+public abstract class StringAttribute extends Attribute<String>
+{
+
+ @Property(name = "mop:value")
+ public abstract String getValue();
+
+ public abstract void setValue(String value);
+}
Deleted: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/Attribute.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/Attribute.java 2010-03-10 21:35:07 UTC (rev 2129)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/Attribute.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2010 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.gatein.mop.core.api.workspace;
-
-import org.chromattic.api.annotations.PrimaryType;
-import org.chromattic.api.annotations.Property;
-import org.gatein.mop.api.Scope;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-@PrimaryType(name = "mop:attribute")
-public abstract class Attribute<T>
-{
-
- public abstract T getValue();
-
- public abstract void setValue(T value);
-
- @Property(name = "mop:scope")
- public abstract Scope getScope();
-
- public abstract void setScope(Scope scope);
-
-}
Deleted: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/AttributesImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/AttributesImpl.java 2010-03-10 21:35:07 UTC (rev 2129)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/AttributesImpl.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2010 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.gatein.mop.core.api.workspace;
-
-import org.chromattic.api.NameConflictResolution;
-import org.chromattic.api.annotations.Create;
-import org.chromattic.api.annotations.FormattedBy;
-import org.chromattic.api.annotations.NamingPolicy;
-import org.chromattic.api.annotations.OneToMany;
-import org.chromattic.api.annotations.PrimaryType;
-import org.gatein.mop.core.api.MOPFormatter;
-import org.gatein.mop.core.util.AbstractAttributes;
-
-import java.util.Date;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-@PrimaryType(name = "mop:attributes")
-(a)FormattedBy(MOPFormatter.class)
-@NamingPolicy(onDuplicate = NameConflictResolution.REPLACE)
-public abstract class AttributesImpl extends AbstractAttributes
-{
-
- @OneToMany
- public abstract Map<String, Attribute> getChildren();
-
- @Create
- public abstract IntegerAttribute createInteger();
-
- @Create
- public abstract BooleanAttribute createBoolean();
-
- @Create
- public abstract DateAttribute createDate();
-
- @Create
- public abstract StringAttribute createString();
-
- @Override
- protected Object get(String name)
- {
- Map<String, Attribute> children = getChildren();
- Attribute child = children.get(name);
- return child != null ? child.getValue() : null;
- }
-
- @Override
- protected void set(String name, Object o)
- {
- Map<String, Attribute> children = getChildren();
- if (o != null)
- {
- if (o instanceof Integer)
- {
- IntegerAttribute i = createInteger();
- children.put(name, i);
- i.setValue((Integer)o);
- }
- else if (o instanceof Boolean)
- {
- BooleanAttribute b = createBoolean();
- children.put(name, b);
- b.setValue((Boolean)o);
- }
- else if (o instanceof Date)
- {
- DateAttribute d = createDate();
- children.put(name, d);
- d.setValue((Date)o);
- }
- else
- {
- StringAttribute s = createString();
- children.put(name, s);
- s.setValue((String)o);
- }
- }
- else
- {
- children.remove(name);
- }
- }
-
- public Set<String> getKeys()
- {
- Map<String, Attribute> children = getChildren();
- return children.keySet();
- }
-}
Deleted: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/BooleanAttribute.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/BooleanAttribute.java 2010-03-10 21:35:07 UTC (rev 2129)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/BooleanAttribute.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2010 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.gatein.mop.core.api.workspace;
-
-import org.chromattic.api.annotations.PrimaryType;
-import org.chromattic.api.annotations.Property;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-@PrimaryType(name = "mop:booleanattribute")
-public abstract class BooleanAttribute extends Attribute<Boolean>
-{
-
- @Property(name = "mop:value")
- public abstract Boolean getValue();
-
- public abstract void setValue(Boolean value);
-}
\ No newline at end of file
Deleted: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/DateAttribute.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/DateAttribute.java 2010-03-10 21:35:07 UTC (rev 2129)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/DateAttribute.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2010 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.gatein.mop.core.api.workspace;
-
-import org.chromattic.api.annotations.PrimaryType;
-import org.chromattic.api.annotations.Property;
-
-import java.util.Date;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-@PrimaryType(name = "mop:dateattribute")
-public abstract class DateAttribute extends Attribute<Date>
-{
-
- @Property(name = "mop:value")
- public abstract Date getValue();
-
- public abstract void setValue(Date value);
-}
\ No newline at end of file
Deleted: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/IntegerAttribute.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/IntegerAttribute.java 2010-03-10 21:35:07 UTC (rev 2129)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/IntegerAttribute.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2010 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.gatein.mop.core.api.workspace;
-
-import org.chromattic.api.annotations.PrimaryType;
-import org.chromattic.api.annotations.Property;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-@PrimaryType(name = "mop:integerattribute")
-public abstract class IntegerAttribute extends Attribute<Integer>
-{
-
- @Property(name = "mop:value")
- public abstract Integer getValue();
-
- public abstract void setValue(Integer value);
-}
\ No newline at end of file
Deleted: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PathAttribute.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PathAttribute.java 2010-03-10 21:35:07 UTC (rev 2129)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PathAttribute.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2010 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.gatein.mop.core.api.workspace;
-
-import org.chromattic.api.RelationshipType;
-import org.chromattic.api.annotations.ManyToOne;
-import org.chromattic.api.annotations.MappedBy;
-import org.chromattic.api.annotations.PrimaryType;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-@PrimaryType(name = "mop:pathattribute")
-public abstract class PathAttribute extends Attribute<Object>
-{
-
- @ManyToOne(type = RelationshipType.PATH)
- @MappedBy("mop:value")
- public abstract Object getValue();
-
- public abstract void setValue(Object value);
-
-}
Deleted: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/StringAttribute.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/StringAttribute.java 2010-03-10 21:35:07 UTC (rev 2129)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/StringAttribute.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2010 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.gatein.mop.core.api.workspace;
-
-import org.chromattic.api.annotations.PrimaryType;
-import org.chromattic.api.annotations.Property;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-@PrimaryType(name = "mop:stringattribute")
-public abstract class StringAttribute extends Attribute<String>
-{
-
- @Property(name = "mop:value")
- public abstract String getValue();
-
- public abstract void setValue(String value);
-}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/TemplatizedImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/TemplatizedImpl.java 2010-03-10 21:35:07 UTC (rev 2129)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/TemplatizedImpl.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -25,6 +25,7 @@
import org.gatein.mop.api.Scope;
import org.gatein.mop.api.workspace.Page;
import org.gatein.mop.api.workspace.Templatized;
+import org.gatein.mop.core.api.PathAttribute;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java 2010-03-10 21:35:07 UTC (rev 2129)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -22,6 +22,7 @@
import org.gatein.mop.api.workspace.WorkspaceObject;
import org.gatein.mop.api.workspace.ObjectType;
import org.gatein.mop.api.content.CustomizationContext;
+import org.gatein.mop.core.api.AttributesImpl;
import org.gatein.mop.core.api.MOPFormatter;
import org.gatein.mop.core.api.ModelImpl;
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java 2010-03-10 21:35:07 UTC (rev 2129)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java 2010-03-10 21:39:05 UTC (rev 2130)
@@ -20,25 +20,25 @@
import org.chromattic.api.Chromattic;
import org.chromattic.api.ChromatticBuilder;
+import org.gatein.mop.core.api.Attribute;
+import org.gatein.mop.core.api.AttributesImpl;
import org.gatein.mop.core.api.MOPService;
+import org.gatein.mop.core.api.PathAttribute;
import org.gatein.mop.core.api.content.ContentManagerRegistry;
-import org.gatein.mop.core.api.workspace.Attribute;
-import org.gatein.mop.core.api.workspace.AttributesImpl;
-import org.gatein.mop.core.api.workspace.BooleanAttribute;
-import org.gatein.mop.core.api.workspace.DateAttribute;
+import org.gatein.mop.core.api.BooleanAttribute;
+import org.gatein.mop.core.api.DateAttribute;
import org.gatein.mop.core.api.workspace.GroupSite;
import org.gatein.mop.core.api.workspace.GroupSiteContainer;
-import org.gatein.mop.core.api.workspace.IntegerAttribute;
+import org.gatein.mop.core.api.IntegerAttribute;
import org.gatein.mop.core.api.workspace.NavigationContainer;
import org.gatein.mop.core.api.workspace.NavigationImpl;
import org.gatein.mop.core.api.workspace.PageContainer;
import org.gatein.mop.core.api.workspace.PageImpl;
import org.gatein.mop.core.api.workspace.PageLinkImpl;
-import org.gatein.mop.core.api.workspace.PathAttribute;
import org.gatein.mop.core.api.workspace.PortalSite;
import org.gatein.mop.core.api.workspace.PortalSiteContainer;
import org.gatein.mop.core.api.workspace.SecuredImpl;
-import org.gatein.mop.core.api.workspace.StringAttribute;
+import org.gatein.mop.core.api.StringAttribute;
import org.gatein.mop.core.api.workspace.TemplatizedImpl;
import org.gatein.mop.core.api.workspace.UIBodyImpl;
import org.gatein.mop.core.api.workspace.UIContainerImpl;
14 years, 9 months
gatein SVN: r2129 - in portal/trunk: component/portal/src/main/java/org/exoplatform/portal/mop and 4 other directories.
by do-not-reply@jboss.org
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>
14 years, 9 months
gatein SVN: r2128 - in components/mop/trunk: core/src/main/java/org/gatein/mop/core/api/workspace and 3 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-03-10 16:12:29 -0500 (Wed, 10 Mar 2010)
New Revision: 2128
Added:
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/Attribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/AttributesImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/BooleanAttribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/DateAttribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/IntegerAttribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PathAttribute.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/StringAttribute.java
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Page.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/TemplatizedImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java
components/mop/trunk/core/src/main/resources/conf/mop-nodetypes.xml
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AttributesTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/POMTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java
Log:
actually improve how attribute must be defined and remove cascadoing of page attributes as anyway pages are not yet hierarchic in mop
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Page.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Page.java 2010-03-10 21:08:02 UTC (rev 2127)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Page.java 2010-03-10 21:12:29 UTC (rev 2128)
@@ -50,13 +50,6 @@
ObjectType<? extends Page> getObjectType();
/**
- * Returns the page attributes.
- *
- * @return the attributes
- */
- Attributes getCascadingAttributes();
-
- /**
* Returns the site that owns the page.
*
* @return the owner site
@@ -116,15 +109,6 @@
void destroy();
/**
- * Returns the templatized objects for this page.
- *
- * @param type the type of templatized
- * @param <T> the templatized workspace object type parameter
- * @return the collection of templatized objects
- */
- <T extends WorkspaceObject> Collection<? extends T> getTemplatizedObjects(ObjectType<T> type);
-
- /**
* Templatize the provided object.
*
* @param object the object to templatize
Added: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/Attribute.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/Attribute.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/Attribute.java 2010-03-10 21:12:29 UTC (rev 2128)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2010 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.gatein.mop.core.api.workspace;
+
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Property;
+import org.gatein.mop.api.Scope;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:attribute")
+public abstract class Attribute<T>
+{
+
+ public abstract T getValue();
+
+ public abstract void setValue(T value);
+
+ @Property(name = "mop:scope")
+ public abstract Scope getScope();
+
+ public abstract void setScope(Scope scope);
+
+}
Added: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/AttributesImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/AttributesImpl.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/AttributesImpl.java 2010-03-10 21:12:29 UTC (rev 2128)
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2010 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.gatein.mop.core.api.workspace;
+
+import org.chromattic.api.NameConflictResolution;
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.FormattedBy;
+import org.chromattic.api.annotations.NamingPolicy;
+import org.chromattic.api.annotations.OneToMany;
+import org.chromattic.api.annotations.PrimaryType;
+import org.gatein.mop.core.api.MOPFormatter;
+import org.gatein.mop.core.util.AbstractAttributes;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:attributes")
+(a)FormattedBy(MOPFormatter.class)
+@NamingPolicy(onDuplicate = NameConflictResolution.REPLACE)
+public abstract class AttributesImpl extends AbstractAttributes
+{
+
+ @OneToMany
+ public abstract Map<String, Attribute> getChildren();
+
+ @Create
+ public abstract IntegerAttribute createInteger();
+
+ @Create
+ public abstract BooleanAttribute createBoolean();
+
+ @Create
+ public abstract DateAttribute createDate();
+
+ @Create
+ public abstract StringAttribute createString();
+
+ @Override
+ protected Object get(String name)
+ {
+ Map<String, Attribute> children = getChildren();
+ Attribute child = children.get(name);
+ return child != null ? child.getValue() : null;
+ }
+
+ @Override
+ protected void set(String name, Object o)
+ {
+ Map<String, Attribute> children = getChildren();
+ if (o != null)
+ {
+ if (o instanceof Integer)
+ {
+ IntegerAttribute i = createInteger();
+ children.put(name, i);
+ i.setValue((Integer)o);
+ }
+ else if (o instanceof Boolean)
+ {
+ BooleanAttribute b = createBoolean();
+ children.put(name, b);
+ b.setValue((Boolean)o);
+ }
+ else if (o instanceof Date)
+ {
+ DateAttribute d = createDate();
+ children.put(name, d);
+ d.setValue((Date)o);
+ }
+ else
+ {
+ StringAttribute s = createString();
+ children.put(name, s);
+ s.setValue((String)o);
+ }
+ }
+ else
+ {
+ children.remove(name);
+ }
+ }
+
+ public Set<String> getKeys()
+ {
+ Map<String, Attribute> children = getChildren();
+ return children.keySet();
+ }
+}
Added: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/BooleanAttribute.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/BooleanAttribute.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/BooleanAttribute.java 2010-03-10 21:12:29 UTC (rev 2128)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 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.gatein.mop.core.api.workspace;
+
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Property;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:booleanattribute")
+public abstract class BooleanAttribute extends Attribute<Boolean>
+{
+
+ @Property(name = "mop:value")
+ public abstract Boolean getValue();
+
+ public abstract void setValue(Boolean value);
+}
\ No newline at end of file
Added: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/DateAttribute.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/DateAttribute.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/DateAttribute.java 2010-03-10 21:12:29 UTC (rev 2128)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2010 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.gatein.mop.core.api.workspace;
+
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Property;
+
+import java.util.Date;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:dateattribute")
+public abstract class DateAttribute extends Attribute<Date>
+{
+
+ @Property(name = "mop:value")
+ public abstract Date getValue();
+
+ public abstract void setValue(Date value);
+}
\ No newline at end of file
Added: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/IntegerAttribute.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/IntegerAttribute.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/IntegerAttribute.java 2010-03-10 21:12:29 UTC (rev 2128)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 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.gatein.mop.core.api.workspace;
+
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Property;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:integerattribute")
+public abstract class IntegerAttribute extends Attribute<Integer>
+{
+
+ @Property(name = "mop:value")
+ public abstract Integer getValue();
+
+ public abstract void setValue(Integer value);
+}
\ No newline at end of file
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageImpl.java 2010-03-10 21:08:02 UTC (rev 2127)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageImpl.java 2010-03-10 21:12:29 UTC (rev 2128)
@@ -28,16 +28,11 @@
import org.chromattic.api.RelationshipType;
import org.gatein.mop.api.workspace.Page;
import org.gatein.mop.api.workspace.ObjectType;
-import org.gatein.mop.api.workspace.Navigation;
import org.gatein.mop.api.workspace.Templatized;
import org.gatein.mop.api.workspace.WorkspaceObject;
import org.gatein.mop.api.workspace.link.PageLink;
-import org.gatein.mop.api.Attributes;
-import org.gatein.mop.core.util.AbstractAttributes;
import java.util.Collection;
-import java.util.ArrayList;
-import java.util.Set;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -47,25 +42,6 @@
public abstract class PageImpl extends WorkspaceObjectImpl implements Page
{
- /** . */
- private final Attributes cascadingAttributes = new AbstractAttributes()
- {
- public Set<String> getKeys()
- {
- throw new UnsupportedOperationException("todo ?");
- }
-
- protected Object get(String name)
- {
- return getCascadedPropertyValue(name);
- }
-
- protected void set(String name, Object o)
- {
- throw new UnsupportedOperationException("read only");
- }
- };
-
@OneToMany(type = RelationshipType.PATH)
@RelatedMappedBy("mop:template")
public abstract Collection<NavigationImpl> getTemplatizedNavigations();
@@ -127,42 +103,11 @@
return templatized;
}
- public <T extends WorkspaceObject> Collection<? extends T> getTemplatizedObjects(ObjectType<T> type)
- {
- if (Page.class.equals(type.getJavaType()))
- {
- ArrayList bilto = new ArrayList();
- for (Page page : getTemplatizedPages())
- {
- bilto.add(page);
- }
- return bilto;
- }
- else if (Navigation.class.isAssignableFrom(type.getJavaType()))
- {
- ArrayList bilto = new ArrayList();
- for (Navigation page : getTemplatizedNavigations())
- {
- bilto.add(page);
- }
- return bilto;
- }
- else
- {
- throw new IllegalArgumentException("Unaccepted templatized type");
- }
- }
-
public ObjectType<? extends Page> getObjectType()
{
return ObjectType.PAGE;
}
- public Attributes getCascadingAttributes()
- {
- return cascadingAttributes;
- }
-
public SiteImpl getSite()
{
PageContainer parent = getParentContainer();
@@ -215,19 +160,4 @@
{
throw new UnsupportedOperationException();
}
-
- private Object getCascadedPropertyValue(String propertyName)
- {
- Attributes attributes = getAttributes();
- Object value = attributes.getObject(propertyName);
- if (value == null)
- {
- PageImpl parent = getParent();
- if (parent != null)
- {
- value = parent.getCascadedPropertyValue(propertyName);
- }
- }
- return value;
- }
}
Added: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PathAttribute.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PathAttribute.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PathAttribute.java 2010-03-10 21:12:29 UTC (rev 2128)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2010 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.gatein.mop.core.api.workspace;
+
+import org.chromattic.api.RelationshipType;
+import org.chromattic.api.annotations.ManyToOne;
+import org.chromattic.api.annotations.MappedBy;
+import org.chromattic.api.annotations.PrimaryType;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:pathattribute")
+public abstract class PathAttribute extends Attribute<Object>
+{
+
+ @ManyToOne(type = RelationshipType.PATH)
+ @MappedBy("mop:value")
+ public abstract Object getValue();
+
+ public abstract void setValue(Object value);
+
+}
Added: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/StringAttribute.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/StringAttribute.java (rev 0)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/StringAttribute.java 2010-03-10 21:12:29 UTC (rev 2128)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 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.gatein.mop.core.api.workspace;
+
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Property;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = "mop:stringattribute")
+public abstract class StringAttribute extends Attribute<String>
+{
+
+ @Property(name = "mop:value")
+ public abstract String getValue();
+
+ public abstract void setValue(String value);
+}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/TemplatizedImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/TemplatizedImpl.java 2010-03-10 21:08:02 UTC (rev 2127)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/TemplatizedImpl.java 2010-03-10 21:12:29 UTC (rev 2128)
@@ -19,11 +19,9 @@
package org.gatein.mop.core.api.workspace;
-import org.chromattic.api.RelationshipType;
-import org.chromattic.api.annotations.ManyToOne;
import org.chromattic.api.annotations.MappedBy;
import org.chromattic.api.annotations.MixinType;
-import org.chromattic.api.annotations.Property;
+import org.chromattic.api.annotations.OneToOne;
import org.gatein.mop.api.Scope;
import org.gatein.mop.api.workspace.Page;
import org.gatein.mop.api.workspace.Templatized;
@@ -36,24 +34,27 @@
public abstract class TemplatizedImpl implements Templatized
{
- @ManyToOne(type = RelationshipType.PATH)
+ @OneToOne
@MappedBy("mop:template")
- public abstract PageImpl getPageTemplate();
+ public abstract PathAttribute getRelatedTemplate();
- public abstract void setPageTemplate(PageImpl template);
-
public void setTemplate(Page template)
{
- setPageTemplate((PageImpl)template);
+ getRelatedTemplate().setValue(template);
}
public Page getTemplate()
{
- return getPageTemplate();
+ return (Page)getRelatedTemplate().getValue();
}
- @Property(name = "mop:templatescope")
- public abstract Scope getScope();
+ public Scope getScope()
+ {
+ return getRelatedTemplate().getScope();
+ }
- public abstract void setScope(Scope scope);
+ public void setScope(Scope scope)
+ {
+ getRelatedTemplate().setScope(scope);
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java 2010-03-10 21:08:02 UTC (rev 2127)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java 2010-03-10 21:12:29 UTC (rev 2128)
@@ -19,20 +19,12 @@
package org.gatein.mop.core.api.workspace;
import org.chromattic.api.annotations.*;
-import org.chromattic.common.collection.AbstractFilterIterator;
import org.gatein.mop.api.workspace.WorkspaceObject;
import org.gatein.mop.api.workspace.ObjectType;
-import org.gatein.mop.api.Attributes;
import org.gatein.mop.api.content.CustomizationContext;
import org.gatein.mop.core.api.MOPFormatter;
import org.gatein.mop.core.api.ModelImpl;
-import org.gatein.mop.core.util.AbstractAttributes;
-import java.util.Map;
-import java.util.Set;
-import java.util.AbstractSet;
-import java.util.Iterator;
-
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
@@ -45,72 +37,6 @@
/** . */
public ModelImpl model;
- /** . */
- private final Set<String> keys = new AbstractSet<String>()
- {
- @Override
- public Iterator<String> iterator()
- {
- Map<String, Object> properties = getProperties();
- return new AbstractFilterIterator<String, String>(properties.keySet().iterator())
- {
- protected String adapt(String internal)
- {
- if (internal.startsWith("mop:"))
- {
- return internal.substring(4);
- }
- else
- {
- return null;
- }
- }
- };
- }
-
- public int size()
- {
- Map<String, Object> properties = getProperties();
- int count = 0;
- for (String key : properties.keySet())
- {
- if (key.startsWith("mop:"))
- {
- count++;
- }
- }
- return count;
- }
- };
-
- /** . */
- private final AbstractAttributes attributes = new AbstractAttributes()
- {
- @Override
- protected Object get(String name)
- {
- Map<String, Object> properties = getProperties();
- return properties.get("mop:" + name);
- }
-
- @Override
- protected void set(String name, Object o)
- {
- Map<String, Object> properties = getProperties();
- properties.put("mop:" + name, o);
- }
-
- public Set<String> getKeys()
- {
- return keys;
- }
- };
-
- public Attributes getAttributes()
- {
- return attributes;
- }
-
@Name
public abstract String getName();
@@ -119,8 +45,9 @@
@Id
public abstract String getObjectId();
- @Properties
- public abstract Map<String, Object> getProperties();
+ @OneToOne
+ @MappedBy("mop:attributes")
+ public abstract AttributesImpl getAttributes();
public <A> A adapt(Class<A> adaptedType)
{
Modified: components/mop/trunk/core/src/main/resources/conf/mop-nodetypes.xml
===================================================================
--- components/mop/trunk/core/src/main/resources/conf/mop-nodetypes.xml 2010-03-10 21:08:02 UTC (rev 2127)
+++ components/mop/trunk/core/src/main/resources/conf/mop-nodetypes.xml 2010-03-10 21:12:29 UTC (rev 2128)
@@ -20,6 +20,90 @@
-->
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
+ <nodeType name="mop:attributes" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:stringattribute" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:attribute</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:attribute" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="mop:scope" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:pathattribute" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:attribute</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="mop:value" requiredType="Path" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:stringattribute" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:attribute</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="mop:value" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:booleanattribute" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:attribute</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="mop:value" requiredType="Boolean" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:integerattribute" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:attribute</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="mop:value" requiredType="Long" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:dateattribute" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:attribute</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="mop:value" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <!-- -->
+
<nodeType name="mop:customizationstate" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
<supertypes>
<supertype>nt:base</supertype>
@@ -154,12 +238,14 @@
<supertype>nt:base</supertype>
<supertype>mix:referenceable</supertype>
</supertypes>
- <propertyDefinitions>
- <propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY"
- protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="mop:attributes" defaultPrimaryType="mop:attributes" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:attributes</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
</nodeType>
<nodeType name="mop:uicomponent" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
@@ -203,14 +289,14 @@
</nodeType>
<nodeType name="mop:templatized" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
- <propertyDefinitions>
- <propertyDefinition name="mop:template" requiredType="Path" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="mop:templatescope" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="mop:template" defaultPrimaryType="mop:pathattribute" autoCreated="true" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:pathattribute</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
</nodeType>
<nodeType name="mop:navigation" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AttributesTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AttributesTestCase.java 2010-03-10 21:08:02 UTC (rev 2127)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AttributesTestCase.java 2010-03-10 21:12:29 UTC (rev 2128)
@@ -25,6 +25,8 @@
import org.gatein.mop.api.workspace.Page;
import org.gatein.mop.api.Attributes;
+import java.util.Date;
+
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
@@ -42,8 +44,26 @@
Attributes pageAttributes = portal.getRootPage().getAttributes();
pageAttributes.setString("foo", "bar");
assertEquals("bar", pageAttributes.getString("foo"));
+
+ // Overwrite
+ pageAttributes.setString("foo", "bar2");
+ assertEquals("bar2", pageAttributes.getString("foo"));
}
+ public void testTypes()
+ {
+ ModelImpl model = pomService.getModel();
+ Site portal = model.getWorkspace().addSite(ObjectType.PORTAL_SITE, "portal");
+ Attributes portalAttributes = portal.getAttributes();
+ portalAttributes.setInteger("integer", 4);
+ assertEquals(4, portalAttributes.getObject("integer"));
+ Date d = new Date();
+ portalAttributes.setDate("date", d);
+ assertEquals(d, portalAttributes.getObject("date"));
+ portalAttributes.setBoolean("boolean", true);
+ assertEquals(true, portalAttributes.getObject("boolean"));
+ }
+
public void testCascadedAttributes()
{
ModelImpl model = pomService.getModel();
@@ -56,9 +76,5 @@
aAttrs.setString("bar", "bar_a");
rootAttrs.setString("juu", "juu_root");
aAttrs.setString("juu", "juu_a");
- Attributes combinedAttrs = a.getCascadingAttributes();
- assertEquals("foo_root", combinedAttrs.getString("foo"));
- assertEquals("bar_a", combinedAttrs.getString("bar"));
- assertEquals("juu_a", combinedAttrs.getString("juu"));
}
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/POMTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/POMTestCase.java 2010-03-10 21:08:02 UTC (rev 2127)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/POMTestCase.java 2010-03-10 21:12:29 UTC (rev 2128)
@@ -104,9 +104,11 @@
// Try something with template relationships
+/*
Collection<? extends Navigation> templatizedNavigations = template.getTemplatizedObjects(ObjectType.NAVIGATION);
assertNotNull(templatizedNavigations);
assertEquals(1, templatizedNavigations.size());
+*/
/*
Collection<Templatized> templatizedObjects = template.getTemplatizedObjects(Templatized.class);
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java 2010-03-10 21:08:02 UTC (rev 2127)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java 2010-03-10 21:12:29 UTC (rev 2128)
@@ -22,16 +22,23 @@
import org.chromattic.api.ChromatticBuilder;
import org.gatein.mop.core.api.MOPService;
import org.gatein.mop.core.api.content.ContentManagerRegistry;
+import org.gatein.mop.core.api.workspace.Attribute;
+import org.gatein.mop.core.api.workspace.AttributesImpl;
+import org.gatein.mop.core.api.workspace.BooleanAttribute;
+import org.gatein.mop.core.api.workspace.DateAttribute;
import org.gatein.mop.core.api.workspace.GroupSite;
import org.gatein.mop.core.api.workspace.GroupSiteContainer;
+import org.gatein.mop.core.api.workspace.IntegerAttribute;
import org.gatein.mop.core.api.workspace.NavigationContainer;
import org.gatein.mop.core.api.workspace.NavigationImpl;
import org.gatein.mop.core.api.workspace.PageContainer;
import org.gatein.mop.core.api.workspace.PageImpl;
import org.gatein.mop.core.api.workspace.PageLinkImpl;
+import org.gatein.mop.core.api.workspace.PathAttribute;
import org.gatein.mop.core.api.workspace.PortalSite;
import org.gatein.mop.core.api.workspace.PortalSiteContainer;
import org.gatein.mop.core.api.workspace.SecuredImpl;
+import org.gatein.mop.core.api.workspace.StringAttribute;
import org.gatein.mop.core.api.workspace.TemplatizedImpl;
import org.gatein.mop.core.api.workspace.UIBodyImpl;
import org.gatein.mop.core.api.workspace.UIContainerImpl;
@@ -97,6 +104,15 @@
builder.add(TemplatizedImpl.class);
//
+ builder.add(AttributesImpl.class);
+ builder.add(Attribute.class);
+ builder.add(PathAttribute.class);
+ builder.add(StringAttribute.class);
+ builder.add(BooleanAttribute.class);
+ builder.add(IntegerAttribute.class);
+ builder.add(DateAttribute.class);
+
+ //
builder.add(CustomizationContainer.class);
builder.add(ContextTypeContainer.class);
builder.add(ContextType.class);
14 years, 9 months
gatein SVN: r2127 - components/mop/trunk.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-03-10 16:08:02 -0500 (Wed, 10 Mar 2010)
New Revision: 2127
Modified:
components/mop/trunk/pom.xml
Log:
Updating dependencies
Modified: components/mop/trunk/pom.xml
===================================================================
--- components/mop/trunk/pom.xml 2010-03-10 20:59:22 UTC (rev 2126)
+++ components/mop/trunk/pom.xml 2010-03-10 21:08:02 UTC (rev 2127)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.gatein</groupId>
<artifactId>gatein-parent</artifactId>
- <version>1.0.0-Beta04</version>
+ <version>1.0.0-GA</version>
</parent>
<!-- ****************** -->
@@ -53,7 +53,7 @@
<dependency>
<groupId>org.gatein</groupId>
<artifactId>gatein-dep</artifactId>
- <version>1.0.0-Beta03</version>
+ <version>1.0.0-GA</version>
<type>pom</type>
<scope>import</scope>
</dependency>
14 years, 9 months