gatein SVN: r579 - in components/wsrp/trunk: consumer/src and 18 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-11-12 07:42:15 -0500 (Thu, 12 Nov 2009)
New Revision: 579
Added:
components/wsrp/trunk/consumer/src/test/
components/wsrp/trunk/consumer/src/test/java/
components/wsrp/trunk/consumer/src/test/java/org/
components/wsrp/trunk/consumer/src/test/java/org/gatein/
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ConsumerRegistryTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/EndpointConfigurationInfoTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerSessionInformationTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationInfoTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationPropertyTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RenderHandlerTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/WSRPConsumerBaseTest.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/handler/
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/handler/RequestHeaderClientHandlerTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/InteropServiceDescriptionTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/PortletManagementTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/ServiceDescriptionTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/V1ConsumerBaseTest.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/BehaviorRegistry.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducer.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducerImpl.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/MarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/PortletManagementBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/RegistrationBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/ServiceDescriptionBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/TestProducerBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicPortletManagementBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicServiceDescriptionBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/DestroyClonesPortletManagementBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/EmptyMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/GroupedPortletsServiceDescriptionBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieNotRequiredMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/NullMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/PerGroupInitCookieMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/PerUserInitCookieMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/ResourceMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/SessionMarkupBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/interop/
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/interop/LiferayServiceDescriptionBehavior.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/BehaviorBackedServiceFactory.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockConsumerRegistry.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpServletRequest.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpServletResponse.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpSession.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/TestPortletInvocationContext.java
Modified:
components/wsrp/trunk/consumer/pom.xml
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/ServiceFactory.java
components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPMessageContext.java
Log:
- Added tests though some are currently not activated until they can be fully migrated to the new architecture.
- Make EndpointConfigurationInfo use ServiceFactory instead of specific implementation.
- Added WSDL-related methods on ServiceFactory. Should probably remove individual endpoint methods at some point.
- Fixed MockSOAPMessageContext.invoke as getProperty is now get in JAX-WS and added argument checking for added test security.
Modified: components/wsrp/trunk/consumer/pom.xml
===================================================================
--- components/wsrp/trunk/consumer/pom.xml 2009-11-12 12:04:05 UTC (rev 578)
+++ components/wsrp/trunk/consumer/pom.xml 2009-11-12 12:42:15 UTC (rev 579)
@@ -21,7 +21,8 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-parent</artifactId>
@@ -45,7 +46,7 @@
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-wsrp1-ws</artifactId>
</dependency>
-
+
<dependency>
<groupId>org.gatein.common</groupId>
<artifactId>common-common</artifactId>
@@ -86,6 +87,34 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.unit</groupId>
+ <artifactId>jboss-unit-remote</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>test-framework</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
+ <!-- Disable some tests for now until we can find some time to work on migrating them -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>org/gatein/wsrp/protocol/v1/*</exclude>
+ <exclude>org/gatein/wsrp/consumer/ConsumerRegistryTestCase*</exclude>
+ <exclude>org/gatein/wsrp/consumer/EndpointConfigurationInfoTestCase*</exclude>
+ <exclude>org/gatein/wsrp/consumer/ProducerInfoTestCase*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
\ No newline at end of file
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java 2009-11-12 12:04:05 UTC (rev 578)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -56,7 +56,7 @@
// transient variables
/** Access to the WS */
- private transient SOAPServiceFactory serviceFactory;
+ private transient ServiceFactory serviceFactory;
private transient String remoteHostAddress;
// Used to ensure that even invalid values can be persisted to DB so that it can be accessed from the GUI
@@ -80,6 +80,13 @@
serviceFactory = new SOAPServiceFactory();
}
+ EndpointConfigurationInfo(ProducerInfo producerInfo, ServiceFactory serviceFactory)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(producerInfo, "ProducerInfo");
+ producerInfo.setEndpointConfigurationInfo(this);
+ this.serviceFactory = serviceFactory;
+ }
+
public Long getKey()
{
return key;
@@ -313,7 +320,7 @@
}
}
- private ServiceFactory getServiceFactory()
+ ServiceFactory getServiceFactory()
{
initServiceFactoryIfNeeded();
startServiceFactoryIfNeeded();
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/ServiceFactory.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/ServiceFactory.java 2009-11-12 12:04:05 UTC (rev 578)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/ServiceFactory.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -69,4 +69,8 @@
void start() throws Exception;
void stop();
+
+ void setWsdlDefinitionURL(String wsdlDefinitionURL) throws Exception;
+
+ String getWsdlDefinitionURL();
}
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ConsumerRegistryTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ConsumerRegistryTestCase.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ConsumerRegistryTestCase.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,123 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.consumer;
+
+import junit.framework.TestCase;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
+import org.gatein.wsrp.consumer.registry.xml.XMLConsumerRegistry;
+import org.jboss.unit.api.pojo.annotations.Test;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 12686 $
+ * @since 2.6
+ */
+@Test
+public class ConsumerRegistryTestCase extends TestCase
+{
+ private ConsumerRegistry registry = new XMLConsumerRegistry();
+
+ public ConsumerRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(ConsumerRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public void testCRUD()
+ {
+// TransactionAssert.beginTransaction();
+ String id = "test";
+ WSRPConsumer consumer = registry.createConsumer(id, null);
+ assertNotNull(consumer);
+ assertEquals(id, consumer.getProducerId());
+ ProducerInfo info = consumer.getProducerInfo();
+ assertNotNull(info);
+ assertEquals(consumer.getProducerId(), info.getId());
+ EndpointConfigurationInfo endpoint = info.getEndpointConfigurationInfo();
+ assertNotNull(endpoint);
+ assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getServiceDescriptionURL());
+ assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getMarkupURL());
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ assertTrue(regInfo.isUndetermined());
+// TransactionAssert.commitTransaction();
+
+// TransactionAssert.beginTransaction();
+ try
+ {
+ registry.createConsumer(id, null);
+ fail("Shouldn't be possible to create a consumer with an existing id");
+ }
+ catch (ConsumerException expected)
+ {
+ // transaction should have been rolled back
+// TransactionAssert.rollbackTransaction();
+ }
+
+// TransactionAssert.beginTransaction();
+ consumer = registry.getConsumer(id);
+ assertNotNull(consumer);
+ assertEquals(id, consumer.getProducerId());
+ info = consumer.getProducerInfo();
+ assertNotNull(info);
+ assertEquals(consumer.getProducerId(), info.getId());
+ endpoint = info.getEndpointConfigurationInfo();
+ assertNotNull(endpoint);
+ assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getServiceDescriptionURL());
+ assertEquals(EndpointConfigurationInfo.UNSET, endpoint.getMarkupURL());
+ assertTrue(info.getRegistrationInfo().isUndetermined());
+
+ assertNull(registry.getConsumer("inexistent"));
+ Collection consumers = registry.getConfiguredConsumers();
+ assertNotNull(consumers);
+ assertEquals(1, consumers.size());
+ assertTrue(consumers.contains(consumer));
+// TransactionAssert.commitTransaction();
+ }
+
+ public void testUpdateProducerInfo()
+ {
+ // create a foo consumer
+// TransactionAssert.beginTransaction();
+ String id = "foo";
+ WSRPConsumer consumer = registry.createConsumer(id, null);
+ ProducerInfo info = consumer.getProducerInfo();
+// TransactionAssert.commitTransaction();
+
+// TransactionAssert.beginTransaction();
+ // change the id on the consumer's producer info and save it
+ info.setId("bar");
+ registry.updateProducerInfo(info);
+
+ assertNull(registry.getConsumer(id));
+ assertEquals(consumer, registry.getConsumer("bar"));
+// TransactionAssert.commitTransaction();
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ConsumerRegistryTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/EndpointConfigurationInfoTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/EndpointConfigurationInfoTestCase.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/EndpointConfigurationInfoTestCase.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,160 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.wsrp.consumer;
+
+import junit.framework.TestCase;
+import org.gatein.pc.api.InvokerUnavailableException;
+import org.gatein.wsrp.services.ServiceFactory;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 8893 $
+ * @since 2.6
+ */
+public class EndpointConfigurationInfoTestCase extends TestCase
+{
+ private EndpointConfigurationInfo info;
+ private String url = "http://www.example.com/";
+
+ protected void setUp() throws Exception
+ {
+// info = new EndpointConfigurationInfo(); // todo fix me
+ }
+
+ public void testSetURLs() throws InvokerUnavailableException
+ {
+ // default state is to use WSDL
+ assertTrue(info.usesWSDL());
+
+
+ info.setServiceDescriptionURL(url);
+ assertEquals(url, info.getServiceDescriptionURL());
+
+ // changing the URLs should switch to not using WSDL anymore...
+ assertFalse(info.usesWSDL());
+ try
+ {
+ info.getServiceFactory();
+ fail("Missing markup URL: service factory should not be initialized");
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ info.setMarkupURL(url);
+ assertFalse(info.usesWSDL());
+ assertNotNull(info.getServiceFactory());
+ assertEquals(url, info.getServiceFactory().getServiceDescriptionURL());
+ assertEquals(url, info.getServiceFactory().getMarkupURL());
+ assertTrue(info.getServiceFactory().isAvailable());
+ }
+
+ public void testSetWSDLURL() throws InvokerUnavailableException
+ {
+ assertTrue(info.usesWSDL());
+
+ // todo fix me
+
+ /*info.setServiceDescriptionURL(url);
+ info.setMarkupURL(url);
+ assertTrue(info.getServiceFactory() instanceof PerEndpointSOAPInvokerServiceFactory);
+ assertFalse(info.usesWSDL());
+
+ String bea = "http://wsrp.bea.com:7001/producer/producer?WSDL";
+ info.setWsdlDefinitionURL(bea);
+ assertEquals(bea, info.getWsdlDefinitionURL());
+ assertTrue(info.getServiceFactory() instanceof RemoteSOAPInvokerServiceFactory);
+ assertEquals(bea, ((RemoteSOAPInvokerServiceFactory)info.getServiceFactory()).getWsdlDefinitionURL());
+ assertTrue(info.usesWSDL());
+
+ info.setMarkupURL(url);
+ assertEquals(url, info.getMarkupURL());
+ assertEquals(url, info.getServiceFactory().getMarkupURL());
+ assertFalse(info.usesWSDL());*/
+ }
+
+ public void testSetInvalidWSDLURL()
+ {
+ info.setWsdlDefinitionURL(url);
+ assertTrue(info.usesWSDL());
+ assertEquals(url, info.getWsdlDefinitionURL());
+ }
+
+ public void testSetNullWSDLURL()
+ {
+ info.setServiceDescriptionURL(url);
+ info.setMarkupURL(url);
+
+ // it should be possible to set the WSDL to null for Hibernate
+ info.setWsdlDefinitionURL(null);
+
+ assertFalse(info.usesWSDL());
+ }
+
+ public void testRefreshWSDL() throws Exception
+ {
+ assertTrue(info.isRefreshNeeded());
+ assertFalse(info.isAvailable());
+
+ String bea = "http://wsrp.bea.com:7001/producer/producer?WSDL";
+ info.setWsdlDefinitionURL(bea);
+ info.refresh();
+ assertFalse(info.isRefreshNeeded());
+ assertTrue(info.isAvailable());
+ }
+
+ public void testRefresh() throws Exception
+ {
+ assertTrue(info.isRefreshNeeded());
+ assertFalse(info.isAvailable());
+
+ // change the service factory to a fake one to be able to simulate access to endpoint
+// info.setServiceFactory(new BehaviorBackedServiceFactory()); //todo
+ info.refresh();
+ assertFalse(info.isRefreshNeeded());
+ assertTrue(info.isAvailable());
+
+ info.setServiceDescriptionURL(url);
+ assertTrue(info.isRefreshNeeded());
+
+ info.getRegistrationService();
+ assertTrue(info.isRefreshNeeded());
+
+ info.getServiceDescriptionService();
+ assertFalse(info.isRefreshNeeded());
+ }
+
+ public void testGetServiceFactory() throws Exception
+ {
+ assertTrue(info.isRefreshNeeded());
+ assertFalse(info.isAvailable());
+
+ // change the service factory to a fake one to be able to simulate access to endpoint
+// info.setServiceFactory(new BehaviorBackedServiceFactory()); // todo
+ ServiceFactory factory = info.getServiceFactory();
+ assertNotNull(factory);
+ assertFalse(info.isRefreshNeeded());
+ assertTrue(info.isAvailable());
+ assertTrue(factory.isAvailable());
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/EndpointConfigurationInfoTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,373 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.consumer;
+
+import junit.framework.TestCase;
+import org.gatein.pc.api.Portlet;
+import org.gatein.pc.api.PortletContext;
+import org.gatein.pc.api.PortletInvokerException;
+import org.gatein.wsrp.WSRPExceptionFactory;
+import org.gatein.wsrp.test.protocol.v1.PortletManagementBehavior;
+import org.gatein.wsrp.test.protocol.v1.RegistrationBehavior;
+import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
+import org.gatein.wsrp.test.support.BehaviorBackedServiceFactory;
+import org.gatein.wsrp.test.support.MockConsumerRegistry;
+import org.oasis.wsrp.v1.AccessDenied;
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.InconsistentParameters;
+import org.oasis.wsrp.v1.InvalidHandle;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.InvalidRegistrationFault;
+import org.oasis.wsrp.v1.InvalidUserCategory;
+import org.oasis.wsrp.v1.MissingParameters;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.OperationFailedFault;
+import org.oasis.wsrp.v1.PortletDescription;
+import org.oasis.wsrp.v1.Property;
+import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.RegistrationData;
+import org.oasis.wsrp.v1.ResourceList;
+import org.oasis.wsrp.v1.UserContext;
+
+import javax.jws.WebParam;
+import javax.xml.ws.Holder;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 12686 $
+ * @since 2.6
+ */
+public class ProducerInfoTestCase extends TestCase
+{
+ private ProducerInfo info;
+ private BehaviorBackedServiceFactory serviceFactory;
+
+ protected void setUp() throws Exception
+ {
+ info = new ProducerInfo();
+ info.setId("test");
+ serviceFactory = new BehaviorBackedServiceFactory();
+
+ EndpointConfigurationInfo eci = new EndpointConfigurationInfo(info, serviceFactory);
+
+ info.setRegistry(new MockConsumerRegistry());
+ }
+
+ public void testRefreshAndCache() throws Exception
+ {
+ ServiceDescriptionBehavior behavior = new ServiceDescriptionBehavior();
+ serviceFactory.getRegistry().setServiceDescriptionBehavior(behavior);
+
+ assertNull(info.getExpirationCacheSeconds());
+
+ assertTrue(info.isRefreshNeeded(false));
+ assertFalse(info.isRegistrationChecked());
+ assertTrue(info.refresh(false));
+ assertFalse(info.isRefreshNeeded(false));
+ assertTrue(info.isRegistrationChecked());
+ assertTrue(info.refresh(false));
+ assertFalse(info.isRefreshNeeded(false));
+ assertTrue(info.isRegistrationChecked());
+ assertEquals(2, behavior.getCallCount());
+
+ info.setExpirationCacheSeconds(1);
+ assertEquals(new Integer(1), info.getExpirationCacheSeconds());
+ assertTrue(info.refresh(false));
+ assertFalse(info.refresh(false));
+ assertFalse(info.isRefreshNeeded(false));
+ assertTrue(info.isRegistrationChecked());
+ assertEquals(3, behavior.getCallCount());
+
+ // wait for cache expiration
+ Thread.sleep(1500);
+ assertFalse("refresh is not needed if cache is not considered", info.isRefreshNeeded(false));
+ assertTrue("refresh is needed if cache is considered since it has expired", info.isRefreshNeeded(true));
+ assertTrue(info.refresh(false));
+ assertFalse("Was just refreshed so refresh is not needed even considering cache", info.isRefreshNeeded(true));
+ assertTrue(info.isRegistrationChecked());
+ assertFalse(info.refresh(false));
+ assertTrue(info.refresh(true));
+ assertFalse(info.isRefreshNeeded(false));
+ assertTrue(info.isRegistrationChecked());
+ assertEquals(5, behavior.getCallCount());
+ }
+
+ public void testGetPortlet() throws Exception
+ {
+ ServiceDescriptionBehavior behavior = new ServiceDescriptionBehavior();
+ behavior.addPortletDescription(behavior.createPortletDescription("test", null));
+ serviceFactory.getRegistry().setServiceDescriptionBehavior(behavior);
+
+ // activate caching for this test so that we can simulate portlet deployment on the producer with a cached SD
+ info.setExpirationCacheSeconds(1000);
+
+ PortletContext portletContext = PortletContext.createPortletContext("test");
+ Portlet portlet = info.getPortlet(portletContext);
+ assertNotNull(portlet);
+ assertEquals(portletContext, portlet.getContext());
+ assertEquals(1, behavior.getCallCount());
+
+ // test2 is not in the service description, so it should be looked up via Portlet Management...
+ portletContext = PortletContext.createPortletContext("test2");
+ // add portlet management behavior
+ TestPortletManagementBehavior pmBehavior = new TestPortletManagementBehavior();
+ serviceFactory.getRegistry().setPortletManagementBehavior(pmBehavior);
+ portlet = info.getPortlet(portletContext);
+ assertEquals(1, pmBehavior.getCallCount());
+ assertNotNull(portlet);
+ assertEquals(portletContext, portlet.getContext());
+
+ // try again, this time without a portlet management interface, the service description should be refreshed
+ serviceFactory.getRegistry().setPortletManagementBehavior(null);
+ // simulate a new portlet deployment since last time the SD was refreshed
+ behavior.addPortletDescription(behavior.createPortletDescription("test3", null));
+ portletContext = PortletContext.createPortletContext("test3");
+ portlet = info.getPortlet(portletContext);
+ assertEquals(2, behavior.getCallCount());
+ assertNotNull(portlet);
+ assertEquals(portletContext, portlet.getContext());
+ }
+
+ public void testRefreshAndRegistration() throws Exception
+ {
+ assertFalse(info.isRegistered());
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ assertTrue(regInfo.isUndetermined());
+
+ ServiceDescriptionBehavior sd = new ServiceDescriptionBehavior();
+ sd.setRequiresRegistration(true);
+ serviceFactory.getRegistry().setServiceDescriptionBehavior(sd);
+ RegistrationBehavior regBehavior = new RegistrationBehavior();
+ serviceFactory.getRegistry().setRegistrationBehavior(regBehavior);
+
+ assertTrue(info.refresh(false));
+ assertEquals(1, regBehavior.getCallCount());
+ assertTrue(info.isRegistered());
+ assertNotNull(info.getRegistrationInfo());
+ assertEquals(RegistrationBehavior.REGISTRATION_HANDLE, info.getRegistrationContext().getRegistrationHandle());
+
+ assertTrue(info.refresh(true));
+ assertEquals(1, regBehavior.getCallCount());
+ }
+
+ public void testGetRegistrationContext() throws Exception
+ {
+ assertFalse(info.isRegistered());
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ assertTrue(regInfo.isUndetermined());
+
+ ServiceDescriptionBehavior sd = new ServiceDescriptionBehavior();
+ sd.setRequiresRegistration(true);
+ serviceFactory.getRegistry().setServiceDescriptionBehavior(sd);
+ RegistrationBehavior regBehavior = new RegistrationBehavior();
+ serviceFactory.getRegistry().setRegistrationBehavior(regBehavior);
+
+ RegistrationContext registrationContext = info.getRegistrationContext();
+ assertNotNull(registrationContext);
+ assertEquals(RegistrationBehavior.REGISTRATION_HANDLE, registrationContext.getRegistrationHandle());
+ assertEquals("Registration should have occured", 1, regBehavior.getCallCount());
+ assertEquals("Service description should have been called once unregistered and once registered", 2, sd.getCallCount());
+ }
+
+ public void testRegister() throws Exception
+ {
+ ServiceDescriptionBehavior sd = new ServiceDescriptionBehavior();
+ sd.setServiceDescription(true, 1);
+
+ serviceFactory.getRegistry().setServiceDescriptionBehavior(sd);
+ RegistrationBehavior regBehavior = new TestRegistrationBehavior();
+ serviceFactory.getRegistry().setRegistrationBehavior(regBehavior);
+
+ try
+ {
+ info.register();
+ fail("Shouldn't register with invalid information");
+ }
+ catch (PortletInvokerException expected)
+ {
+ }
+
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ regInfo.setRegistrationPropertyValue(TestRegistrationBehavior.PROP_NAME, TestRegistrationBehavior.ORIGINAL_VALUE);
+
+ info.register();
+ RegistrationContext registrationContext = info.getRegistrationContext();
+ assertNotNull(registrationContext);
+ assertEquals(RegistrationBehavior.REGISTRATION_HANDLE, registrationContext.getRegistrationHandle());
+ assertTrue(info.isRegistered());
+ assertTrue(info.isRegistrationChecked());
+ assertTrue(info.isRegistrationRequired());
+ }
+
+ public void testDeregister() throws Exception
+ {
+ try
+ {
+ info.deregister();
+ fail("Shouldn't be able to deregister without being registered");
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ // setup registration
+ register();
+
+ info.deregister();
+ assertNull(info.getRegistrationContext());
+ assertFalse(info.isRegistered());
+ assertTrue(info.isRegistrationRequired());
+ assertTrue(info.isRegistrationChecked());
+ }
+
+ private void register() throws PortletInvokerException
+ {
+ ServiceDescriptionBehavior sd = new ServiceDescriptionBehavior();
+ sd.setServiceDescription(true, 1);
+ serviceFactory.getRegistry().setServiceDescriptionBehavior(sd);
+ RegistrationBehavior regBehavior = new TestRegistrationBehavior();
+ serviceFactory.getRegistry().setRegistrationBehavior(regBehavior);
+ info.refresh(false);
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ regInfo.setRegistrationPropertyValue(TestRegistrationBehavior.PROP_NAME, TestRegistrationBehavior.ORIGINAL_VALUE);
+
+ info.register();
+ }
+
+ public void testModifyRegistration() throws Exception
+ {
+ try
+ {
+ info.modifyRegistration();
+ fail("Shouldn't be able to modify registration without being registered");
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ register();
+
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ regInfo.setRegistrationPropertyValue(TestRegistrationBehavior.PROP_NAME, "invalid");
+ assertTrue(info.isRefreshNeeded(false));
+ assertTrue(info.isRegistered());
+ assertTrue(info.isModifyRegistrationRequired());
+ RegistrationProperty prop = regInfo.getRegistrationProperty(TestRegistrationBehavior.PROP_NAME);
+ assertNull(prop.isInvalid());
+
+ try
+ {
+ info.modifyRegistration();
+ fail("invalid value for property should fail to modify registration");
+ }
+ catch (PortletInvokerException expected)
+ {
+ }
+
+ regInfo.setRegistrationPropertyValue(TestRegistrationBehavior.PROP_NAME, TestRegistrationBehavior.MODIFIED_VALUE);
+ assertTrue(info.isRefreshNeeded(false));
+ assertNull(prop.isInvalid());
+ assertTrue(info.isModifyRegistrationRequired());
+
+ info.modifyRegistration();
+
+ assertTrue(info.isRefreshNeeded(true)); // cache should have been invalidated
+ assertFalse(info.isRefreshNeeded(false)); // but the rest of the information is valid so no refresh needed there
+ assertTrue(info.refresh(false)); // however, if we refresh the producer info, it should have refreshed
+ assertFalse(info.isModifyRegistrationRequired());
+
+ Boolean invalid = prop.isInvalid();
+ assertNotNull(invalid);
+ assertFalse(invalid);
+ }
+
+ private static class TestPortletManagementBehavior extends PortletManagementBehavior
+ {
+ @Override
+ public void getPortletDescription(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") org.oasis.wsrp.v1.PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "desiredLocales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales, @WebParam(mode = WebParam.Mode.OUT, name = "portletDescription", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<PortletDescription> portletDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension!
>> extensions) throws MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ super.getPortletDescription(registrationContext, portletContext, userContext, desiredLocales, portletDescription, resourceList, extensions);
+ portletDescription.value = createPortletDescription("test2", null);
+ }
+ }
+
+ private static class TestRegistrationBehavior extends RegistrationBehavior
+ {
+ private static final String PROP_NAME = "prop0";
+ private static final String MODIFIED_VALUE = "value2";
+ private static final String ORIGINAL_VALUE = "value";
+
+ @Override
+ public void register(@WebParam(name = "consumerName", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") String consumerName, @WebParam(name = "consumerAgent", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") String consumerAgent, @WebParam(name = "methodGetSupported", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") boolean methodGetSupported, @WebParam(name = "consumerModes", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> consumerModes, @WebParam(name = "consumerWindowStates", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> consumerWindowStates, @WebParam(name = "consumerUserScopes", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> consumerUserScopes, @WebParam(name = "customUserProfileData", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> customUserProfileData, @WebParam(name = "registrationProperties", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<Property> regist!
rationProperties, @WebParam(mode = WebParam.Mode.INOUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions, @WebParam(mode = WebParam.Mode.OUT, name = "registrationHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String> registrationHandle, @WebParam(mode = WebParam.Mode.OUT, name = "registrationState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> registrationState) throws MissingParameters, OperationFailed
+ {
+ Property prop = checkRegistrationData(registrationProperties);
+
+ String value = prop.getStringValue();
+ if (ORIGINAL_VALUE.equals(value) && PROP_NAME.equals(prop.getName()))
+ {
+ super.register(consumerName, consumerAgent, methodGetSupported, consumerModes, consumerWindowStates, consumerUserScopes, customUserProfileData, registrationProperties, extensions, registrationHandle, registrationState);
+ return;
+ }
+
+ throw WSRPExceptionFactory.<OperationFailed, OperationFailedFault>throwWSException(WSRPExceptionFactory.OPERATION_FAILED,
+ value + " is not a valid value for " + PROP_NAME, null);
+ }
+
+ @Override
+ public void modifyRegistration(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "registrationData", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationData registrationData, @WebParam(mode = WebParam.Mode.OUT, name = "registrationState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> registrationState, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, InvalidRegistration, OperationFailed
+ {
+ incrementCallCount();
+
+ WSRPExceptionFactory.throwMissingParametersIfValueIsMissing(registrationContext, "RegistrationContext", null);
+
+ if (!RegistrationBehavior.REGISTRATION_HANDLE.equals(registrationContext.getRegistrationHandle()))
+ {
+ WSRPExceptionFactory.<InvalidRegistration, InvalidRegistrationFault>throwWSException(WSRPExceptionFactory.INVALID_REGISTRATION, "Invalid registration", null);
+ }
+
+ WSRPExceptionFactory.throwMissingParametersIfValueIsMissing(registrationData, "RegistrationData", null);
+
+ Property prop = checkRegistrationData(registrationData.getRegistrationProperties());
+
+ String value = prop.getStringValue();
+ if (MODIFIED_VALUE.equals(value) && PROP_NAME.equals(prop.getName()))
+ {
+ return;
+ }
+
+ throw WSRPExceptionFactory.<OperationFailed, OperationFailedFault>throwWSException(WSRPExceptionFactory.OPERATION_FAILED, value
+ + " is not a valid value for " + PROP_NAME, null);
+ }
+
+ private Property checkRegistrationData(List<Property> registrationProperties) throws OperationFailed
+ {
+ WSRPExceptionFactory.throwOperationFailedIfValueIsMissing(registrationProperties, "RegistrationData");
+
+ Property prop = registrationProperties.get(0);
+ WSRPExceptionFactory.throwOperationFailedIfValueIsMissing(prop, "Registration property");
+ return prop;
+ }
+ }
+}
\ No newline at end of file
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerInfoTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerSessionInformationTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerSessionInformationTestCase.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerSessionInformationTestCase.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,220 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.consumer;
+
+import junit.framework.TestCase;
+import org.apache.commons.httpclient.Cookie;
+import org.gatein.wsrp.WSRPConstants;
+import org.gatein.wsrp.WSRPTypeFactory;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.consumer.ProducerSessionInformationTestCase">Chris
+ * Laprun</a>
+ * @version $Revision: 10388 $
+ * @since 2.4
+ */
+public class ProducerSessionInformationTestCase extends TestCase
+{
+ ProducerSessionInformation info;
+
+ protected void setUp() throws Exception
+ {
+ info = new ProducerSessionInformation();
+ }
+
+ public void testUserCookie() throws Exception
+ {
+ assertNull(info.getUserCookie());
+
+ Cookie[] cookies = new Cookie[]{createCookie("name", "value", 1)};
+ info.setUserCookie(cookies);
+
+ assertEquals("name=value", info.getUserCookie());
+
+ // wait for cookie expiration
+ Thread.sleep(1000);
+ assertNull(info.getUserCookie()); // we shouldn't have a cookie now
+
+ cookies = new Cookie[]{createCookie("name1", "value1", 1), createCookie("name2", "value2", 3)};
+ info.setUserCookie(cookies);
+ assertEquals("name1=value1,name2=value2", info.getUserCookie());
+
+ Thread.sleep(1000);
+ assertEquals("name2=value2", info.getUserCookie());
+
+ try
+ {
+ info.setUserCookie(null);
+ fail("Should have thrown an IllegalArgumentException");
+ }
+ catch (IllegalArgumentException e)
+ {
+ //expected
+ }
+ }
+
+ public void testGroupCookies() throws Exception
+ {
+ String groupId = "groupId";
+
+ try
+ {
+ info.setGroupCookieFor(groupId, new Cookie[]{createCookie("name1", "value1", 1), createCookie("name2", "value2", -1)});
+ fail("Cannot add group cookie if not perGroup");
+ }
+ catch (IllegalStateException e)
+ {
+ //expected
+ }
+
+ info.setPerGroupCookies(true);
+ info.setGroupCookieFor(groupId, new Cookie[]{createCookie("name1", "value1", 1),
+ createCookie("name2", "value2", WSRPConstants.SESSION_NEVER_EXPIRES)});
+
+ assertEquals("name1=value1,name2=value2", info.getGroupCookieFor(groupId));
+
+ Thread.sleep(1000);
+ assertEquals("name2=value2", info.getGroupCookieFor(groupId));
+
+ info.clearGroupCookies();
+ assertNull(info.getGroupCookieFor(groupId));
+ }
+
+ public void testSessionForPortlet() throws Exception
+ {
+ String handle = "handle";
+ String handle2 = "handle2";
+ String sid = "id";
+ String sid2 = "id2";
+
+ assertNull(info.getSessionIdForPortlet(handle));
+ assertEquals(0, info.getNumberOfSessions());
+
+ addSession(handle, sid, 1);
+ addSession(handle2, sid2, 3);
+
+ assertNull(info.getSessionIdForPortlet("unknown"));
+
+ assertEquals(sid, info.getSessionIdForPortlet(handle));
+ assertEquals(2, info.getNumberOfSessions());
+
+ Thread.sleep(1000);
+ assertNull(info.getSessionIdForPortlet(handle));
+ assertEquals(sid2, info.getSessionIdForPortlet(handle2));
+ assertEquals(1, info.getNumberOfSessions());
+
+ info.removeSessionForPortlet(handle2);
+ assertEquals(0, info.getNumberOfSessions());
+ }
+
+ public void testReplaceUserCookies() throws Exception
+ {
+ info.setUserCookie(new Cookie[]{createCookie("name", "value", 1)});
+
+ info.replaceUserCookiesWith(null);
+ assertEquals("name=value", info.getUserCookie());
+
+ ProducerSessionInformation other = new ProducerSessionInformation();
+
+ info.replaceUserCookiesWith(other);
+ assertEquals("name=value", info.getUserCookie());
+
+ other.setUserCookie(new Cookie[]{createCookie("name2", "value2", 1)});
+ info.replaceUserCookiesWith(other);
+ assertEquals("name2=value2", info.getUserCookie());
+
+ Thread.sleep(1000);
+ info.replaceUserCookiesWith(other);
+ assertNull(info.getUserCookie());
+ }
+
+ public void testReleaseSessions()
+ {
+ addSession("handle", "id", 1);
+ addSession("handle2", "id2", 1);
+ addSession("handle3", "id3", 1);
+
+ assertEquals(3, info.getNumberOfSessions());
+
+ info.removeSessions();
+
+ assertEquals(0, info.getNumberOfSessions());
+
+ addSession("handle", "id", 1);
+ addSession("handle2", "id2", 2);
+
+ info.removeSession("id2");
+
+ assertEquals(1, info.getNumberOfSessions());
+ assertNull(info.getSessionIdForPortlet("handle2"));
+ assertEquals("id", info.getSessionIdForPortlet("handle"));
+
+ info.removeSessionForPortlet("handle");
+
+ assertEquals(0, info.getNumberOfSessions());
+ assertNull(info.getSessionIdForPortlet("handle"));
+
+ try
+ {
+ info.removeSessionForPortlet("handle");
+ fail("Session for portlet 'handle' should have already been released!");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ // expected
+ }
+ }
+
+ public void testSetParentSessionId()
+ {
+ assertNull(info.getParentSessionId());
+
+ String id = "session";
+ info.setParentSessionId(id);
+ assertEquals(id, info.getParentSessionId());
+
+ // trying to set the same id should work
+ info.setParentSessionId(id);
+
+ try
+ {
+ info.setParentSessionId("other");
+ fail("Cannot modify session id once it has been set");
+ }
+ catch (IllegalStateException expected)
+ {
+ // expected
+ }
+ }
+
+ private Cookie createCookie(String name, String value, int secondsBeforeExpiration)
+ {
+ return new Cookie("domain", name, value, "path", secondsBeforeExpiration, false);
+ }
+
+ private void addSession(String handle, String sid, int expires)
+ {
+ info.addSessionForPortlet(handle, WSRPTypeFactory.createSessionContext(sid, expires));
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/ProducerSessionInformationTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationInfoTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationInfoTestCase.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationInfoTestCase.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,453 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.consumer;
+
+import junit.framework.TestCase;
+import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
+import org.oasis.wsrp.v1.Property;
+import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.RegistrationData;
+import org.oasis.wsrp.v1.ServiceDescription;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 11967 $
+ * @since 2.6
+ */
+public class RegistrationInfoTestCase extends TestCase
+{
+ private RegistrationInfo info;
+ private static final String producerId = "test";
+
+ protected void setUp() throws Exception
+ {
+ info = new RegistrationInfo();
+ }
+
+ public void testInitialState()
+ {
+ assertTrue(info.getRegistrationProperties().isEmpty());
+ assertTrue(info.getRegistrationPropertyNames().isEmpty());
+ assertNull(info.getRegistrationContext());
+ assertNotNull(info.getRegistrationData());
+ assertNull(info.getRegistrationHandle());
+ assertNull(info.getRegistrationState());
+
+ // before refresh, refresh is needed...
+ assertTrue(info.isRefreshNeeded());
+ // we don't know if the the local info is consistent with the producer expectations...
+ assertNull(info.isConsistentWithProducerExpectations());
+ // we don't know if the registration is required...
+ assertNull(info.isRegistrationRequired());
+ // and we don't know if the registration is valid
+ assertNull(info.isRegistrationValid());
+
+ assertFalse(info.isModifiedSinceLastRefresh());
+ assertFalse(info.isModifyRegistrationNeeded());
+
+ try
+ {
+ info.isRegistrationDeterminedNotRequired();
+ fail("refresh hasn't been called, isRegistrationDeterminedNotRequired should fail");
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+
+ try
+ {
+ info.isRegistrationDeterminedRequired();
+ fail("refresh hasn't been called, isRegistrationDeterminedRequired should fail");
+ }
+ catch (IllegalStateException expected)
+ {
+ }
+ }
+
+ public void testSimpleSetGetRegistrationProperty()
+ {
+ String key = "foo";
+ info.setRegistrationPropertyValue(key, "bar");
+
+ // check status
+ assertNull(info.isConsistentWithProducerExpectations());
+ assertTrue(info.isModifiedSinceLastRefresh());
+ assertTrue(info.isModifyRegistrationNeeded());
+
+ Map properties = info.getRegistrationProperties();
+ assertFalse(properties.isEmpty());
+ Set names = info.getRegistrationPropertyNames();
+ assertFalse(names.isEmpty());
+ assertTrue(properties.containsKey(key));
+ assertTrue(names.contains(key));
+ Object prop = properties.get(key);
+ assertNotNull(prop);
+ RegistrationProperty registrationProperty = info.getRegistrationProperty(key);
+ assertEquals(prop, registrationProperty);
+ assertEquals("bar", registrationProperty.getValue());
+ }
+
+ public void testRegistrationPropertiesAndRefresh()
+ {
+ info.setRegistrationPropertyValue("prop0", "value0");
+ RefreshResult result = info.refresh(createServiceDescription(true, 1), producerId, true, false, false);
+ RegistrationProperty prop = info.getRegistrationProperty("prop0");
+ assertNull(prop.isInvalid());
+ assertFalse(result.hasIssues());
+ assertFalse(info.isModifiedSinceLastRefresh());
+ assertFalse(info.isModifyRegistrationNeeded());
+ assertTrue(info.isConsistentWithProducerExpectations());
+
+ // specifiy that the prop is valid to simulate a successful registration (integration test, should have something
+ // testing that in ProducerInfoTestCase)
+ prop.setInvalid(Boolean.FALSE, RegistrationProperty.Status.VALID);
+
+ info.setRegistrationPropertyValue("prop0", "value1");
+ assertTrue(info.isRefreshNeeded());
+ assertNull("Property value has changed since last refresh, status should be unknown", prop.isInvalid());
+ assertEquals("Property value has changed since last refresh, status should be unknown",
+ RegistrationProperty.Status.UNCHECKED_VALUE, prop.getStatus());
+ }
+
+ public void testRefreshNoRegistration()
+ {
+ // no registration expected
+ ServiceDescription sd = createServiceDescription(false, 0);
+ RefreshResult result = info.refresh(sd, producerId, true, false, false);
+ assertNotNull(result);
+ assertFalse(result.hasIssues());
+ assertTrue(info.isConsistentWithProducerExpectations());
+ assertFalse(info.isRegistrationRequired());
+ assertTrue(info.isRegistrationDeterminedNotRequired());
+ assertFalse(info.isRegistrationDeterminedRequired());
+ assertTrue(info.isRegistrationValid());
+ assertFalse(info.isModifyRegistrationNeeded());
+
+ result = info.refresh(sd, producerId, false, false, false);
+ assertNotNull(result);
+ assertFalse(result.hasIssues());
+ assertTrue(info.isConsistentWithProducerExpectations());
+ assertFalse(info.isRegistrationRequired());
+ assertTrue(info.isRegistrationDeterminedNotRequired());
+ assertFalse(info.isRegistrationDeterminedRequired());
+ assertTrue(info.isRegistrationValid());
+ assertFalse(info.isModifyRegistrationNeeded());
+ }
+
+ public void testRefreshRegistrationDefaultRegistrationNoLocalInfo()
+ {
+ // before refresh registration status is undetermined
+ assertNull(info.isRegistrationRequired());
+ assertNull(info.isRegistrationValid());
+
+ RegistrationInfo.RegistrationRefreshResult result = info.refresh(
+ createServiceDescription(true, 0), producerId, true, false, false);
+ assertNotNull(result);
+ assertFalse(result.hasIssues());
+ assertTrue(info.isRegistrationRequired());
+ assertTrue(info.isRegistrationDeterminedRequired());
+ assertFalse(info.isRegistrationDeterminedNotRequired());
+ assertFalse(info.isRegistrationValid());
+ }
+
+ public void testRefreshRegistrationDefaultRegistrationExtraLocalInfo()
+ {
+ // set a registration property
+ info.setRegistrationPropertyValue("foo", "bar");
+
+ // we were not registered so this is a failure and not a need to call modifyRegistration
+ RegistrationInfo.RegistrationRefreshResult result = info.refresh(
+ createServiceDescription(true, 0), producerId, false, false, true);
+ assertNotNull(result);
+ assertTrue(result.hasIssues());
+ assertEquals(RefreshResult.Status.FAILURE, result.getStatus());
+ assertEquals(1, info.getRegistrationProperties().size());
+ assertEquals(1, result.getRegistrationProperties().size());
+ assertFalse(info.isModifyRegistrationNeeded());
+
+ Map regProps = result.getRegistrationProperties();
+ assertNotNull(regProps);
+
+ RegistrationProperty prop = (RegistrationProperty)regProps.get("foo");
+ assertNotNull(prop);
+ assertEquals("bar", prop.getValue());
+ assertTrue(prop.isInvalid());
+ assertEquals(RegistrationProperty.Status.INEXISTENT, prop.getStatus());
+ }
+
+ public void testRefreshRegistrationDefaultRegistrationExtraLocalInfoWhileRegistered()
+ {
+ // set a registration property
+ info.setRegistrationPropertyValue("foo", "bar");
+
+ // simulate being registered
+ info.setRegistrationHandle("blah");
+
+ // we were registered so we need to call modifyRegistration, force check of extra props
+ RegistrationInfo.RegistrationRefreshResult result = info.refresh(
+ createServiceDescription(true, 0), producerId, false, false, true);
+ assertNotNull(result);
+ assertEquals(RefreshResult.Status.MODIFY_REGISTRATION_REQUIRED, result.getStatus());
+ assertTrue(result.hasIssues());
+ assertEquals(1, info.getRegistrationProperties().size());
+ assertEquals(1, result.getRegistrationProperties().size());
+ assertTrue(info.isModifyRegistrationNeeded());
+
+ Map regProps = result.getRegistrationProperties();
+ assertNotNull(regProps);
+
+ RegistrationProperty prop = (RegistrationProperty)regProps.get("foo");
+ assertNotNull(prop);
+ assertEquals("bar", prop.getValue());
+ assertTrue(prop.isInvalid());
+ assertEquals(RegistrationProperty.Status.INEXISTENT, prop.getStatus());
+ }
+
+ public void testRefreshRegistrationRegistrationNoLocalInfo()
+ {
+ // producer requests 2 registration properties
+ ServiceDescription sd = createServiceDescription(true, 2);
+
+ RegistrationInfo.RegistrationRefreshResult result = info.refresh(sd, producerId, false, false, false);
+ assertNotNull(result);
+ assertTrue(result.hasIssues());
+ assertEquals(RefreshResult.Status.FAILURE, result.getStatus());
+ assertEquals(0, info.getRegistrationProperties().size());
+ assertEquals(2, result.getRegistrationProperties().size());
+ assertFalse(info.isModifyRegistrationNeeded()); // we weren't registered
+
+ Map regProps = result.getRegistrationProperties();
+ assertNotNull(regProps);
+
+ RegistrationProperty prop = (RegistrationProperty)regProps.get("prop0");
+ assertNotNull(prop);
+ assertTrue(prop.isInvalid());
+ assertEquals(RegistrationProperty.Status.MISSING, prop.getStatus());
+ prop = (RegistrationProperty)regProps.get("prop1");
+ assertNotNull(prop);
+ assertTrue(prop.isInvalid());
+ assertEquals(RegistrationProperty.Status.MISSING, prop.getStatus());
+ }
+
+ public void testRefreshRegistrationRegistrationNoLocalInfoWhileRegistered()
+ {
+ // producer requests 2 registration properties
+ ServiceDescription sd = createServiceDescription(true, 2);
+
+ // simulate registration
+ info.setRegistrationHandle("blah");
+
+ RegistrationInfo.RegistrationRefreshResult result = info.refresh(sd, producerId, false, false, false);
+ assertNotNull(result);
+ assertTrue(result.hasIssues());
+ assertEquals(RefreshResult.Status.MODIFY_REGISTRATION_REQUIRED, result.getStatus());
+ assertEquals(0, info.getRegistrationProperties().size());
+ assertEquals(2, result.getRegistrationProperties().size());
+ assertTrue(info.isModifyRegistrationNeeded());
+
+ Map regProps = result.getRegistrationProperties();
+ assertNotNull(regProps);
+
+ RegistrationProperty prop = (RegistrationProperty)regProps.get("prop0");
+ assertNotNull(prop);
+ assertTrue(prop.isInvalid());
+ assertEquals(RegistrationProperty.Status.MISSING, prop.getStatus());
+ prop = (RegistrationProperty)regProps.get("prop1");
+ assertNotNull(prop);
+ assertTrue(prop.isInvalid());
+ assertEquals(RegistrationProperty.Status.MISSING, prop.getStatus());
+ }
+
+ public void testRefreshRegistrationRegistrationMergeWithLocalInfo()
+ {
+ info.setRegistrationPropertyValue("foo", "bar");
+
+ RegistrationInfo.RegistrationRefreshResult result = info.refresh(createServiceDescription(true, 2),
+ producerId, true, false, false);
+ assertNotNull(result);
+ assertTrue(result.hasIssues());
+
+ RegistrationProperty prop = info.getRegistrationProperty("prop0");
+ assertNotNull(prop);
+ assertNull(prop.getValue());
+ assertTrue(prop.isInvalid());
+ assertEquals(RegistrationProperty.Status.MISSING_VALUE, prop.getStatus());
+
+ prop = info.getRegistrationProperty("prop1");
+ assertNotNull(prop);
+ assertNull(prop.getValue());
+ assertTrue(prop.isInvalid());
+ assertEquals(RegistrationProperty.Status.MISSING_VALUE, prop.getStatus());
+ assertEquals(2, info.getRegistrationProperties().size());
+ assertEquals(2, result.getRegistrationProperties().size());
+
+ assertNull(info.getRegistrationProperty("foo"));
+ }
+
+ public void testForceRefreshRegistration()
+ {
+ //
+ RefreshResult result = info.refresh(createServiceDescription(true, 0), producerId, false, false, false);
+ assertNotNull(result);
+ assertFalse(result.hasIssues());
+ assertFalse(info.isRegistrationValid());
+
+ // Modifying a property renders the info dirty and hence should be refreshed
+ info.setRegistrationPropertyValue("foo", "bar");
+ result = info.refresh(createServiceDescription(true, 0), producerId, false, false, false);
+ assertTrue(result.hasIssues());
+ assertFalse(info.isRegistrationValid());
+
+ info.removeRegistrationProperty("foo");
+ result = info.refresh(createServiceDescription(true, 0), producerId, false, false, false);
+ assertFalse(result.hasIssues());
+ assertFalse(info.isRegistrationValid());
+
+ // producer has changed but we're not forcing refresh so registration should still be invalid
+ result = info.refresh(createServiceDescription(false, 0), producerId, false, false, false);
+ assertFalse(result.hasIssues());
+ assertFalse(info.isRegistrationValid());
+
+ // force refresh, registration should now be valid
+ result = info.refresh(createServiceDescription(false, 0), producerId, false, true, false);
+ assertFalse(result.hasIssues());
+ assertTrue(info.isRegistrationValid());
+ }
+
+ public void testSetRegistrationContext()
+ {
+ assertNull(info.isConsistentWithProducerExpectations());
+ assertNull(info.getRegistrationHandle());
+
+ String registrationHandle = "registrationHandle";
+ info.setRegistrationContext(WSRPTypeFactory.createRegistrationContext(registrationHandle));
+ RegistrationContext registrationContext = info.getRegistrationContext();
+ assertNotNull(registrationContext);
+ assertEquals(registrationHandle, registrationContext.getRegistrationHandle());
+ assertNull(registrationContext.getRegistrationState());
+ assertTrue(info.isConsistentWithProducerExpectations());
+ assertTrue(info.isRegistrationValid());
+ assertFalse(info.isRefreshNeeded());
+ assertTrue(info.isRegistrationRequired());
+ assertTrue(info.isRegistrationDeterminedRequired());
+ assertFalse(info.isRegistrationDeterminedNotRequired());
+ assertFalse(info.isModifyRegistrationNeeded());
+ }
+
+ public void testGetRegistrationData()
+ {
+ assertNotNull(info.getRegistrationData());
+ assertFalse(info.isModifiedSinceLastRefresh());
+ assertFalse(info.isModifyRegistrationNeeded());
+
+ info.setRegistrationPropertyValue("prop0", "value0");
+ assertTrue(info.isModifiedSinceLastRefresh());
+ assertTrue(info.isModifyRegistrationNeeded());
+ RegistrationData registrationData = info.getRegistrationData();
+ checkRegistrationData(registrationData, "value0");
+
+ // check that setRegistrationValidInternalState properly updates RegistrationData if required
+ info.setRegistrationPropertyValue("prop0", "value1");
+ assertTrue(info.isModifiedSinceLastRefresh());
+ assertTrue(info.isModifyRegistrationNeeded());
+ info.setRegistrationValidInternalState();
+ assertFalse(info.isModifiedSinceLastRefresh());
+ assertFalse(info.isModifyRegistrationNeeded());
+ List<Property> properties = info.getRegistrationData().getRegistrationProperties();
+ assertEquals("value1", properties.get(0).getStringValue());
+ }
+
+ public void testGetRegistrationDataWithInitialWrongValue()
+ {
+ info.setRegistrationPropertyValue("prop0", "incorrect");
+ info.refresh(createServiceDescription(true, 1), producerId, true, true, false);
+ checkRegistrationData(info.getRegistrationData(), "incorrect");
+
+ info.setRegistrationPropertyValue("prop0", "value0");
+ RefreshResult res = info.refresh(createServiceDescription(true, 1), producerId, true, true, false);
+ assertFalse(res.hasIssues());
+ checkRegistrationData(info.getRegistrationData(), "value0");
+ }
+
+ public void testRefreshWhileRegisteredAndProducerNotSendingPropertyDescriptions()
+ {
+ info.setRegistrationPropertyValue("prop0", "value0");
+ info.refresh(createServiceDescription(true, 1), producerId, true, true, false);
+
+ // simulate successful registration
+ info.setRegistrationContext(WSRPTypeFactory.createRegistrationContext("handle"));
+
+ assertTrue(info.isRegistrationRequired());
+ assertTrue(info.isRegistrationValid());
+
+ ServiceDescription description = createServiceDescription(true, 0);
+ info.refresh(description, producerId, true, true, false);
+ assertTrue(info.isRegistrationValid());
+ RegistrationProperty prop = info.getRegistrationProperty("prop0");
+ assertNotNull(prop);
+ assertFalse(prop.isInvalid());
+
+ // check that forcing check of extra properties work
+ info.refresh(description, producerId, true, true, true);
+ assertFalse(info.isRegistrationValid());
+ assertNull(info.getRegistrationProperty("prop0"));
+ }
+
+ public void testRefreshRegisteredWithoutPropsAndProducerNowSendsProps()
+ {
+ // simulate successful registration
+ info.setRegistrationContext(WSRPTypeFactory.createRegistrationContext("handle"));
+ assertTrue(info.isRegistrationRequired());
+ assertTrue(info.isRegistrationValid());
+
+ // producer now requires a registration property
+ info.refresh(createServiceDescription(true, 1), producerId, true, true, true);
+ assertTrue(info.isRegistrationRequired());
+ assertTrue(info.isRegistrationDeterminedRequired());
+ assertFalse(info.isRegistrationValid());
+ assertFalse(info.isConsistentWithProducerExpectations());
+ assertFalse(info.isModifiedSinceLastRefresh());
+ }
+
+ private void checkRegistrationData(RegistrationData registrationData, String prop0Value)
+ {
+ assertNotNull(registrationData);
+ List<Property> properties = registrationData.getRegistrationProperties();
+ assertNotNull(properties);
+ assertEquals(1, properties.size());
+ Property property = properties.get(0);
+ assertEquals("prop0", property.getName());
+ assertEquals(prop0Value, property.getStringValue());
+ }
+
+ private ServiceDescription createServiceDescription(boolean requiresRegistration, int numberOfProperties)
+ {
+ return ServiceDescriptionBehavior.createServiceDescription(requiresRegistration, numberOfProperties);
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationInfoTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationPropertyTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationPropertyTestCase.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationPropertyTestCase.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,128 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.consumer;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 11941 $
+ * @since 2.6
+ */
+public class RegistrationPropertyTestCase extends TestCase
+{
+ private RegistrationProperty prop;
+
+ private Listener listener = new Listener();
+
+ private static final String VALUE = "value";
+ private static final String NEW_VALUE = "newValue";
+
+ private class Listener implements RegistrationProperty.PropertyChangeListener
+ {
+ boolean called;
+
+ public void propertyValueChanged(RegistrationProperty property, Object oldValue, Object newValue)
+ {
+ called = (prop == property) && VALUE.equals(oldValue) && NEW_VALUE.equals(newValue);
+ }
+ }
+
+ protected void setUp() throws Exception
+ {
+ prop = new RegistrationProperty("name", VALUE, "en", listener);
+ }
+
+ public void testGetters()
+ {
+ assertEquals("name", prop.getName());
+ assertEquals("value", prop.getValue());
+ assertEquals("en", prop.getLang());
+ assertNull(prop.isInvalid());
+ assertFalse(prop.isDeterminedInvalid());
+ assertNull(prop.getDescription());
+ assertEquals(RegistrationProperty.Status.UNCHECKED_VALUE, prop.getStatus());
+ }
+
+ public void testSetValue()
+ {
+ prop.setInvalid(Boolean.FALSE, RegistrationProperty.Status.VALID);
+
+ // we haven't changed the value, so the status shouldn't have changed
+ prop.setValue(VALUE);
+ assertEquals(Boolean.FALSE, prop.isInvalid());
+ assertEquals(RegistrationProperty.Status.VALID, prop.getStatus());
+
+ // we changed the value, status is now unknown
+ prop.setValue(NEW_VALUE);
+ assertEquals(NEW_VALUE, prop.getValue());
+ assertNull(prop.isInvalid());
+ assertEquals(RegistrationProperty.Status.UNCHECKED_VALUE, prop.getStatus());
+ }
+
+ public void testSetInvalid()
+ {
+ prop.setInvalid(Boolean.FALSE, RegistrationProperty.Status.VALID);
+ assertEquals(Boolean.FALSE, prop.isInvalid());
+ assertEquals(RegistrationProperty.Status.VALID, prop.getStatus());
+
+ // whatever the status, if we specifiy that the property is valid, its status should be VALID
+ prop.setInvalid(Boolean.FALSE, RegistrationProperty.Status.INEXISTENT);
+ assertEquals(Boolean.FALSE, prop.isInvalid());
+ assertEquals(RegistrationProperty.Status.VALID, prop.getStatus());
+
+ prop.setInvalid(Boolean.FALSE, null);
+ assertEquals(Boolean.FALSE, prop.isInvalid());
+ assertEquals(RegistrationProperty.Status.VALID, prop.getStatus());
+
+ try
+ {
+ prop.setInvalid(true, null);
+ fail("setInvalid should not accept a prop to be set invalid without a proper status");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+
+ try
+ {
+ prop.setInvalid(true, RegistrationProperty.Status.VALID);
+ fail("setInvalid should not accept a prop to be set invalid with a VALID status");
+ }
+ catch (IllegalArgumentException e)
+ {
+ // expected
+ }
+ }
+
+ public void testPropertyChangedEvent()
+ {
+ prop.setValue(VALUE);
+ assertFalse(listener.called);
+
+ prop.setValue(NEW_VALUE);
+ assertTrue(listener.called);
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationPropertyTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: 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 (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RenderHandlerTestCase.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.consumer;
+
+import junit.framework.TestCase;
+import org.gatein.common.net.URLTools;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 10507 $
+ * @since 2.6
+ */
+public class RenderHandlerTestCase extends TestCase
+{
+ public void testResourceURLRewriterProcessNonResource()
+ {
+ String markup = "<a href=\"/portal/portal/default/Test/EXAMPLE/EXAMPLE?action=1d&windowstate=&mode=" +
+ "&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());
+ assertEquals(markup, result);
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RenderHandlerTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/WSRPConsumerBaseTest.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/WSRPConsumerBaseTest.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/WSRPConsumerBaseTest.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,249 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.consumer;
+
+import junit.framework.TestCase;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.gatein.wsrp.test.ExtendedAssert;
+import org.gatein.wsrp.test.TestWSRPProducer;
+import org.gatein.wsrp.test.TestWSRPProducerImpl;
+import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.PortletManagementBehavior;
+import org.gatein.wsrp.test.protocol.v1.RegistrationBehavior;
+import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
+import org.gatein.wsrp.test.protocol.v1.TestProducerBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.BasicMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.BasicPortletManagementBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.BasicServiceDescriptionBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.EmptyMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.InitCookieNotRequiredMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.NullMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.PerGroupInitCookieMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.PerUserInitCookieMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.ResourceMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.SessionMarkupBehavior;
+import org.gatein.wsrp.test.support.MockConsumerRegistry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 11344 $
+ */
+public abstract class WSRPConsumerBaseTest extends TestCase
+{
+ private static Logger log = LoggerFactory.getLogger(WSRPConsumerBaseTest.class);
+
+ /** . */
+ private static final String TEST_PRODUCER_ID = "test_producer";
+
+ /** . */
+ protected TestWSRPProducer producer = new TestWSRPProducerImpl();
+
+ /** . */
+ protected WSRPConsumer consumer = new WSRPConsumerImpl();
+
+ private boolean strict = true;
+ private String sdClassName;
+ private String mClassName;
+ private String pmClassName;
+ private String rClassName;
+
+
+ public void setUp() throws Exception
+ {
+ // reset producer state
+ producer.reset();
+
+ // set the test producer identifier
+ consumer.getProducerInfo().setId(TEST_PRODUCER_ID);
+
+ // reset the behaviors
+ BehaviorRegistry registry = producer.getBehaviorRegistry();
+ setSDClassName(sdClassName);
+ setMClassName(mClassName);
+ setPMClassName(pmClassName);
+ setRClassName(rClassName);
+ registerAdditionalMarkupBehaviors(registry);
+
+ // use a fresh ConsumerRegistry
+ consumer.getProducerInfo().setRegistry(new MockConsumerRegistry());
+
+ // make sure we use clean producer info for each test
+ consumer.refreshProducerInfo();
+
+ // use cache to avoid un-necessary calls
+ consumer.getProducerInfo().setExpirationCacheSeconds(120);
+ }
+
+ protected void setRegistrationBehavior(RegistrationBehavior behavior)
+ {
+ producer.getBehaviorRegistry().setRegistrationBehavior(behavior);
+ }
+
+ protected void setServiceDescriptionBehavior(ServiceDescriptionBehavior behavior)
+ {
+ if (behavior == null)
+ {
+ log.info("Given service description behavior was null, using the default one instead!");
+ behavior = new BasicServiceDescriptionBehavior();
+ }
+
+ producer.getBehaviorRegistry().setServiceDescriptionBehavior(behavior);
+ }
+
+ protected void setPortletManagementBehavior(PortletManagementBehavior behavior)
+ {
+ BehaviorRegistry registry = producer.getBehaviorRegistry();
+
+ if (behavior == null)
+ {
+ log.info("Given portlet management behavior was null, using the default one instead!");
+ behavior = new BasicPortletManagementBehavior(registry);
+ }
+
+ registry.setPortletManagementBehavior(behavior);
+ }
+
+ public TestWSRPProducer getProducer()
+ {
+ return producer;
+ }
+
+ public void setProducer(TestWSRPProducer producer)
+ {
+ this.producer = producer;
+ }
+
+ public WSRPConsumer getConsumer()
+ {
+ return consumer;
+ }
+
+ public void setConsumer(WSRPConsumer consumer)
+ {
+ this.consumer = consumer;
+ }
+
+ public void testProducerId()
+ {
+ ExtendedAssert.assertEquals(TEST_PRODUCER_ID, consumer.getProducerId());
+ }
+
+ public void setSDClassName(String behaviorClassName)
+ {
+ sdClassName = behaviorClassName;
+ setServiceDescriptionBehavior(createBehavior(behaviorClassName, ServiceDescriptionBehavior.class));
+ }
+
+ public void setMClassName(String behaviorClassName)
+ {
+ mClassName = behaviorClassName;
+ if (behaviorClassName != null)
+ {
+ producer.getBehaviorRegistry().registerMarkupBehavior(createBehavior(behaviorClassName, MarkupBehavior.class));
+ }
+ }
+
+ public void setPMClassName(String behaviorClassName)
+ {
+ pmClassName = behaviorClassName;
+ setPortletManagementBehavior(createBehavior(behaviorClassName, PortletManagementBehavior.class));
+ }
+
+ public void setRClassName(String behaviorClassName)
+ {
+ rClassName = behaviorClassName;
+ setRegistrationBehavior(createBehavior(behaviorClassName, RegistrationBehavior.class));
+ }
+
+ public void setStrict(boolean strict)
+ {
+ this.strict = strict;
+ producer.usingStrictModeChangedTo(strict);
+ }
+
+ public boolean isStrict()
+ {
+ return strict;
+ }
+
+ private <T extends TestProducerBehavior> T createBehavior(String behaviorClassName, Class<T> expectedBehaviorClass)
+ {
+ if (behaviorClassName != null)
+ {
+ try
+ {
+ Class behaviorClass = getClass().getClassLoader().loadClass(behaviorClassName);
+ if (expectedBehaviorClass.isAssignableFrom(behaviorClass))
+ {
+ return expectedBehaviorClass.cast(behaviorClass.newInstance());
+ }
+ else
+ {
+ throw new IllegalArgumentException(behaviorClassName + " is not a " + expectedBehaviorClass.getSimpleName());
+ }
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new IllegalArgumentException("Could not find behavior: " + behaviorClassName, e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new IllegalArgumentException("Could not access behavior: " + behaviorClassName, e);
+ }
+ catch (InstantiationException e)
+ {
+ throw new IllegalArgumentException("Could not instantiate behavior: " + behaviorClassName, e);
+ }
+ }
+
+ return null;
+ }
+
+ protected void registerAdditionalMarkupBehaviors(BehaviorRegistry registry)
+ {
+ registry.registerMarkupBehavior(new BasicMarkupBehavior(registry));
+ registry.registerMarkupBehavior(new EmptyMarkupBehavior(registry));
+ registry.registerMarkupBehavior(new InitCookieNotRequiredMarkupBehavior(registry));
+ registry.registerMarkupBehavior(new PerGroupInitCookieMarkupBehavior(registry));
+ registry.registerMarkupBehavior(new PerUserInitCookieMarkupBehavior(registry));
+ registry.registerMarkupBehavior(new NullMarkupBehavior(registry));
+ registry.registerMarkupBehavior(new SessionMarkupBehavior(registry));
+ registry.registerMarkupBehavior(new ResourceMarkupBehavior(registry));
+ }
+
+ protected Set<String> getPortletHandles()
+ {
+ return producer.getBehaviorRegistry().getServiceDescriptionBehavior().getPortletHandles();
+ }
+
+ protected int getPortletNumber()
+ {
+ return producer.getBehaviorRegistry().getServiceDescriptionBehavior().getPortletNumber();
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/WSRPConsumerBaseTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/handler/RequestHeaderClientHandlerTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/handler/RequestHeaderClientHandlerTestCase.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/handler/RequestHeaderClientHandlerTestCase.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,180 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.handler;
+
+import junit.framework.TestCase;
+import org.apache.commons.httpclient.Cookie;
+import org.gatein.wsrp.consumer.ProducerSessionInformation;
+import org.gatein.wsrp.test.handler.MockSOAPMessage;
+import org.gatein.wsrp.test.handler.MockSOAPMessageContext;
+
+import javax.xml.soap.MimeHeaders;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.handler.RequestHeaderClientHandlerTestCase">Chris
+ * Laprun</a>
+ * @version $Revision: 10388 $
+ * @since 2.4
+ */
+public class RequestHeaderClientHandlerTestCase extends TestCase
+{
+ RequestHeaderClientHandler handler;
+
+
+ protected void setUp() throws Exception
+ {
+ handler = new RequestHeaderClientHandler();
+ RequestHeaderClientHandler.resetCurrentInfo();
+ }
+
+ public void testSimpleCookieHandleRequest()
+ {
+ MockSOAPMessage message = new MockSOAPMessage();
+ SOAPMessageContext msgContext = MockSOAPMessageContext.createMessageContext(message, getClass().getClassLoader());
+
+ handler.handleRequest(msgContext);
+ MimeHeaders headers = message.getMimeHeaders();
+ assertNull(headers.getHeader("Cookie"));
+
+ ProducerSessionInformation sessionInformation = new ProducerSessionInformation();
+ sessionInformation.setUserCookie(new Cookie[]{createCookie("name", "value", 1)});
+ RequestHeaderClientHandler.setCurrentInfo(null, sessionInformation);
+ handler.handleRequest(msgContext);
+
+ headers = message.getMimeHeaders();
+ String[] cookie = headers.getHeader("Cookie");
+ assertEquals(1, cookie.length);
+ assertEquals("name=value", cookie[0]);
+ }
+
+ public void testGroupCookieHandleRequest()
+ {
+ MockSOAPMessage message = new MockSOAPMessage();
+ SOAPMessageContext msgContext = MockSOAPMessageContext.createMessageContext(message, getClass().getClassLoader());
+
+ ProducerSessionInformation info = new ProducerSessionInformation();
+ info.setPerGroupCookies(true);
+ String groupId = "group";
+ info.setGroupCookieFor(groupId, new Cookie[]{createCookie("name", "value", 1)});
+ RequestHeaderClientHandler.setCurrentInfo(null, info);
+
+ try
+ {
+ handler.handleRequest(msgContext);
+ fail("group id hasn't been set so shouldn't be able to complete request");
+ }
+ catch (IllegalStateException e)
+ {
+ // expected
+ }
+
+ RequestHeaderClientHandler.setCurrentGroupId(groupId);
+
+ handler.handleRequest(msgContext);
+
+ MimeHeaders headers = message.getMimeHeaders();
+ String[] cookie = headers.getHeader("Cookie");
+ assertEquals(1, cookie.length);
+ assertEquals("name=value", cookie[0]);
+ }
+
+ public void testBothCookiesHandleRequest()
+ {
+ MockSOAPMessage message = new MockSOAPMessage();
+ SOAPMessageContext msgContext = MockSOAPMessageContext.createMessageContext(message, getClass().getClassLoader());
+
+ ProducerSessionInformation info = new ProducerSessionInformation();
+ info.setPerGroupCookies(true);
+ String groupId = "group";
+ info.setGroupCookieFor(groupId, new Cookie[]{createCookie("name", "value", 1)});
+ info.setUserCookie(new Cookie[]{createCookie("usercookie", "uservalue", 1)});
+ RequestHeaderClientHandler.setCurrentInfo(groupId, info);
+
+
+ handler.handleRequest(msgContext);
+ MimeHeaders headers = message.getMimeHeaders();
+ String[] cookie = headers.getHeader("Cookie");
+ assertEquals(1, cookie.length);
+ assertEquals("name=value,usercookie=uservalue", cookie[0]);
+ }
+
+ public void testCookieWithoutInitHandleResponse()
+ {
+ MockSOAPMessage message = new MockSOAPMessage();
+ SOAPMessageContext msgContext = MockSOAPMessageContext.createMessageContext(message, getClass().getClassLoader());
+ MimeHeaders headers = new MimeHeaders();
+ headers.setHeader("Set-Cookie", "name=value");
+ message.setMimeHeaders(headers);
+
+ handler.handleResponse(msgContext);
+ ProducerSessionInformation info = RequestHeaderClientHandler.getCurrentProducerSessionInformation();
+ assertEquals("name=value", info.getUserCookie());
+ assertFalse(info.isInitCookieDone());
+ assertFalse(info.isPerGroupCookies());
+ }
+
+ public void testMultipleCookiesInResponse()
+ {
+ MockSOAPMessage message = new MockSOAPMessage();
+ SOAPMessageContext msgContext = MockSOAPMessageContext.createMessageContext(message, getClass().getClassLoader());
+ MimeHeaders headers = new MimeHeaders();
+ headers.addHeader("Set-Cookie", "name1=value1");
+ headers.addHeader("Set-Cookie", "name2=value2");
+ headers.addHeader("Set-Cookie", "name3=value3");
+ message.setMimeHeaders(headers);
+
+ handler.handleResponse(msgContext);
+ ProducerSessionInformation info = RequestHeaderClientHandler.getCurrentProducerSessionInformation();
+ assertEquals("name1=value1,name2=value2,name3=value3", info.getUserCookie());
+ }
+
+ public void testCurrentInfo()
+ {
+ assertNull(RequestHeaderClientHandler.getCurrentProducerSessionInformation());
+ assertNull(RequestHeaderClientHandler.getCurrentGroupId());
+
+ try
+ {
+ RequestHeaderClientHandler.setCurrentGroupId("foo");
+ fail("Current info was not set, shouldn't have thrown an IllegalStateException");
+ }
+ catch (IllegalStateException e)
+ {
+ // expected
+ }
+
+ ProducerSessionInformation info = new ProducerSessionInformation();
+ String groupId = "group";
+ RequestHeaderClientHandler.setCurrentInfo(groupId, info);
+
+ assertSame(info, RequestHeaderClientHandler.getCurrentProducerSessionInformation());
+ assertEquals(groupId, RequestHeaderClientHandler.getCurrentGroupId());
+ }
+
+ private Cookie createCookie(String name, String value, int secondsBeforeExpiration)
+ {
+ return new Cookie("domain", name, value, "path", secondsBeforeExpiration, false);
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/handler/RequestHeaderClientHandlerTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/InteropServiceDescriptionTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/InteropServiceDescriptionTestCase.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/InteropServiceDescriptionTestCase.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,79 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.wsrp.protocol.v1;
+
+import org.gatein.pc.api.Portlet;
+import org.gatein.pc.api.PortletInvokerException;
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.gatein.wsrp.test.ExtendedAssert;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class InteropServiceDescriptionTestCase extends V1ConsumerBaseTest
+{
+ public InteropServiceDescriptionTestCase() throws Exception
+ {
+ super();
+ }
+
+ @Override
+ public void setUp() throws Exception
+ {
+ setStrict(false);
+ super.setUp();
+ }
+
+ public void testUsesRelaxedMode()
+ {
+ ExtendedAssert.assertFalse(isStrict());
+ }
+
+ public void testGetPortlets() throws PortletInvokerException
+ {
+ //invoke consumer
+ Set returnedPortlets = consumer.getPortlets();
+
+ int portletNumber = returnedPortlets.size();
+ ExtendedAssert.assertEquals(getPortletNumber(), portletNumber);
+ Set<String> handles = getPortletHandles();
+ Set<String> consumerHandles = new HashSet<String>(portletNumber);
+ for (Object o : returnedPortlets)
+ {
+ Portlet portlet = (Portlet)o;
+ consumerHandles.add(portlet.getContext().getId());
+ }
+
+ ExtendedAssert.assertTrue(handles.containsAll(consumerHandles));
+ }
+
+ @Override
+ protected void registerAdditionalMarkupBehaviors(BehaviorRegistry registry)
+ {
+ // do nothing so that we don't pollute the service description with markup behaviors
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/InteropServiceDescriptionTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,301 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.protocol.v1;
+
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.OpaqueStateString;
+import org.gatein.pc.api.PortletContext;
+import org.gatein.pc.api.PortletInvokerException;
+import org.gatein.pc.api.WindowState;
+import org.gatein.pc.api.invocation.ActionInvocation;
+import org.gatein.pc.api.invocation.RenderInvocation;
+import org.gatein.pc.api.invocation.response.ErrorResponse;
+import org.gatein.pc.api.invocation.response.FragmentResponse;
+import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
+import org.gatein.pc.api.invocation.response.UpdateNavigationalStateResponse;
+import org.gatein.pc.portlet.impl.spi.AbstractInstanceContext;
+import org.gatein.pc.portlet.impl.spi.AbstractPortalContext;
+import org.gatein.pc.portlet.impl.spi.AbstractSecurityContext;
+import org.gatein.pc.portlet.impl.spi.AbstractUserContext;
+import org.gatein.pc.portlet.impl.spi.AbstractWindowContext;
+import org.gatein.wsrp.consumer.ProducerSessionInformation;
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.gatein.wsrp.test.ExtendedAssert;
+import org.gatein.wsrp.test.protocol.v1.behaviors.BasicMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.EmptyMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.GroupedPortletsServiceDescriptionBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.InitCookieMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.InitCookieNotRequiredMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.NullMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.PerGroupInitCookieMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.PerUserInitCookieMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.ResourceMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.SessionMarkupBehavior;
+import org.gatein.wsrp.test.support.MockHttpServletRequest;
+import org.gatein.wsrp.test.support.TestPortletInvocationContext;
+import org.oasis.wsrp.v1.CookieProtocol;
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.InvalidHandle;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.ItemDescription;
+import org.oasis.wsrp.v1.ModelDescription;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.PortletDescription;
+import org.oasis.wsrp.v1.ResourceList;
+
+import javax.servlet.http.HttpSession;
+import javax.xml.ws.Holder;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 11320 $
+ * @since 2.4 (May 4, 2006)
+ */
+public class MarkupTestCase extends V1ConsumerBaseTest
+{
+ public MarkupTestCase() throws Exception
+ {
+ super();
+ }
+
+ public void testInvalidHandle()
+ {
+ try
+ {
+ consumer.invoke(createRenderInvocation("Invalid portlet handle"));
+ ExtendedAssert.fail("Should have failed on invalid portlet handle");
+ }
+ catch (PortletInvokerException expected)
+ {
+ // expected
+ }
+ }
+
+ public void testEmptyRender() throws Exception
+ {
+ checkRenderResult(consumer.invoke(createRenderInvocation(EmptyMarkupBehavior.PORTLET_HANDLE)), "");
+ }
+
+ public void testNullAction() throws Exception
+ {
+ ExtendedAssert.assertTrue(consumer.invoke(createActionInvocation(NullMarkupBehavior.PORTLET_HANDLE)) instanceof ErrorResponse);
+ }
+
+ public void testNullRender() throws Exception
+ {
+ ExtendedAssert.assertTrue(consumer.invoke(createRenderInvocation(NullMarkupBehavior.PORTLET_HANDLE)) instanceof ErrorResponse);
+ }
+
+ public void testRender() throws Exception
+ {
+ RenderInvocation render = createRenderInvocation(BasicMarkupBehavior.PORTLET_HANDLE, Mode.EDIT,
+ WindowState.NORMAL, "someNS");
+ FragmentResponse result = checkRenderResult(consumer.invoke(render), "portlet1:edit:normal:someNS");
+ ExtendedAssert.assertEquals(15, result.getCacheControl().getExpirationSecs());
+
+ render = createRenderInvocation(SessionMarkupBehavior.PORTLET_HANDLE);
+ result = checkRenderResult(consumer.invoke(render), "portlet2:0:view:maximized");
+ ExtendedAssert.assertEquals(0, result.getCacheControl().getExpirationSecs());
+ }
+
+ public void testAction() throws Exception
+ {
+ ActionInvocation action = createActionInvocation(BasicMarkupBehavior.PORTLET_HANDLE);
+
+ PortletInvocationResponse response = consumer.invoke(action);
+ ExtendedAssert.assertNotNull(response);
+ ExtendedAssert.assertTrue("Was expecting a RenderResponse. Got: " + response, response instanceof UpdateNavigationalStateResponse);
+ UpdateNavigationalStateResponse render = (UpdateNavigationalStateResponse)response;
+ ExtendedAssert.assertEquals(BasicMarkupBehavior.NS, render.getNavigationalState().getStringValue());
+ }
+
+ public void testSessionHandling() throws Exception
+ {
+ RenderInvocation render = createRenderInvocation(SessionMarkupBehavior.PORTLET_HANDLE);
+
+ PortletInvocationResponse response = consumer.invoke(render);
+
+ checkRenderResult(response, "portlet2:0:view:maximized");
+
+ // checking session information
+ ProducerSessionInformation sessionInfo = consumer.getProducerSessionInformationFrom(render);
+ String sessionId = sessionInfo.getSessionIdForPortlet(SessionMarkupBehavior.PORTLET_HANDLE);
+ ExtendedAssert.assertNotNull(sessionId);
+ ExtendedAssert.assertEquals(SessionMarkupBehavior.SESSION_ID, sessionId);
+ ExtendedAssert.assertFalse(sessionInfo.isPerGroupCookies());
+ ExtendedAssert.assertFalse(sessionInfo.isInitCookieDone());
+
+ response = consumer.invoke(render);
+ checkRenderResult(response, "portlet2:1:view:maximized");
+ }
+
+ public void testInitCookieNotCalledWhenNotNeeded() throws Exception
+ {
+ String handle = InitCookieNotRequiredMarkupBehavior.INIT_COOKIE_NOT_REQUIRED_HANDLE;
+ InitCookieMarkupBehavior behavior = (InitCookieMarkupBehavior)producer.getBehaviorRegistry().getMarkupBehaviorFor(handle);
+
+ ProducerSessionInformation sessionInfo = commonInitCookieTest(handle, behavior, null);
+
+ ExtendedAssert.assertNotNull(sessionInfo);
+ ExtendedAssert.assertFalse(sessionInfo.isPerGroupCookies());
+ ExtendedAssert.assertFalse(sessionInfo.isInitCookieDone());
+
+ ExtendedAssert.assertEquals(0, behavior.getInitCookieCallCount());
+ }
+
+ public void testInitCookiePerUser() throws PortletInvokerException, InvalidHandle
+ {
+ String handle = PerUserInitCookieMarkupBehavior.PER_USER_INIT_COOKIE_HANDLE;
+ InitCookieMarkupBehavior behavior = (InitCookieMarkupBehavior)producer.getBehaviorRegistry().getMarkupBehaviorFor(handle);
+
+ ProducerSessionInformation sessionInfo = commonInitCookieTest(handle, behavior, CookieProtocol.PER_USER);
+
+ ExtendedAssert.assertFalse(sessionInfo.isPerGroupCookies());
+ ExtendedAssert.assertTrue(sessionInfo.isInitCookieDone());
+ ExtendedAssert.assertNotNull(sessionInfo.getUserCookie());
+
+ ExtendedAssert.assertEquals(1, behavior.getInitCookieCallCount());
+ }
+
+ public void testInitCookiePerGroup() throws PortletInvokerException, InvalidHandle, OperationFailed, InvalidRegistration
+ {
+ BehaviorRegistry registry = producer.getBehaviorRegistry();
+
+ // need to setup with a specific service description behavior: we wrap the current service description
+ Holder<List<PortletDescription>> offeredPortlets = new Holder<List<PortletDescription>>();
+ registry.getServiceDescriptionBehavior().getServiceDescription(null, null, new Holder<Boolean>(),
+ offeredPortlets, new Holder<List<ItemDescription>>(),
+ new Holder<List<ItemDescription>>(), new Holder<List<ItemDescription>>(), new Holder<List<ItemDescription>>(),
+ new Holder<CookieProtocol>(), new Holder<ModelDescription>(), new Holder<List<String>>(),
+ new Holder<ResourceList>(), new Holder<List<Extension>>());
+ setServiceDescriptionBehavior(new GroupedPortletsServiceDescriptionBehavior(offeredPortlets.value));
+
+ String handle = PerGroupInitCookieMarkupBehavior.PER_GROUP_INIT_COOKIE_HANDLE;
+ InitCookieMarkupBehavior behavior = (InitCookieMarkupBehavior)registry.getMarkupBehaviorFor(handle);
+
+ ProducerSessionInformation sessionInfo = commonInitCookieTest(handle, behavior, CookieProtocol.PER_GROUP);
+ ExtendedAssert.assertTrue(sessionInfo.isPerGroupCookies());
+ ExtendedAssert.assertTrue(sessionInfo.isInitCookieDone());
+ ExtendedAssert.assertNull(sessionInfo.getUserCookie());
+
+ ExtendedAssert.assertEquals(3, behavior.getInitCookieCallCount());
+ }
+
+ public void testResource() throws PortletInvokerException
+ {
+ RenderInvocation render = createRenderInvocation(ResourceMarkupBehavior.PORTLET_HANDLE);
+ PortletInvocationResponse response = consumer.invoke(render);
+
+ checkRenderResult(response, "<img src='http://localhost:8080/test-resource-portlet/gif/logo.gif'/>");
+ }
+
+ private ProducerSessionInformation commonInitCookieTest(String handle, InitCookieMarkupBehavior behavior, CookieProtocol cookieProtocol)
+ throws PortletInvokerException
+ {
+ RenderInvocation render = createRenderInvocation(handle);
+ TestPortletInvocationContext invocationContext = (TestPortletInvocationContext)render.getContext();
+ HttpSession session = invocationContext.getClientRequest().getSession();
+
+ // set init cookie requirement
+ producer.setRequiresInitCookie(cookieProtocol);
+
+ // tell the producer which markup behavior we want to use
+ producer.setCurrentMarkupBehaviorHandle(handle);
+
+ render = createRenderInvocation(handle, invocationContext);
+
+ ExtendedAssert.assertEquals(0, behavior.getInitCookieCallCount());
+
+ consumer.invoke(render);
+
+ ExtendedAssert.assertEquals(cookieProtocol, consumer.getProducerInfo().getRequiresInitCookie());
+
+ return consumer.getProducerSessionInformationFrom(session);
+ }
+
+ private FragmentResponse checkRenderResult(PortletInvocationResponse response, String markup)
+ {
+ ExtendedAssert.assertNotNull(response);
+ if (response instanceof ErrorResponse)
+ {
+ ErrorResponse errorResponse = (ErrorResponse)response;
+ ExtendedAssert.fail("Got an ErrorResponse instead of a FragmentResponse. Message: " + errorResponse.getMessage());
+ }
+ ExtendedAssert.assertTrue("Was expecting a FragmentResponse. Got: " + response, response instanceof FragmentResponse);
+ FragmentResponse fragment = (FragmentResponse)response;
+ ExtendedAssert.assertEquals(markup, fragment.getChars().toString());
+ return fragment;
+ }
+
+ private RenderInvocation createRenderInvocation(String portletHandle)
+ {
+ return createRenderInvocation(portletHandle, null);
+ }
+
+ private RenderInvocation createRenderInvocation(String portletHandle, TestPortletInvocationContext invocationContext)
+ {
+ return createRenderInvocation(portletHandle, Mode.VIEW, WindowState.MAXIMIZED, null, invocationContext);
+ }
+
+ private RenderInvocation createRenderInvocation(String portletHandle, Mode mode, WindowState state, String navigationalState)
+ {
+ return createRenderInvocation(portletHandle, mode, state, navigationalState, null);
+ }
+
+ private RenderInvocation createRenderInvocation(String portletHandle, Mode mode, WindowState state, String navigationalState, TestPortletInvocationContext invocationContext)
+ {
+ if (invocationContext == null)
+ {
+ invocationContext = new TestPortletInvocationContext();
+ }
+
+ RenderInvocation render = new RenderInvocation(invocationContext);
+ render.setTarget(PortletContext.createPortletContext(portletHandle));
+ render.setMode(mode);
+ render.setWindowState(state);
+ if (navigationalState != null)
+ {
+ render.setNavigationalState(new OpaqueStateString(navigationalState));
+ }
+
+ render.setInstanceContext(new AbstractInstanceContext(portletHandle));
+ render.setSecurityContext(new AbstractSecurityContext(MockHttpServletRequest.createMockRequest(null)));
+ render.setUserContext(new AbstractUserContext());
+ render.setWindowContext(new AbstractWindowContext("windowcontext"));
+ render.setPortalContext(new AbstractPortalContext());
+ return render;
+ }
+
+ private ActionInvocation createActionInvocation(String portletHandle)
+ {
+ TestPortletInvocationContext ac = new TestPortletInvocationContext();
+ ActionInvocation action = new ActionInvocation(ac);
+ action.setInstanceContext(new AbstractInstanceContext(portletHandle));
+ action.setSecurityContext(new AbstractSecurityContext(MockHttpServletRequest.createMockRequest(null)));
+ action.setUserContext(new AbstractUserContext());
+ action.setTarget(PortletContext.createPortletContext(portletHandle));
+ return action;
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/MarkupTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/PortletManagementTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/PortletManagementTestCase.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/PortletManagementTestCase.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,160 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.protocol.v1;
+
+import org.gatein.pc.api.Portlet;
+import org.gatein.pc.api.PortletContext;
+import org.gatein.pc.api.PortletInvokerException;
+import org.gatein.pc.api.PortletStateType;
+import org.gatein.pc.api.state.DestroyCloneFailure;
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.gatein.wsrp.test.ExtendedAssert;
+import org.gatein.wsrp.test.protocol.v1.behaviors.BasicMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.BasicPortletManagementBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.DestroyClonesPortletManagementBehavior;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class PortletManagementTestCase extends V1ConsumerBaseTest
+{
+ public PortletManagementTestCase() throws Exception
+ {
+ }
+
+ /*public void testClone() throws Exception
+ {
+ PortletContext original = PortletContext.createPortletContext(BasicMarkupBehavior.PORTLET_HANDLE);
+ PortletContext clone = consumer.createClone(original);
+ ExtendedAssert.assertNotNull(clone);
+ ExtendedAssert.assertFalse(original.equals(clone));
+ ExtendedAssert.assertEquals(BasicPortletManagementBehavior.CLONED_HANDLE, clone.getId());
+
+ Portlet originalPortlet = consumer.getPortlet(original);
+ Portlet clonePortlet = consumer.getPortlet(clone);
+ ExtendedAssert.assertNotNull(clonePortlet);
+ ExtendedAssert.assertFalse(originalPortlet.getContext().equals(clonePortlet.getContext()));
+
+ // information about the portlet should be the same
+ MetaInfo originalInfo = originalPortlet.getInfo().getMeta();
+ MetaInfo cloneInfo = clonePortlet.getInfo().getMeta();
+ ExtendedAssert.assertEquals(originalInfo.getMetaValue(MetaInfo.TITLE), cloneInfo.getMetaValue(MetaInfo.TITLE));
+ ExtendedAssert.assertEquals(originalInfo.getMetaValue(MetaInfo.DESCRIPTION), cloneInfo.getMetaValue(MetaInfo.DESCRIPTION));
+ }
+
+ public void testGetSetProperties() throws Exception
+ {
+ PortletContext original = PortletContext.createPortletContext(BasicMarkupBehavior.PORTLET_HANDLE);
+ PropertyMap props = consumer.getProperties(original);
+ checkProperties(props, BasicPortletManagementBehavior.PROPERTY_VALUE);
+
+ PortletContext clone = consumer.createClone(original);
+ props = consumer.getProperties(clone);
+ checkProperties(props, BasicPortletManagementBehavior.PROPERTY_VALUE);
+
+ consumer.setProperties(clone, new PropertyChange[]
+ {
+ PropertyChange.newUpdate(BasicPortletManagementBehavior.PROPERTY_NAME,
+ new StringValue(BasicPortletManagementBehavior.PROPERTY_NEW_VALUE))
+ });
+ checkProperties(consumer.getProperties(clone), BasicPortletManagementBehavior.PROPERTY_NEW_VALUE);
+
+ consumer.setProperties(clone, new PropertyChange[]
+ {
+ PropertyChange.newReset(BasicPortletManagementBehavior.PROPERTY_NAME)
+ });
+ checkProperties(consumer.getProperties(clone), BasicPortletManagementBehavior.PROPERTY_VALUE);
+ }
+
+ private void checkProperties(PropertyMap props, String expectedValue)
+ {
+ ExtendedAssert.assertNotNull(props);
+ ExtendedAssert.assertEquals(1, props.size());
+ ExtendedAssert.assertEquals(expectedValue,
+ props.getProperty(BasicPortletManagementBehavior.PROPERTY_NAME).asString());
+ }*/
+
+ public void testDestroyClones() throws Exception
+ {
+ // switch the behavior for portlet management
+ BehaviorRegistry behaviorRegistry = producer.getBehaviorRegistry();
+ behaviorRegistry.setPortletManagementBehavior(new DestroyClonesPortletManagementBehavior(behaviorRegistry));
+
+ PortletContext original = PortletContext.createPortletContext(BasicMarkupBehavior.PORTLET_HANDLE);
+ PortletContext clone = consumer.createClone(PortletStateType.OPAQUE, original);
+ ExtendedAssert.assertNotNull(clone);
+ Portlet portlet = consumer.getPortlet(clone);
+ ExtendedAssert.assertNotNull(portlet);
+ ExtendedAssert.assertEquals(BasicPortletManagementBehavior.CLONED_HANDLE, portlet.getContext().getId());
+
+ List clones = new ArrayList(1);
+ clones.add(clone);
+ List result = consumer.destroyClones(clones);
+ ExtendedAssert.assertTrue(result.isEmpty());
+ try
+ {
+ consumer.getPortlet(clone);
+ ExtendedAssert.fail("Should have failed: clone should not exist anymore!");
+ }
+ catch (PortletInvokerException expected)
+ {
+ }
+
+ // re-create clone and try again with an added invalid portlet context
+ clone = consumer.createClone(PortletStateType.OPAQUE, original);
+ PortletContext invalidContext = PortletContext.createPortletContext("invalid");
+ clones.add(invalidContext);
+ result = consumer.destroyClones(clones);
+ ExtendedAssert.assertEquals(1, result.size());
+ DestroyCloneFailure failure = (DestroyCloneFailure)result.get(0);
+ ExtendedAssert.assertEquals("invalid", failure.getPortletId());
+ try
+ {
+ consumer.getPortlet(clone);
+ ExtendedAssert.fail("Should have failed: clone should not exist anymore!");
+ }
+ catch (PortletInvokerException expected)
+ {
+ }
+ }
+
+ /*public void testInvalidSetProperties() throws Exception
+ {
+ PortletContext original = PortletContext.createPortletContext(BasicMarkupBehavior.PORTLET_HANDLE);
+ try
+ {
+ consumer.setProperties(original, null);
+ ExtendedAssert.fail("Shouldn't be possible to set properties with null changes");
+ }
+ catch (IllegalArgumentException expected)
+ {
+ //expected
+ }
+ }*/
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/PortletManagementTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/ServiceDescriptionTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/ServiceDescriptionTestCase.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/ServiceDescriptionTestCase.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.protocol.v1;
+
+import org.gatein.pc.api.Portlet;
+import org.gatein.pc.api.PortletContext;
+import org.gatein.wsrp.test.ExtendedAssert;
+import org.gatein.wsrp.test.protocol.v1.behaviors.BasicMarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.behaviors.SessionMarkupBehavior;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 11320 $
+ * @since 2.4
+ */
+public class ServiceDescriptionTestCase extends InteropServiceDescriptionTestCase
+{
+
+ public ServiceDescriptionTestCase() throws Exception
+ {
+ super();
+ }
+
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+
+ // use strict mode
+ setStrict(true);
+ }
+
+ public void testUsesRelaxedMode()
+ {
+ ExtendedAssert.assertTrue(isStrict());
+ }
+
+ public void testGetPortlet() throws Exception
+ {
+ //obtain one portlet
+ Portlet portlet = consumer.getPortlet(PortletContext.createPortletContext(BasicMarkupBehavior.PORTLET_HANDLE));
+ checkPortlet(portlet, "", BasicMarkupBehavior.PORTLET_HANDLE);
+
+ portlet = consumer.getPortlet(PortletContext.createPortletContext(SessionMarkupBehavior.PORTLET_HANDLE));
+ checkPortlet(portlet, "2", SessionMarkupBehavior.PORTLET_HANDLE);
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/ServiceDescriptionTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/V1ConsumerBaseTest.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/V1ConsumerBaseTest.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/V1ConsumerBaseTest.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.protocol.v1;
+
+import org.gatein.pc.api.Portlet;
+import org.gatein.pc.api.info.MetaInfo;
+import org.gatein.wsrp.consumer.WSRPConsumerBaseTest;
+import org.gatein.wsrp.test.ExtendedAssert;
+import org.gatein.wsrp.test.protocol.v1.TestProducerBehavior;
+
+/**
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 11320 $
+ */
+public class V1ConsumerBaseTest extends WSRPConsumerBaseTest
+{
+ public V1ConsumerBaseTest() throws Exception
+ {
+ }
+
+ protected void checkPortlet(Portlet portlet, String suffix, String handle)
+ {
+ MetaInfo meta = portlet.getInfo().getMeta();
+ ExtendedAssert.assertEquals(handle, portlet.getContext().getId());
+ ExtendedAssert.assertEquals(TestProducerBehavior.SAMPLE_DESCRIPTION + suffix, TestProducerBehavior.extractString(meta.getMetaValue(MetaInfo.DESCRIPTION)));
+ ExtendedAssert.assertEquals(TestProducerBehavior.SAMPLE_TITLE + suffix, TestProducerBehavior.extractString(meta.getMetaValue(MetaInfo.TITLE)));
+ ExtendedAssert.assertEquals(TestProducerBehavior.SAMPLE_SHORTTITLE + suffix, TestProducerBehavior.extractString(meta.getMetaValue(MetaInfo.SHORT_TITLE)));
+ ExtendedAssert.assertEquals(TestProducerBehavior.SAMPLE_DISPLAYNAME + suffix, TestProducerBehavior.extractString(meta.getMetaValue(MetaInfo.DISPLAY_NAME)));
+ ExtendedAssert.assertEquals(TestProducerBehavior.SAMPLE_KEYWORD + suffix, TestProducerBehavior.extractString(meta.getMetaValue(MetaInfo.KEYWORDS)));
+ }
+
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/protocol/v1/V1ConsumerBaseTest.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/BehaviorRegistry.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/BehaviorRegistry.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/BehaviorRegistry.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,115 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test;
+
+import org.gatein.wsrp.WSRPExceptionFactory;
+import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.PortletManagementBehavior;
+import org.gatein.wsrp.test.protocol.v1.RegistrationBehavior;
+import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
+import org.oasis.wsrp.v1.InvalidHandle;
+import org.oasis.wsrp.v1.InvalidHandleFault;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 9360 $
+ * @since 2.6
+ */
+public class BehaviorRegistry
+{
+ private final Map<String, MarkupBehavior> behaviors = new HashMap<String, MarkupBehavior>();
+ private PortletManagementBehavior portletManagementBehavior;
+ private ServiceDescriptionBehavior serviceDescriptionBehavior;
+ private RegistrationBehavior registrationBehavior;
+
+ public ServiceDescriptionBehavior getServiceDescriptionBehavior()
+ {
+ // this is required since the consumer will try to access the producer as soon as it's started and the test
+ // producer will not be properly setup at that time since it's set up in the test's setUp method...
+ if (serviceDescriptionBehavior == null)
+ {
+ return ServiceDescriptionBehavior.DEFAULT;
+ }
+
+ return serviceDescriptionBehavior;
+ }
+
+ public void clear()
+ {
+ behaviors.clear();
+ }
+
+ public MarkupBehavior getMarkupBehaviorFor(String handle) throws InvalidHandle
+ {
+ if (behaviors.containsKey(handle))
+ {
+ return behaviors.get(handle);
+ }
+ throw WSRPExceptionFactory.<InvalidHandle, InvalidHandleFault>throwWSException(WSRPExceptionFactory.INVALID_HANDLE,
+ "There is no registered MarkupBehavior for handle '" + handle + "'", null);
+ }
+
+ public void registerMarkupBehavior(MarkupBehavior behavior)
+ {
+ for (String handle : behavior.getSupportedHandles())
+ {
+ MarkupBehavior existing = behaviors.get(handle);
+ if (existing != null)
+ {
+ throw new IllegalArgumentException("Cannot register behavior " + behavior.getClass().getName()
+ + " because it uses a handle '" + handle + "' that's already associated with behavior "
+ + existing.getClass().getName());
+ }
+ behaviors.put(handle, behavior);
+ }
+ }
+
+ public PortletManagementBehavior getPortletManagementBehavior()
+ {
+ return portletManagementBehavior;
+ }
+
+ public void setPortletManagementBehavior(PortletManagementBehavior portletManagementBehavior)
+ {
+ this.portletManagementBehavior = portletManagementBehavior;
+ }
+
+ public void setServiceDescriptionBehavior(ServiceDescriptionBehavior serviceDescriptionBehavior)
+ {
+ this.serviceDescriptionBehavior = serviceDescriptionBehavior;
+ }
+
+ public RegistrationBehavior getRegistrationBehavior()
+ {
+ return registrationBehavior;
+ }
+
+ public void setRegistrationBehavior(RegistrationBehavior registrationBehavior)
+ {
+ this.registrationBehavior = registrationBehavior;
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/BehaviorRegistry.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducer.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducer.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducer.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test;
+
+import org.oasis.wsrp.v1.CookieProtocol;
+
+/**
+ * Exposes WSPRProducer test implementation methods - we inject what it returns
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw Dawidowicz</a>
+ * @version $Revision: 10610 $
+ */
+public interface TestWSRPProducer
+{
+ /** Resets any currently held state. */
+ void reset();
+
+ BehaviorRegistry getBehaviorRegistry();
+
+ /**
+ * Sets the currently used portlet handle identifying the MarkupBehavior we're using. This is needed to be able to
+ * dispatch calls to initCookie to the proper behavior.
+ *
+ * @param handle
+ */
+ void setCurrentMarkupBehaviorHandle(String handle);
+
+ void setRequiresInitCookie(CookieProtocol requiresInitCookie);
+
+ void usingStrictModeChangedTo(boolean strictMode);
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducer.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducerImpl.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducerImpl.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducerImpl.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,256 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test;
+
+import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.PortletManagementBehavior;
+import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
+import org.oasis.wsrp.v1.AccessDenied;
+import org.oasis.wsrp.v1.CookieProtocol;
+import org.oasis.wsrp.v1.DestroyFailed;
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.InconsistentParameters;
+import org.oasis.wsrp.v1.InteractionParams;
+import org.oasis.wsrp.v1.InvalidCookie;
+import org.oasis.wsrp.v1.InvalidHandle;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.InvalidSession;
+import org.oasis.wsrp.v1.InvalidUserCategory;
+import org.oasis.wsrp.v1.ItemDescription;
+import org.oasis.wsrp.v1.MarkupContext;
+import org.oasis.wsrp.v1.MarkupParams;
+import org.oasis.wsrp.v1.MissingParameters;
+import org.oasis.wsrp.v1.ModelDescription;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.PortletContext;
+import org.oasis.wsrp.v1.PortletDescription;
+import org.oasis.wsrp.v1.PortletStateChangeRequired;
+import org.oasis.wsrp.v1.Property;
+import org.oasis.wsrp.v1.PropertyList;
+import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.RegistrationData;
+import org.oasis.wsrp.v1.ResetProperty;
+import org.oasis.wsrp.v1.ResourceList;
+import org.oasis.wsrp.v1.RuntimeContext;
+import org.oasis.wsrp.v1.SessionContext;
+import org.oasis.wsrp.v1.UnsupportedLocale;
+import org.oasis.wsrp.v1.UnsupportedMimeType;
+import org.oasis.wsrp.v1.UnsupportedMode;
+import org.oasis.wsrp.v1.UnsupportedWindowState;
+import org.oasis.wsrp.v1.UpdateResponse;
+import org.oasis.wsrp.v1.UserContext;
+import org.oasis.wsrp.v1.WSRPV1MarkupPortType;
+import org.oasis.wsrp.v1.WSRPV1PortletManagementPortType;
+import org.oasis.wsrp.v1.WSRPV1RegistrationPortType;
+import org.oasis.wsrp.v1.WSRPV1ServiceDescriptionPortType;
+
+import javax.jws.WebParam;
+import javax.xml.ws.Holder;
+import java.util.List;
+
+/**
+ * This is dummy clone of org.jboss.portal.wsrp.producer.WSRPProducerImpl customizable from client side. Just for
+ * consumer implementation testing purposes.
+ *
+ * @author <a href="mailto:Boleslaw.Dawidowicz@jboss.com">Boleslaw Dawidowicz</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 12020 $
+ * @since 2.4
+ */
+public class TestWSRPProducerImpl implements TestWSRPProducer, WSRPV1MarkupPortType, WSRPV1PortletManagementPortType, WSRPV1RegistrationPortType, WSRPV1ServiceDescriptionPortType
+{
+ private int sessionExpirationTime = 600;
+
+ private CookieProtocol requiresInitCookie = CookieProtocol.NONE;
+
+ private BehaviorRegistry behaviorRegistry = new BehaviorRegistry();
+
+ public static final String USER_COOKIE = "cookie";
+
+ private String currentMarkupBehaviorHandle;
+
+ private boolean strict = true;
+
+ public TestWSRPProducerImpl()
+ {
+ reset();
+ }
+
+ public BehaviorRegistry getBehaviorRegistry()
+ {
+ return behaviorRegistry;
+ }
+
+ public void setCurrentMarkupBehaviorHandle(String handle)
+ {
+ currentMarkupBehaviorHandle = handle;
+ }
+
+ public void reset()
+ {
+ requiresInitCookie = null;
+ currentMarkupBehaviorHandle = null;
+ behaviorRegistry.clear();
+ }
+
+ private MarkupBehavior getMarkupBehaviorFor(String portletHandle) throws InvalidHandle
+ {
+ return behaviorRegistry.getMarkupBehaviorFor(portletHandle);
+ }
+
+ private ServiceDescriptionBehavior getServiceDescriptionBehavior()
+ {
+ return behaviorRegistry.getServiceDescriptionBehavior();
+ }
+
+ public PortletManagementBehavior getPortletManagementBehavior()
+ {
+ return behaviorRegistry.getPortletManagementBehavior();
+ }
+
+ // ServiceDescription implementation ********************************************************************************
+
+
+ public void getServiceDescription(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "desiredLocales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales, @WebParam(mode = WebParam.Mode.OUT, name = "requiresRegistration", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<Boolean> requiresRegistration, @WebParam(mode = WebParam.Mode.OUT, name = "offeredPortlets", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<PortletDescription>> offeredPortlets, @WebParam(mode = WebParam.Mode.OUT, name = "userCategoryDescriptions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>> userCategoryDescriptions, @WebParam(mode = WebParam.Mode.OUT, name = "customUserProfileItemDescriptions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>> customUserProfileItemDescrip!
tions, @WebParam(mode = WebParam.Mode.OUT, name = "customWindowStateDescriptions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>> customWindowStateDescriptions, @WebParam(mode = WebParam.Mode.OUT, name = "customModeDescriptions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>> customModeDescriptions, @WebParam(mode = WebParam.Mode.OUT, name = "requiresInitCookie", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<CookieProtocol> requiresInitCookie, @WebParam(mode = WebParam.Mode.OUT, name = "registrationPropertyDescription", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ModelDescription> registrationPropertyDescription, @WebParam(mode = WebParam.Mode.OUT, name = "locales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<String>> locales, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<Res!
ourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, n!
ame = "e
xtensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws InvalidRegistration, OperationFailed
+ {
+ getServiceDescriptionBehavior().getServiceDescription(registrationContext, desiredLocales, requiresRegistration,
+ offeredPortlets, userCategoryDescriptions, customUserProfileItemDescriptions, customWindowStateDescriptions,
+ customModeDescriptions, requiresInitCookie, registrationPropertyDescription, locales, resourceList, extensions);
+ }
+
+ // MarkupService implementation *************************************************************************************
+
+
+ public void performBlockingInteraction(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "runtimeContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RuntimeContext runtimeContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") MarkupParams markupParams, @WebParam(name = "interactionParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") InteractionParams interactionParams, @WebParam(mode = WebParam.Mode.OUT, name = "updateResponse", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<UpdateResponse> updateResponse, @WebParam(mode = WebParam.Mode.OUT, name = "redirectURL", targe!
tNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String> redirectURL, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState, InvalidCookie, InvalidSession, MissingParameters, UnsupportedLocale, InconsistentParameters, PortletStateChangeRequired, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ getMarkupBehaviorFor(portletContext.getPortletHandle()).performBlockingInteraction(registrationContext, portletContext, runtimeContext, userContext, markupParams, interactionParams, updateResponse, redirectURL, extensions);
+ }
+
+ public List<Extension> releaseSessions(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "sessionIDs", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> sessionIDs) throws MissingParameters, InvalidRegistration, AccessDenied, OperationFailed
+ {
+ return null;
+ }
+
+ public void getMarkup(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "runtimeContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RuntimeContext runtimeContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") MarkupParams markupParams, @WebParam(mode = WebParam.Mode.OUT, name = "markupContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<MarkupContext> markupContext, @WebParam(mode = WebParam.Mode.OUT, name = "sessionContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<SessionContext> sessionContext, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", t!
argetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState, InvalidCookie, InvalidSession, MissingParameters, UnsupportedLocale, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ getMarkupBehaviorFor(portletContext.getPortletHandle()).getMarkup(registrationContext, portletContext, runtimeContext, userContext, markupParams, markupContext, sessionContext, extensions);
+ }
+
+ public List<Extension> initCookie(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext) throws InvalidRegistration, AccessDenied, OperationFailed
+ {
+ // should only be called if we required cookies to be initialized
+ if (requiresInitCookie == null || CookieProtocol.NONE.equals(requiresInitCookie))
+ {
+ throw new OperationFailed();
+ }
+
+ try
+ {
+ return getMarkupBehaviorFor(currentMarkupBehaviorHandle).initCookie(registrationContext);
+ }
+ catch (InvalidHandle invalidHandle)
+ {
+ throw new OperationFailed("Invalid handle", invalidHandle);
+ }
+ }
+
+ // Registration implementation **************************************************************************************
+
+
+ public void register(@WebParam(name = "consumerName", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") String consumerName, @WebParam(name = "consumerAgent", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") String consumerAgent, @WebParam(name = "methodGetSupported", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") boolean methodGetSupported, @WebParam(name = "consumerModes", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> consumerModes, @WebParam(name = "consumerWindowStates", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> consumerWindowStates, @WebParam(name = "consumerUserScopes", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> consumerUserScopes, @WebParam(name = "customUserProfileData", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> customUserProfileData, @WebParam(name = "registrationProperties", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<Property> registrat!
ionProperties, @WebParam(mode = WebParam.Mode.INOUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions, @WebParam(mode = WebParam.Mode.OUT, name = "registrationHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String> registrationHandle, @WebParam(mode = WebParam.Mode.OUT, name = "registrationState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> registrationState) throws MissingParameters, OperationFailed
+ {
+ registrationHandle.value = "registration";
+ }
+
+ public void modifyRegistration(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "registrationData", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationData registrationData, @WebParam(mode = WebParam.Mode.OUT, name = "registrationState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> registrationState, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, InvalidRegistration, OperationFailed
+ {
+ // do nothing
+ }
+
+ public List<Extension> deregister(@WebParam(name = "registrationHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") String registrationHandle, @WebParam(name = "registrationState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") byte[] registrationState, @WebParam(name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<Extension> extensions) throws InvalidRegistration, OperationFailed
+ {
+ return null; // do nothing
+ }
+
+ // PortletManagement implementation *********************************************************************************
+
+ public void getPortletPropertyDescription(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "desiredLocales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales, @WebParam(mode = WebParam.Mode.OUT, name = "modelDescription", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ModelDescription> modelDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) thro!
ws MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ getPortletManagementBehavior().getPortletPropertyDescription(registrationContext, portletContext, userContext, desiredLocales, modelDescription, resourceList, extensions);
+ }
+
+ public void setPortletProperties(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "propertyList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PropertyList propertyList, @WebParam(mode = WebParam.Mode.OUT, name = "portletHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String> portletHandle, @WebParam(mode = WebParam.Mode.OUT, name = "portletState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> portletState, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, InconsistentP!
arameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ getPortletManagementBehavior().setPortletProperties(registrationContext, portletContext, userContext, propertyList, portletHandle, portletState, extensions);
+ }
+
+ public void clonePortlet(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(mode = WebParam.Mode.OUT, name = "portletHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String> portletHandle, @WebParam(mode = WebParam.Mode.OUT, name = "portletState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> portletState, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ getPortletManagementBehavior().clonePortlet(registrationContext, portletContext, userContext, portletHandle, portletState, extensions);
+ }
+
+ public void getPortletDescription(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "desiredLocales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales, @WebParam(mode = WebParam.Mode.OUT, name = "portletDescription", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<PortletDescription> portletDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws!
MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ getPortletManagementBehavior().getPortletDescription(registrationContext, portletContext, userContext, desiredLocales, portletDescription, resourceList, extensions);
+ }
+
+ public void getPortletProperties(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "names", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> names, @WebParam(mode = WebParam.Mode.OUT, name = "properties", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Property>> properties, @WebParam(mode = WebParam.Mode.OUT, name = "resetProperties", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ResetProperty>> resetProperties, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, Incons!
istentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ getPortletManagementBehavior().getPortletProperties(registrationContext, portletContext, userContext, names, properties, resetProperties, extensions);
+ }
+
+ public void destroyPortlets(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletHandles", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> portletHandles, @WebParam(mode = WebParam.Mode.OUT, name = "destroyFailed", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<DestroyFailed>> destroyFailed, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, InconsistentParameters, InvalidRegistration, OperationFailed
+ {
+ getPortletManagementBehavior().destroyPortlets(registrationContext, portletHandles, destroyFailed, extensions);
+ }
+
+ // Producer implementation ******************************************************************************************
+
+ public CookieProtocol getRequiresInitCookie()
+ {
+ return requiresInitCookie;
+ }
+
+ public void setRequiresInitCookie(CookieProtocol requiresInitCookie)
+ {
+ this.requiresInitCookie = requiresInitCookie;
+ getServiceDescriptionBehavior().setRequiresInitCookie(requiresInitCookie);
+ }
+
+ public int getSessionExpirationTime()
+ {
+ return sessionExpirationTime;
+ }
+
+ public void setSessionExpirationTime(int sessionExpirationTime)
+ {
+ this.sessionExpirationTime = sessionExpirationTime;
+ }
+
+ public void usingStrictModeChangedTo(boolean strictMode)
+ {
+// WSRPValidator.setStrict(strictMode);
+ strict = strictMode;
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/TestWSRPProducerImpl.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/MarkupBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/MarkupBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/MarkupBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,205 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.protocol.v1;
+
+import org.gatein.common.net.media.MediaType;
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.WindowState;
+import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.WSRPUtils;
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.oasis.wsrp.v1.AccessDenied;
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.GetMarkup;
+import org.oasis.wsrp.v1.InconsistentParameters;
+import org.oasis.wsrp.v1.InteractionParams;
+import org.oasis.wsrp.v1.InvalidCookie;
+import org.oasis.wsrp.v1.InvalidHandle;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.InvalidSession;
+import org.oasis.wsrp.v1.InvalidUserCategory;
+import org.oasis.wsrp.v1.MarkupContext;
+import org.oasis.wsrp.v1.MarkupParams;
+import org.oasis.wsrp.v1.MarkupResponse;
+import org.oasis.wsrp.v1.MissingParameters;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.PortletContext;
+import org.oasis.wsrp.v1.PortletDescription;
+import org.oasis.wsrp.v1.PortletStateChangeRequired;
+import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.RuntimeContext;
+import org.oasis.wsrp.v1.SessionContext;
+import org.oasis.wsrp.v1.UnsupportedLocale;
+import org.oasis.wsrp.v1.UnsupportedMimeType;
+import org.oasis.wsrp.v1.UnsupportedMode;
+import org.oasis.wsrp.v1.UnsupportedWindowState;
+import org.oasis.wsrp.v1.UpdateResponse;
+import org.oasis.wsrp.v1.UserContext;
+import org.oasis.wsrp.v1.WSRPV1MarkupPortType;
+
+import javax.jws.WebParam;
+import javax.xml.ws.Holder;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Behavior delivering Markup services.
+ *
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.test.AbstractMarkupBehavior">Chris Laprun</a>
+ * @version $Revision: 10337 $
+ * @since 2.6
+ */
+public abstract class MarkupBehavior extends TestProducerBehavior implements WSRPV1MarkupPortType
+{
+ private List<String> handles = new ArrayList<String>(3);
+ private BehaviorRegistry registry;
+
+
+ protected MarkupBehavior(BehaviorRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ /**
+ * Returns a markup String based on the passed information.
+ *
+ * @param mode the requested mode
+ * @param windowState the requested window state
+ * @param navigationalState the current navigational state
+ * @param getMarkup the original GetMarkup request (in case more information is required by this behavior)
+ * @return a possibly <code>null</code> markup String
+ */
+ protected abstract String getMarkupString(Mode mode, WindowState windowState, String navigationalState, GetMarkup getMarkup)
+ throws UnsupportedWindowState, InvalidCookie, InvalidSession, AccessDenied, InconsistentParameters, InvalidHandle,
+ UnsupportedLocale, UnsupportedMode, OperationFailed, MissingParameters, InvalidUserCategory, InvalidRegistration,
+ UnsupportedMimeType;
+
+ /**
+ * Allows this behavior to modify the response after the markup has been generated. The default implementation does
+ * nothing.
+ *
+ * @param markupResponse the response that will be passed on to the consumer
+ */
+ public void modifyResponseIfNeeded(MarkupResponse markupResponse)
+ {
+ // default implementation does not nothing
+ }
+
+ public List<String> getSupportedHandles()
+ {
+ return handles;
+ }
+
+ public PortletDescription getPortletDescriptionFor(String handle)
+ {
+ if (handles.contains(handle))
+ {
+ return createPortletDescription(handle, getSuffixFor(handle));
+ }
+ throw new IllegalArgumentException("MarkupBehavior " + getClass().getName() + " is not associated with handle '"
+ + handle + "'");
+ }
+
+ protected String getSuffixFor(String handle)
+ {
+ return "";
+ }
+
+ protected void registerHandle(String handle)
+ {
+ handles.add(handle);
+ registry.getServiceDescriptionBehavior().addPortletDescription(createPortletDescription(handle, getSuffixFor(handle)));
+ }
+
+ /**
+ * Default implementation doesn't do anything.
+ *
+ * @param registrationContext
+ * @param portletContext
+ * @param runtimeContext
+ * @param userContext
+ * @param markupParams
+ * @param interactionParams
+ * @param updateResponse
+ * @param redirectURL
+ * @param extensions
+ * @throws UnsupportedMimeType
+ * @throws UnsupportedMode
+ * @throws UnsupportedWindowState
+ * @throws InvalidCookie
+ * @throws InvalidSession
+ * @throws MissingParameters
+ * @throws UnsupportedLocale
+ * @throws InconsistentParameters
+ * @throws PortletStateChangeRequired
+ * @throws InvalidHandle
+ * @throws InvalidRegistration
+ * @throws InvalidUserCategory
+ * @throws AccessDenied
+ * @throws OperationFailed
+ */
+ public void performBlockingInteraction(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "runtimeContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RuntimeContext runtimeContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") MarkupParams markupParams, @WebParam(name = "interactionParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") InteractionParams interactionParams, @WebParam(mode = WebParam.Mode.OUT, name = "updateResponse", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<UpdateResponse> updateResponse, @WebParam(mode = WebParam.Mode.OUT, name = "redirectURL", targe!
tNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String> redirectURL, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState, InvalidCookie, InvalidSession, MissingParameters, UnsupportedLocale, InconsistentParameters, PortletStateChangeRequired, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ // do nothing
+ }
+
+ public List<Extension> releaseSessions(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "sessionIDs", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> sessionIDs) throws MissingParameters, InvalidRegistration, AccessDenied, OperationFailed
+ {
+ return null;
+ }
+
+ public void getMarkup(
+ @WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext,
+ @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext,
+ @WebParam(name = "runtimeContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RuntimeContext runtimeContext,
+ @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext,
+ @WebParam(name = "markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") MarkupParams markupParams,
+ @WebParam(mode = WebParam.Mode.OUT, name = "markupContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<MarkupContext> markupContext,
+ @WebParam(mode = WebParam.Mode.OUT, name = "sessionContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<SessionContext> sessionContext,
+ @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions)
+ throws UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState, InvalidCookie, InvalidSession, MissingParameters, UnsupportedLocale, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ GetMarkup gm = new GetMarkup();
+ gm.setMarkupParams(markupParams);
+ gm.setPortletContext(portletContext);
+ gm.setRegistrationContext(registrationContext);
+ gm.setRuntimeContext(runtimeContext);
+ gm.setUserContext(userContext);
+
+ String markupString = getMarkupString(WSRPUtils.getJSR168PortletModeFromWSRPName(markupParams.getMode()),
+ WSRPUtils.getJSR168WindowStateFromWSRPName(markupParams.getWindowState()), markupParams.getNavigationalState(), gm);
+
+ markupContext.value = WSRPTypeFactory.createMarkupContext(MediaType.TEXT_HTML.getValue(), markupString);
+ markupContext.value.setRequiresUrlRewriting(Boolean.TRUE);
+
+ MarkupResponse markupResponse = WSRPTypeFactory.createMarkupResponse(markupContext.value);
+
+ modifyResponseIfNeeded(markupResponse);
+ }
+
+ public List<Extension> initCookie(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext) throws InvalidRegistration, AccessDenied, OperationFailed
+ {
+ return null;
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/MarkupBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/PortletManagementBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/PortletManagementBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/PortletManagementBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.protocol.v1;
+
+import org.oasis.wsrp.v1.AccessDenied;
+import org.oasis.wsrp.v1.DestroyFailed;
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.InconsistentParameters;
+import org.oasis.wsrp.v1.InvalidHandle;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.InvalidUserCategory;
+import org.oasis.wsrp.v1.MissingParameters;
+import org.oasis.wsrp.v1.ModelDescription;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.PortletContext;
+import org.oasis.wsrp.v1.PortletDescription;
+import org.oasis.wsrp.v1.Property;
+import org.oasis.wsrp.v1.PropertyList;
+import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.ResetProperty;
+import org.oasis.wsrp.v1.ResourceList;
+import org.oasis.wsrp.v1.UserContext;
+import org.oasis.wsrp.v1.WSRPV1PortletManagementPortType;
+
+import javax.jws.WebParam;
+import javax.xml.ws.Holder;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.test.PortletManagementBehavior">Chris
+ * Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class PortletManagementBehavior extends TestProducerBehavior implements WSRPV1PortletManagementPortType
+{
+ public void getPortletPropertyDescription(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "desiredLocales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales, @WebParam(mode = WebParam.Mode.OUT, name = "modelDescription", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ModelDescription> modelDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) thro!
ws MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ incrementCallCount();
+ }
+
+ public void setPortletProperties(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "propertyList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PropertyList propertyList, @WebParam(mode = WebParam.Mode.OUT, name = "portletHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String> portletHandle, @WebParam(mode = WebParam.Mode.OUT, name = "portletState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> portletState, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, InconsistentP!
arameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ incrementCallCount();
+ }
+
+ public void clonePortlet(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(mode = WebParam.Mode.OUT, name = "portletHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String> portletHandle, @WebParam(mode = WebParam.Mode.OUT, name = "portletState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> portletState, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ incrementCallCount();
+ }
+
+ public void getPortletDescription(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "desiredLocales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales, @WebParam(mode = WebParam.Mode.OUT, name = "portletDescription", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<PortletDescription> portletDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws!
MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ incrementCallCount();
+ }
+
+ public void getPortletProperties(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "names", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> names, @WebParam(mode = WebParam.Mode.OUT, name = "properties", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Property>> properties, @WebParam(mode = WebParam.Mode.OUT, name = "resetProperties", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ResetProperty>> resetProperties, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, Incons!
istentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ incrementCallCount();
+ }
+
+ public void destroyPortlets(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletHandles", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> portletHandles, @WebParam(mode = WebParam.Mode.OUT, name = "destroyFailed", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<DestroyFailed>> destroyFailed, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, InconsistentParameters, InvalidRegistration, OperationFailed
+ {
+ incrementCallCount();
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/PortletManagementBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/RegistrationBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/RegistrationBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/RegistrationBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.protocol.v1;
+
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.MissingParameters;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.Property;
+import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.RegistrationData;
+import org.oasis.wsrp.v1.WSRPV1RegistrationPortType;
+
+import javax.jws.WebParam;
+import javax.xml.ws.Holder;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.test.RegistrationBehavior">Chris Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class RegistrationBehavior extends TestProducerBehavior implements WSRPV1RegistrationPortType
+{
+ public static final String REGISTRATION_HANDLE = "registration";
+
+ public void register(@WebParam(name = "consumerName", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") String consumerName, @WebParam(name = "consumerAgent", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") String consumerAgent, @WebParam(name = "methodGetSupported", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") boolean methodGetSupported, @WebParam(name = "consumerModes", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> consumerModes, @WebParam(name = "consumerWindowStates", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> consumerWindowStates, @WebParam(name = "consumerUserScopes", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> consumerUserScopes, @WebParam(name = "customUserProfileData", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> customUserProfileData, @WebParam(name = "registrationProperties", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<Property> registrat!
ionProperties, @WebParam(mode = WebParam.Mode.INOUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions, @WebParam(mode = WebParam.Mode.OUT, name = "registrationHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String> registrationHandle, @WebParam(mode = WebParam.Mode.OUT, name = "registrationState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> registrationState) throws MissingParameters, OperationFailed
+ {
+ incrementCallCount();
+ registrationHandle.value = REGISTRATION_HANDLE;
+ }
+
+ public void modifyRegistration(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "registrationData", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationData registrationData, @WebParam(mode = WebParam.Mode.OUT, name = "registrationState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> registrationState, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, InvalidRegistration, OperationFailed
+ {
+ incrementCallCount();
+ }
+
+ public List<Extension> deregister(@WebParam(name = "registrationHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") String registrationHandle, @WebParam(name = "registrationState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") byte[] registrationState, @WebParam(name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<Extension> extensions) throws InvalidRegistration, OperationFailed
+ {
+ incrementCallCount();
+ return null;
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/RegistrationBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/ServiceDescriptionBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/ServiceDescriptionBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/ServiceDescriptionBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,149 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.protocol.v1;
+
+import org.gatein.wsrp.WSRPConstants;
+import org.gatein.wsrp.WSRPTypeFactory;
+import org.oasis.wsrp.v1.CookieProtocol;
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.ItemDescription;
+import org.oasis.wsrp.v1.ModelDescription;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.PortletDescription;
+import org.oasis.wsrp.v1.PropertyDescription;
+import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.ResourceList;
+import org.oasis.wsrp.v1.ServiceDescription;
+import org.oasis.wsrp.v1.WSRPV1ServiceDescriptionPortType;
+
+import javax.jws.WebParam;
+import javax.xml.ws.Holder;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.test.ServiceDescriptionBehavior">Chris
+ * Laprun</a>
+ * @version $Revision: 11320 $
+ * @since 2.6
+ */
+public class ServiceDescriptionBehavior extends TestProducerBehavior implements WSRPV1ServiceDescriptionPortType
+{
+ protected ServiceDescription serviceDescription;
+ private static final ServiceDescription DEFAULT_SERVICE_DESCRIPTION = WSRPTypeFactory.createServiceDescription(false);
+ public static final ServiceDescriptionBehavior DEFAULT = new ServiceDescriptionBehavior();
+
+ protected List<PortletDescription> offeredPortlets;
+ private boolean requiresRegistration;
+ private CookieProtocol cookieProtocol;
+
+ public ServiceDescriptionBehavior()
+ {
+ offeredPortlets = new LinkedList<PortletDescription>();
+ }
+
+ public void setRequiresRegistration(boolean requiresRegistration)
+ {
+ this.requiresRegistration = requiresRegistration;
+ }
+
+ public void setRequiresInitCookie(CookieProtocol requiresInitCookie)
+ {
+ this.cookieProtocol = requiresInitCookie;
+ }
+
+ public void setServiceDescription(boolean requiresRegistration, int numberOfProps)
+ {
+ serviceDescription = createServiceDescription(requiresRegistration, numberOfProps);
+ }
+
+ public static ServiceDescription getDefaultServiceDescription()
+ {
+ return DEFAULT_SERVICE_DESCRIPTION;
+ }
+
+ public void addPortletDescription(PortletDescription portletDescription)
+ {
+ offeredPortlets.add(portletDescription);
+ }
+
+ public Set<String> getPortletHandles()
+ {
+ Set<String> handles = new HashSet<String>(offeredPortlets.size());
+
+ for (PortletDescription description : offeredPortlets)
+ {
+ handles.add(description.getPortletHandle());
+ }
+
+ return handles;
+ }
+
+ public int getPortletNumber()
+ {
+ return offeredPortlets.size();
+ }
+
+ public static ServiceDescription createServiceDescription(boolean requiresRegistration, int numberOfProperties)
+ {
+ ServiceDescription sd = WSRPTypeFactory.createServiceDescription(requiresRegistration);
+
+ if (requiresRegistration)
+ {
+ List<PropertyDescription> descriptions = new ArrayList<PropertyDescription>(numberOfProperties);
+ for (int i = 0; i < numberOfProperties; i++)
+ {
+ descriptions.add(WSRPTypeFactory.createPropertyDescription("prop" + i, WSRPConstants.XSD_STRING));
+ }
+ sd.setRegistrationPropertyDescription(WSRPTypeFactory.createModelDescription(descriptions));
+ }
+
+ return sd;
+ }
+
+ public void getServiceDescription(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext,
+ @WebParam(name = "desiredLocales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales,
+ @WebParam(mode = WebParam.Mode.OUT, name = "requiresRegistration", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<Boolean> requiresRegistration,
+ @WebParam(mode = WebParam.Mode.OUT, name = "offeredPortlets", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<PortletDescription>> offeredPortlets,
+ @WebParam(mode = WebParam.Mode.OUT, name = "userCategoryDescriptions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>> userCategoryDescriptions,
+ @WebParam(mode = WebParam.Mode.OUT, name = "customUserProfileItemDescriptions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>> customUserProfileItemDescriptions,
+ @WebParam(mode = WebParam.Mode.OUT, name = "customWindowStateDescriptions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>> customWindowStateDescriptions,
+ @WebParam(mode = WebParam.Mode.OUT, name = "customModeDescriptions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>> customModeDescriptions,
+ @WebParam(mode = WebParam.Mode.OUT, name = "requiresInitCookie", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<CookieProtocol> requiresInitCookie,
+ @WebParam(mode = WebParam.Mode.OUT, name = "registrationPropertyDescription", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ModelDescription> registrationPropertyDescription,
+ @WebParam(mode = WebParam.Mode.OUT, name = "locales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<String>> locales,
+ @WebParam(mode = WebParam.Mode.OUT, name = "resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList> resourceList,
+ @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions)
+ throws InvalidRegistration, OperationFailed
+ {
+ incrementCallCount();
+ offeredPortlets.value = this.offeredPortlets;
+ requiresRegistration.value = this.requiresRegistration;
+ requiresInitCookie.value = this.cookieProtocol;
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/ServiceDescriptionBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/TestProducerBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/TestProducerBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/TestProducerBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,99 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.protocol.v1;
+
+import org.gatein.common.net.media.MediaType;
+import org.gatein.wsrp.WSRPConstants;
+import org.gatein.wsrp.WSRPTypeFactory;
+import org.oasis.wsrp.v1.LocalizedString;
+import org.oasis.wsrp.v1.MarkupType;
+import org.oasis.wsrp.v1.PortletDescription;
+
+/**
+ * Provides a base class for Producer behavior used in Consumer testing.
+ *
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.test.TestProducerBehavior">Chris Laprun</a>
+ * @version $Revision: 11317 $
+ * @since 2.6
+ */
+public abstract class TestProducerBehavior
+{
+ protected int callCount;
+ public static final String SAMPLE_DESCRIPTION = "SampleDescription";
+ public static final String SAMPLE_SHORTTITLE = "SampleShortTitle";
+ public static final String SAMPLE_TITLE = "SampleTitle";
+ public static final String SAMPLE_DISPLAYNAME = "SampleDisplayName";
+ public static final String SAMPLE_KEYWORD = "keyword";
+
+ /**
+ * Increment the number of times methods of this behavior have been called. Used when the behavior changes depending
+ * on how many times methods have been called.
+ */
+ public void incrementCallCount()
+ {
+ callCount++;
+ }
+
+ public int getCallCount()
+ {
+ return callCount;
+ }
+
+ public PortletDescription createPortletDescription(String portletHandle, String suffix)
+ {
+ PortletDescription portletDesc = new PortletDescription();
+ portletDesc.setPortletHandle(portletHandle);
+ MarkupType markupType = new MarkupType();
+ markupType.setMimeType(MediaType.TEXT_HTML.getValue());
+ markupType.getModes().add(WSRPConstants.VIEW_MODE);
+ markupType.getWindowStates().add(WSRPConstants.NORMAL_WINDOW_STATE);
+ markupType.getLocales().addAll(WSRPConstants.getDefaultLocales());
+ portletDesc.getMarkupTypes().add(markupType);
+
+ String suffixString = suffix == null ? "" : suffix;
+ portletDesc.setDescription(createLocalizedString(SAMPLE_DESCRIPTION + suffixString));
+ portletDesc.setTitle(createLocalizedString(SAMPLE_TITLE + suffixString));
+ portletDesc.setShortTitle(createLocalizedString(SAMPLE_SHORTTITLE + suffixString));
+ portletDesc.setDisplayName(createLocalizedString(SAMPLE_DISPLAYNAME + suffixString));
+ portletDesc.getKeywords().add(createLocalizedString(SAMPLE_KEYWORD + suffixString));
+ return portletDesc;
+ }
+
+ /**
+ * Create the dummiest form of LocalizedString
+ *
+ * @param value
+ * @return
+ */
+ public static LocalizedString createLocalizedString(String value)
+ {
+ return WSRPTypeFactory.createLocalizedString(value);
+ }
+
+ /** Produces String from LocalizedString */
+ public static String extractString(org.gatein.common.i18n.LocalizedString ls)
+ {
+ return ls.getPreferredOrBestLocalizedMappingFor(new String[]{"en"}).getString();
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/TestProducerBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicMarkupBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicMarkupBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicMarkupBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,109 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.protocol.v1.behaviors;
+
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.WindowState;
+import org.gatein.wsrp.WSRPConstants;
+import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
+import org.oasis.wsrp.v1.AccessDenied;
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.GetMarkup;
+import org.oasis.wsrp.v1.InconsistentParameters;
+import org.oasis.wsrp.v1.InteractionParams;
+import org.oasis.wsrp.v1.InvalidCookie;
+import org.oasis.wsrp.v1.InvalidHandle;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.InvalidSession;
+import org.oasis.wsrp.v1.InvalidUserCategory;
+import org.oasis.wsrp.v1.MarkupParams;
+import org.oasis.wsrp.v1.MarkupResponse;
+import org.oasis.wsrp.v1.MissingParameters;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.PortletContext;
+import org.oasis.wsrp.v1.PortletStateChangeRequired;
+import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.RuntimeContext;
+import org.oasis.wsrp.v1.UnsupportedLocale;
+import org.oasis.wsrp.v1.UnsupportedMimeType;
+import org.oasis.wsrp.v1.UnsupportedMode;
+import org.oasis.wsrp.v1.UnsupportedWindowState;
+import org.oasis.wsrp.v1.UpdateResponse;
+import org.oasis.wsrp.v1.UserContext;
+
+import javax.jws.WebParam;
+import javax.xml.ws.Holder;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.v1.consumer.producer.BasicProducer">Chris
+ * Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class BasicMarkupBehavior extends MarkupBehavior
+{
+ public static final String PORTLET_HANDLE = "SamplePortletHandle";
+ public static final String NS = "ns1";
+
+
+ public BasicMarkupBehavior(BehaviorRegistry registry)
+ {
+ super(registry);
+ registerHandle(PORTLET_HANDLE);
+ }
+
+ public String getMarkupString(Mode mode, WindowState windowState, String navigationalState, GetMarkup getMarkup)
+ {
+ StringBuffer markupString = new StringBuffer("portlet1:");
+
+ markupString.append(mode).append(":").append(windowState);
+ if (navigationalState != null)
+ {
+ markupString.append(":").append(navigationalState);
+ }
+
+ return markupString.toString();
+ }
+
+
+ @Override
+ public void performBlockingInteraction(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "runtimeContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RuntimeContext runtimeContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") MarkupParams markupParams, @WebParam(name = "interactionParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") InteractionParams interactionParams, @WebParam(mode = WebParam.Mode.OUT, name = "updateResponse", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<UpdateResponse> updateResponse, @WebParam(mode = WebParam.Mode.OUT, name = "redirectURL", targe!
tNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String> redirectURL, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions)
+ throws UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState, InvalidCookie, InvalidSession,
+ MissingParameters, UnsupportedLocale, InconsistentParameters, PortletStateChangeRequired, InvalidHandle,
+ InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ UpdateResponse ur = WSRPTypeFactory.createUpdateResponse();
+ ur.setNavigationalState(NS);
+ updateResponse.value = ur;
+ }
+
+ public void modifyResponseIfNeeded(MarkupResponse markupResponse)
+ {
+ // fake markup caching
+ markupResponse.getMarkupContext().setCacheControl(WSRPTypeFactory.createCacheControl(15, WSRPConstants.CACHE_PER_USER));
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicMarkupBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicPortletManagementBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicPortletManagementBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicPortletManagementBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,195 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.protocol.v1.behaviors;
+
+import org.gatein.wsrp.WSRPExceptionFactory;
+import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
+import org.gatein.wsrp.test.protocol.v1.PortletManagementBehavior;
+import org.oasis.wsrp.v1.AccessDenied;
+import org.oasis.wsrp.v1.DestroyFailed;
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.InconsistentParameters;
+import org.oasis.wsrp.v1.InvalidHandle;
+import org.oasis.wsrp.v1.InvalidHandleFault;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.InvalidUserCategory;
+import org.oasis.wsrp.v1.MissingParameters;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.OperationFailedFault;
+import org.oasis.wsrp.v1.PortletContext;
+import org.oasis.wsrp.v1.PortletDescription;
+import org.oasis.wsrp.v1.Property;
+import org.oasis.wsrp.v1.PropertyList;
+import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.ResetProperty;
+import org.oasis.wsrp.v1.ResourceList;
+import org.oasis.wsrp.v1.UserContext;
+
+import javax.jws.WebParam;
+import javax.xml.ws.Holder;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class BasicPortletManagementBehavior extends PortletManagementBehavior
+{
+ private static final String CLONE_SUFFIX = "_clone";
+ public static final String PROPERTY_NAME = "prop1";
+ public static final String PROPERTY_VALUE = "value1";
+ public static final String PROPERTY_NEW_VALUE = "value2";
+ public static final String CLONED_HANDLE = BasicMarkupBehavior.PORTLET_HANDLE + CLONE_SUFFIX;
+ private BehaviorRegistry registry;
+
+ public BasicPortletManagementBehavior(BehaviorRegistry registry)
+ {
+ super();
+ this.registry = registry;
+ }
+
+ @Override
+ public void clonePortlet(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(mode = WebParam.Mode.OUT, name = "portletHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String> portletHandle, @WebParam(mode = WebParam.Mode.OUT, name = "portletState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> portletState, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ String handle = getHandleFrom(portletContext, "portlet context");
+
+ if (!BasicMarkupBehavior.PORTLET_HANDLE.equals(handle))
+ {
+ throw WSRPExceptionFactory.<InvalidHandle, InvalidHandleFault>throwWSException(WSRPExceptionFactory.INVALID_HANDLE,
+ "Can only clone portlet with handle '" + BasicMarkupBehavior.PORTLET_HANDLE + "'", null);
+ }
+
+ portletHandle.value = CLONED_HANDLE;
+ }
+
+ @Override
+ public void getPortletDescription(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "desiredLocales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales, @WebParam(mode = WebParam.Mode.OUT, name = "portletDescription", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<PortletDescription> portletDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws!
MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ super.getPortletDescription(registrationContext, portletContext, userContext, desiredLocales, portletDescription, resourceList, extensions);
+
+ String handle = getHandleFrom(portletContext, "portlet context");
+
+ // need to fake that the clone exists... so remove suffix to get the description of the POP
+ int index = handle.indexOf(CLONE_SUFFIX);
+ if (index != -1)
+ {
+ handle = handle.substring(0, index);
+ }
+
+ // get the POP description...
+ MarkupBehavior markupBehaviorFor = registry.getMarkupBehaviorFor(handle);
+ PortletDescription description = markupBehaviorFor.getPortletDescriptionFor(handle);
+
+ // if it was a clone, add the suffix back to the handle.
+ if (index != -1)
+ {
+ description.setPortletHandle(handle + CLONE_SUFFIX);
+ }
+
+ portletDescription.value = description;
+ }
+
+ @Override
+ public void getPortletProperties(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "names", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> names, @WebParam(mode = WebParam.Mode.OUT, name = "properties", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Property>> properties, @WebParam(mode = WebParam.Mode.OUT, name = "resetProperties", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ResetProperty>> resetProperties, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, Incons!
istentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ String handle = getHandleFrom(portletContext, "portlet context");
+
+ List<Property> propertyList = new ArrayList<Property>(1);
+
+ if (BasicMarkupBehavior.PORTLET_HANDLE.equals(handle))
+ {
+ propertyList.add(WSRPTypeFactory.createProperty(PROPERTY_NAME, "en", PROPERTY_VALUE));
+ }
+ else if (CLONED_HANDLE.equals(handle))
+ {
+ if (callCount != 2)
+ {
+ propertyList.add(WSRPTypeFactory.createProperty(PROPERTY_NAME, "en", PROPERTY_VALUE));
+ }
+ else
+ {
+ propertyList.add(WSRPTypeFactory.createProperty(PROPERTY_NAME, "en", PROPERTY_NEW_VALUE));
+ }
+ }
+ else
+ {
+ WSRPExceptionFactory.<InvalidHandle, InvalidHandleFault>throwWSException(WSRPExceptionFactory.INVALID_HANDLE,
+ "Unknown handle '" + handle + "'", null);
+ }
+
+ incrementCallCount();
+ properties.value = propertyList;
+ }
+
+ @Override
+ public void setPortletProperties(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "propertyList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PropertyList propertyList, @WebParam(mode = WebParam.Mode.OUT, name = "portletHandle", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String> portletHandle, @WebParam(mode = WebParam.Mode.OUT, name = "portletState", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<byte[]> portletState, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, InconsistentP!
arameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ String handle = getHandleFrom(portletContext, "portlet context");
+
+ if (!(CLONED_HANDLE).equals(handle))
+ {
+ throw WSRPExceptionFactory.<OperationFailed, OperationFailedFault>throwWSException(WSRPExceptionFactory.OPERATION_FAILED,
+ "Cannot modify portlet '" + handle + "'", null);
+ }
+
+ portletHandle.value = handle;
+ }
+
+ private String getHandleFrom(PortletContext portletContext, String context) throws MissingParameters, InvalidHandle
+ {
+ WSRPExceptionFactory.throwMissingParametersIfValueIsMissing(portletContext, "portlet context", context);
+ String handle = portletContext.getPortletHandle();
+ WSRPExceptionFactory.throwMissingParametersIfValueIsMissing(handle, "portlet handle", "PortletContext");
+ if (handle.length() == 0)
+ {
+ throw WSRPExceptionFactory.<InvalidHandle, InvalidHandleFault>throwWSException(WSRPExceptionFactory.INVALID_HANDLE,
+ "Portlet handle is empty", null);
+ }
+
+ return handle;
+ }
+
+ @Override
+ public void destroyPortlets(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletHandles", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> portletHandles, @WebParam(mode = WebParam.Mode.OUT, name = "destroyFailed", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<DestroyFailed>> destroyFailed, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws MissingParameters, InconsistentParameters, InvalidRegistration, OperationFailed
+ {
+ super.destroyPortlets(registrationContext, portletHandles, destroyFailed, extensions);
+ WSRPExceptionFactory.throwMissingParametersIfValueIsMissing(portletHandles, "portlet handles", "destroyPortlets");
+ if (portletHandles.isEmpty())
+ {
+ WSRPExceptionFactory.throwMissingParametersIfValueIsMissing(portletHandles, "portlet handles", "DestroyPortlets");
+ }
+
+ for (String handle : portletHandles)
+ {
+ if (!CLONED_HANDLE.equals(handle))
+ {
+ destroyFailed.value.add(WSRPTypeFactory.createDestroyFailed(handle, "Handle '" + handle + "' doesn't exist"));
+ }
+ }
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicPortletManagementBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicServiceDescriptionBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicServiceDescriptionBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicServiceDescriptionBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.protocol.v1.behaviors;
+
+import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
+import org.oasis.wsrp.v1.PortletDescription;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.protocol.v1.behaviors.BasicServiceDescriptionBehavior">Chris
+ * Laprun</a>
+ * @version $Revision: 10610 $
+ * @since 2.6
+ */
+public class BasicServiceDescriptionBehavior extends ServiceDescriptionBehavior
+{
+
+ public BasicServiceDescriptionBehavior()
+ {
+ //Prepare description of two portlets
+ PortletDescription pd1 = createPortletDescription(BasicMarkupBehavior.PORTLET_HANDLE, "");
+ PortletDescription pd2 = createPortletDescription(SessionMarkupBehavior.PORTLET_HANDLE, "2");
+ offeredPortlets.add(pd1);
+ offeredPortlets.add(pd2);
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/BasicServiceDescriptionBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/DestroyClonesPortletManagementBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/DestroyClonesPortletManagementBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/DestroyClonesPortletManagementBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,77 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.protocol.v1.behaviors;
+
+import org.gatein.wsrp.WSRPExceptionFactory;
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.oasis.wsrp.v1.AccessDenied;
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.InconsistentParameters;
+import org.oasis.wsrp.v1.InvalidHandle;
+import org.oasis.wsrp.v1.InvalidHandleFault;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.InvalidUserCategory;
+import org.oasis.wsrp.v1.MissingParameters;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.PortletContext;
+import org.oasis.wsrp.v1.PortletDescription;
+import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.ResourceList;
+import org.oasis.wsrp.v1.UserContext;
+
+import javax.jws.WebParam;
+import javax.xml.ws.Holder;
+import java.util.List;
+
+/**
+ * Specific behavior used in PortletManagementCase.testDestroyClones.
+ *
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class DestroyClonesPortletManagementBehavior extends BasicPortletManagementBehavior
+{
+ public DestroyClonesPortletManagementBehavior(BehaviorRegistry registry)
+ {
+ super(registry);
+ }
+
+ @Override
+ public void getPortletDescription(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "desiredLocales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales, @WebParam(mode = WebParam.Mode.OUT, name = "portletDescription", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<PortletDescription> portletDescription, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ResourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws!
MissingParameters, InconsistentParameters, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ // only return the portlet description the first time the method is called since all other calls happen after
+ // the clone has been destroyed...
+ if (getCallCount() == 0)
+ {
+ incrementCallCount();
+ super.getPortletDescription(registrationContext, portletContext, userContext, desiredLocales, portletDescription, resourceList, extensions);
+ }
+ else
+ {
+ throw WSRPExceptionFactory.<InvalidHandle, InvalidHandleFault>throwWSException(WSRPExceptionFactory.INVALID_HANDLE,
+ "Invalid portlet handle: " + portletContext.getPortletHandle(), null);
+ }
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/DestroyClonesPortletManagementBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/EmptyMarkupBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/EmptyMarkupBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/EmptyMarkupBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.protocol.v1.behaviors;
+
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.WindowState;
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
+import org.oasis.wsrp.v1.GetMarkup;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.v1.consumer.producer.EmptyMarkupBehavior">Chris
+ * Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class EmptyMarkupBehavior extends MarkupBehavior
+{
+ public static final String PORTLET_HANDLE = "EmptyMarkup";
+
+
+ public EmptyMarkupBehavior(BehaviorRegistry registry)
+ {
+ super(registry);
+ registerHandle(PORTLET_HANDLE);
+ }
+
+ public String getMarkupString(Mode mode, WindowState windowState, String navigationalState, GetMarkup getMarkup)
+ {
+ return "";
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/EmptyMarkupBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/GroupedPortletsServiceDescriptionBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/GroupedPortletsServiceDescriptionBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/GroupedPortletsServiceDescriptionBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,63 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.wsrp.test.protocol.v1.behaviors;
+
+import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
+import org.oasis.wsrp.v1.CookieProtocol;
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.ItemDescription;
+import org.oasis.wsrp.v1.ModelDescription;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.PortletDescription;
+import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.ResourceList;
+
+import javax.jws.WebParam;
+import javax.xml.ws.Holder;
+import java.util.List;
+
+/**
+ * Wraps a service description to add group information on portlet descriptions...
+ *
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class GroupedPortletsServiceDescriptionBehavior extends ServiceDescriptionBehavior
+{
+ public GroupedPortletsServiceDescriptionBehavior(List<PortletDescription> offeredPortlets)
+ {
+ this.offeredPortlets = offeredPortlets;
+ }
+
+ @Override
+ public void getServiceDescription(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "desiredLocales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") List<String> desiredLocales, @WebParam(mode = WebParam.Mode.OUT, name = "requiresRegistration", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<Boolean> requiresRegistration, @WebParam(mode = WebParam.Mode.OUT, name = "offeredPortlets", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<PortletDescription>> offeredPortlets, @WebParam(mode = WebParam.Mode.OUT, name = "userCategoryDescriptions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>> userCategoryDescriptions, @WebParam(mode = WebParam.Mode.OUT, name = "customUserProfileItemDescriptions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>> customUserProfileItemDescrip!
tions, @WebParam(mode = WebParam.Mode.OUT, name = "customWindowStateDescriptions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>> customWindowStateDescriptions, @WebParam(mode = WebParam.Mode.OUT, name = "customModeDescriptions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<ItemDescription>> customModeDescriptions, @WebParam(mode = WebParam.Mode.OUT, name = "requiresInitCookie", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<CookieProtocol> requiresInitCookie, @WebParam(mode = WebParam.Mode.OUT, name = "registrationPropertyDescription", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<ModelDescription> registrationPropertyDescription, @WebParam(mode = WebParam.Mode.OUT, name = "locales", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<String>> locales, @WebParam(mode = WebParam.Mode.OUT, name = "resourceList", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<Res!
ourceList> resourceList, @WebParam(mode = WebParam.Mode.OUT, n!
ame = "e
xtensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws InvalidRegistration, OperationFailed
+ {
+ super.getServiceDescription(registrationContext, desiredLocales, requiresRegistration, offeredPortlets, userCategoryDescriptions, customUserProfileItemDescriptions, customWindowStateDescriptions, customModeDescriptions, requiresInitCookie, registrationPropertyDescription, locales, resourceList, extensions);
+ List<PortletDescription> portletDescriptions = offeredPortlets.value;
+ for (int i = 0; i < portletDescriptions.size(); i++)
+ {
+ portletDescriptions.get(i).setGroupID("group" + i % 3);
+ }
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/GroupedPortletsServiceDescriptionBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieMarkupBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieMarkupBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieMarkupBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,102 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.protocol.v1.behaviors;
+
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.WindowState;
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
+import org.oasis.wsrp.v1.AccessDenied;
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.GetMarkup;
+import org.oasis.wsrp.v1.InvalidCookie;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.RegistrationContext;
+
+import javax.jws.WebParam;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 10610 $
+ * @since 2.6
+ */
+public abstract class InitCookieMarkupBehavior extends MarkupBehavior
+{
+ protected String portletHandle;
+ protected int initCookieCallCount;
+
+ public InitCookieMarkupBehavior(BehaviorRegistry registry)
+ {
+ super(registry);
+ initPortletHandle();
+ registerHandle(portletHandle);
+ }
+
+ protected abstract void initPortletHandle();
+
+
+ protected String getMarkupString(Mode mode, WindowState windowState, String navigationalState, GetMarkup getMarkup) throws OperationFailed, InvalidCookie
+ {
+ String handle = getMarkup.getPortletContext().getPortletHandle();
+
+ if (portletHandle.equals(handle))
+ {
+ return getMarkupString(handle);
+ }
+
+ // shouldn't happen
+ throw new OperationFailed();
+ }
+
+ protected String getMarkupString(String handle) throws InvalidCookie, OperationFailed
+ {
+ switch (callCount++)
+ {
+ case 0:
+ // simulate change of configuration between calls: upon receiving this, the consumer should invoke initCookie
+ throw new InvalidCookie();
+
+ case 1:
+ return handle;
+
+ default:
+ // shouldn't be called more than twice
+ throw new OperationFailed();
+ }
+ }
+
+ @Override
+ public List<Extension> initCookie(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext) throws InvalidRegistration, AccessDenied, OperationFailed
+ {
+ initCookieCallCount++;
+ return null;
+ }
+
+ public int getInitCookieCallCount()
+ {
+ return initCookieCallCount;
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieMarkupBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieNotRequiredMarkupBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieNotRequiredMarkupBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieNotRequiredMarkupBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,65 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.wsrp.test.protocol.v1.behaviors;
+
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.oasis.wsrp.v1.AccessDenied;
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.RegistrationContext;
+
+import javax.jws.WebParam;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class InitCookieNotRequiredMarkupBehavior extends InitCookieMarkupBehavior
+{
+ public static final String INIT_COOKIE_NOT_REQUIRED_HANDLE = "InitCookieNotRequired";
+
+ public InitCookieNotRequiredMarkupBehavior(BehaviorRegistry registry)
+ {
+ super(registry);
+ }
+
+ protected void initPortletHandle()
+ {
+ portletHandle = INIT_COOKIE_NOT_REQUIRED_HANDLE;
+ }
+
+ @Override
+ protected String getMarkupString(String handle)
+ {
+ return handle;
+ }
+
+ @Override
+ public List<Extension> initCookie(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext) throws InvalidRegistration, AccessDenied, OperationFailed
+ {
+ super.initCookie(registrationContext);
+ throw new OperationFailed();
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/InitCookieNotRequiredMarkupBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/NullMarkupBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/NullMarkupBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/NullMarkupBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.protocol.v1.behaviors;
+
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.WindowState;
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
+import org.oasis.wsrp.v1.GetMarkup;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.v1.consumer.producer.NullMarkupBehavior">Chris
+ * Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class NullMarkupBehavior extends MarkupBehavior
+{
+ public static final String PORTLET_HANDLE = "NullMarkup";
+
+
+ public NullMarkupBehavior(BehaviorRegistry registry)
+ {
+ super(registry);
+ registerHandle(PORTLET_HANDLE);
+ }
+
+ public String getMarkupString(Mode mode, WindowState windowState, String navigationalState, GetMarkup getMarkup)
+ {
+ return null;
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/NullMarkupBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/PerGroupInitCookieMarkupBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/PerGroupInitCookieMarkupBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/PerGroupInitCookieMarkupBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,66 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.wsrp.test.protocol.v1.behaviors;
+
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.oasis.wsrp.v1.AccessDenied;
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.RegistrationContext;
+
+import javax.jws.WebParam;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class PerGroupInitCookieMarkupBehavior extends InitCookieMarkupBehavior
+{
+ public static final String PER_GROUP_INIT_COOKIE_HANDLE = "PerGroupInitCookie";
+
+ public PerGroupInitCookieMarkupBehavior(BehaviorRegistry registry)
+ {
+ super(registry);
+ }
+
+ protected void initPortletHandle()
+ {
+ portletHandle = PER_GROUP_INIT_COOKIE_HANDLE;
+ }
+
+ @Override
+ public List<Extension> initCookie(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext) throws InvalidRegistration, AccessDenied, OperationFailed
+ {
+ List<Extension> extensions = super.initCookie(registrationContext);
+
+ if (initCookieCallCount > 3)
+ {
+ throw new OperationFailed("Service description only defines 3 groups so initCookie should only be called 3 times!",
+ new IllegalStateException("Service description only defines 3 groups so initCookie should only be called 3 times!"));
+ }
+
+ return extensions;
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/PerGroupInitCookieMarkupBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/PerUserInitCookieMarkupBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/PerUserInitCookieMarkupBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/PerUserInitCookieMarkupBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,44 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.wsrp.test.protocol.v1.behaviors;
+
+import org.gatein.wsrp.test.BehaviorRegistry;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class PerUserInitCookieMarkupBehavior extends InitCookieMarkupBehavior
+{
+ public static final String PER_USER_INIT_COOKIE_HANDLE = "PerUserInitCookie";
+
+ public PerUserInitCookieMarkupBehavior(BehaviorRegistry registry)
+ {
+ super(registry);
+ }
+
+ protected void initPortletHandle()
+ {
+ portletHandle = PER_USER_INIT_COOKIE_HANDLE;
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/PerUserInitCookieMarkupBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/ResourceMarkupBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/ResourceMarkupBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/ResourceMarkupBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,52 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.wsrp.test.protocol.v1.behaviors;
+
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.WindowState;
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
+import org.oasis.wsrp.v1.GetMarkup;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class ResourceMarkupBehavior extends MarkupBehavior
+{
+ public static final String PORTLET_HANDLE = "resource";
+
+
+ public ResourceMarkupBehavior(BehaviorRegistry registry)
+ {
+ super(registry);
+ registerHandle(PORTLET_HANDLE);
+ }
+
+ protected String getMarkupString(Mode mode, WindowState windowState, String navigationalState, GetMarkup getMarkup)
+ {
+ return "<img src='wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Flocalhost%3A8080" +
+ "%2Ftest-resource-portlet%2Fgif%2Flogo.gif&wsrp-requiresRewrite=true/wsrp_rewrite'/>";
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/ResourceMarkupBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/SessionMarkupBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/SessionMarkupBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/SessionMarkupBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,127 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.protocol.v1.behaviors;
+
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.WindowState;
+import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
+import org.oasis.wsrp.v1.AccessDenied;
+import org.oasis.wsrp.v1.Extension;
+import org.oasis.wsrp.v1.GetMarkup;
+import org.oasis.wsrp.v1.InconsistentParameters;
+import org.oasis.wsrp.v1.InteractionParams;
+import org.oasis.wsrp.v1.InvalidCookie;
+import org.oasis.wsrp.v1.InvalidHandle;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.InvalidSession;
+import org.oasis.wsrp.v1.InvalidUserCategory;
+import org.oasis.wsrp.v1.MarkupParams;
+import org.oasis.wsrp.v1.MarkupResponse;
+import org.oasis.wsrp.v1.MissingParameters;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.PortletContext;
+import org.oasis.wsrp.v1.PortletStateChangeRequired;
+import org.oasis.wsrp.v1.RegistrationContext;
+import org.oasis.wsrp.v1.RuntimeContext;
+import org.oasis.wsrp.v1.SessionContext;
+import org.oasis.wsrp.v1.UnsupportedLocale;
+import org.oasis.wsrp.v1.UnsupportedMimeType;
+import org.oasis.wsrp.v1.UnsupportedMode;
+import org.oasis.wsrp.v1.UnsupportedWindowState;
+import org.oasis.wsrp.v1.UpdateResponse;
+import org.oasis.wsrp.v1.UserContext;
+
+import javax.jws.WebParam;
+import javax.xml.ws.Holder;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.v1.consumer.producer.SessionBehavior">Chris
+ * Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class SessionMarkupBehavior extends MarkupBehavior
+{
+ public static final String PORTLET_HANDLE = "SecondPortletHandle";
+ public static final String SESSION_ID = "sessionID";
+ public static final String NS = "ns2";
+
+
+ private int count = 0;
+ private String sessionId;
+
+ public SessionMarkupBehavior(BehaviorRegistry registry)
+ {
+ super(registry);
+ registerHandle(PORTLET_HANDLE);
+ }
+
+ public String getMarkupString(Mode mode, WindowState windowState, String navigationalState, GetMarkup getMarkup)
+ {
+ StringBuffer markupString = new StringBuffer("portlet2:");
+ sessionId = getMarkup.getRuntimeContext().getSessionID();
+
+ // if we have a session, increments count to simulate session usage
+ if (SESSION_ID.equals(sessionId))
+ {
+ count++;
+ }
+ markupString.append(count).append(":");
+
+ markupString.append(mode).append(":").append(windowState);
+ if (navigationalState != null)
+ {
+ markupString.append(":").append(navigationalState);
+ }
+
+ return markupString.toString();
+ }
+
+ @Override
+ public void performBlockingInteraction(@WebParam(name = "registrationContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RegistrationContext registrationContext, @WebParam(name = "portletContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") PortletContext portletContext, @WebParam(name = "runtimeContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") RuntimeContext runtimeContext, @WebParam(name = "userContext", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") UserContext userContext, @WebParam(name = "markupParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") MarkupParams markupParams, @WebParam(name = "interactionParams", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") InteractionParams interactionParams, @WebParam(mode = WebParam.Mode.OUT, name = "updateResponse", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<UpdateResponse> updateResponse, @WebParam(mode = WebParam.Mode.OUT, name = "redirectURL", targe!
tNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<String> redirectURL, @WebParam(mode = WebParam.Mode.OUT, name = "extensions", targetNamespace = "urn:oasis:names:tc:wsrp:v1:types") Holder<List<Extension>> extensions) throws UnsupportedMimeType, UnsupportedMode, UnsupportedWindowState, InvalidCookie, InvalidSession, MissingParameters, UnsupportedLocale, InconsistentParameters, PortletStateChangeRequired, InvalidHandle, InvalidRegistration, InvalidUserCategory, AccessDenied, OperationFailed
+ {
+ UpdateResponse ur = WSRPTypeFactory.createUpdateResponse();
+ ur.setNavigationalState(NS);
+ updateResponse.value = ur;
+ }
+
+ public void modifyResponseIfNeeded(MarkupResponse markupResponse)
+ {
+ // fakes creation of a portlet session if not already present
+ if (count == 0 || SESSION_ID.equals(sessionId))
+ {
+ SessionContext sessionContext = WSRPTypeFactory.createSessionContext(SESSION_ID, 30);
+ markupResponse.setSessionContext(sessionContext);
+ }
+ }
+
+
+ protected String getSuffixFor(String handle)
+ {
+ return "2";
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/SessionMarkupBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/interop/LiferayServiceDescriptionBehavior.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/interop/LiferayServiceDescriptionBehavior.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/interop/LiferayServiceDescriptionBehavior.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,77 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.wsrp.test.protocol.v1.behaviors.interop;
+
+import org.gatein.wsrp.test.protocol.v1.ServiceDescriptionBehavior;
+import org.oasis.wsrp.v1.LocalizedString;
+import org.oasis.wsrp.v1.PortletDescription;
+
+/**
+ * Liferay behavior as exhibited at http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162201#4162201
+ *
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class LiferayServiceDescriptionBehavior extends ServiceDescriptionBehavior
+{
+ public LiferayServiceDescriptionBehavior()
+ {
+ /*
+ <portletHandle>98</portletHandle>
+<markupTypes>
+ <mimeType>text/html</mimeType>
+ <modes>wsrp:view</modes>
+ <windowStates>wsrp:normal</windowStates>
+ <windowStates>wsrp:minimized</windowStates>
+ <windowStates>wsrp:maximized</windowStates>
+ <locales>en_US</locales>
+</markupTypes>
+<groupID>98</groupID>
+<shortTitle lang='English'>
+ <value>javax.portlet.short-title.98</value>
+</shortTitle>
+<title lang='English'>
+ <value>Software Catalog</value>
+</title>
+ */
+ PortletDescription pd = createPortletDescription("98", null);
+ pd.getMarkupTypes().get(0).getLocales().set(0, "en_US");
+ LocalizedString locString = pd.getShortTitle();
+ pd.setGroupID("98");
+ String lang = "English";
+ locString.setLang(lang);
+ locString.setValue("javax.portlet.short-title.98");
+ locString = pd.getTitle();
+ locString.setLang(lang);
+ locString.setValue("Software Catalog");
+
+ // add another value that checks that we handle null lang properly
+ PortletDescription pd2 = createPortletDescription("99", null);
+ pd.getMarkupTypes().get(0).getLocales().set(0, "en_US");
+ locString = pd.getShortTitle();
+ locString.setLang(null);
+
+ offeredPortlets.add(pd);
+ offeredPortlets.add(pd2);
+ }
+}
\ No newline at end of file
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/protocol/v1/behaviors/interop/LiferayServiceDescriptionBehavior.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/BehaviorBackedServiceFactory.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/BehaviorBackedServiceFactory.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/BehaviorBackedServiceFactory.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,211 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.support;
+
+import org.gatein.common.NotYetImplemented;
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.WindowState;
+import org.gatein.wsrp.services.ServiceFactory;
+import org.gatein.wsrp.test.BehaviorRegistry;
+import org.gatein.wsrp.test.protocol.v1.MarkupBehavior;
+import org.oasis.wsrp.v1.AccessDenied;
+import org.oasis.wsrp.v1.GetMarkup;
+import org.oasis.wsrp.v1.InconsistentParameters;
+import org.oasis.wsrp.v1.InvalidCookie;
+import org.oasis.wsrp.v1.InvalidHandle;
+import org.oasis.wsrp.v1.InvalidRegistration;
+import org.oasis.wsrp.v1.InvalidSession;
+import org.oasis.wsrp.v1.InvalidUserCategory;
+import org.oasis.wsrp.v1.MissingParameters;
+import org.oasis.wsrp.v1.OperationFailed;
+import org.oasis.wsrp.v1.UnsupportedLocale;
+import org.oasis.wsrp.v1.UnsupportedMimeType;
+import org.oasis.wsrp.v1.UnsupportedMode;
+import org.oasis.wsrp.v1.UnsupportedWindowState;
+import org.oasis.wsrp.v1.WSRPV1MarkupPortType;
+import org.oasis.wsrp.v1.WSRPV1PortletManagementPortType;
+import org.oasis.wsrp.v1.WSRPV1RegistrationPortType;
+import org.oasis.wsrp.v1.WSRPV1ServiceDescriptionPortType;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 11461 $
+ * @since 2.6
+ */
+public class BehaviorBackedServiceFactory implements ServiceFactory
+{
+ private BehaviorRegistry registry;
+ private final static String MARKUP = "markup";
+ private final static String SD_URL = "sd";
+ private final static String M_URL = "m";
+ private final static String PM_URL = "pm";
+ private final static String R_URL = "r";
+ private boolean initialized = false;
+
+
+ public BehaviorBackedServiceFactory()
+ {
+ registry = new BehaviorRegistry();
+ registry.registerMarkupBehavior(new SimpleMarkupBehavior());
+ }
+
+ public <T> T getService(Class<T> serviceClass) throws Exception
+ {
+ if (WSRPV1ServiceDescriptionPortType.class.isAssignableFrom(serviceClass))
+ {
+ return (T)registry.getServiceDescriptionBehavior();
+ }
+ if (WSRPV1MarkupPortType.class.isAssignableFrom(serviceClass))
+ {
+ return (T)registry.getMarkupBehaviorFor(MARKUP);
+ }
+ if (WSRPV1PortletManagementPortType.class.isAssignableFrom(serviceClass))
+ {
+ return (T)registry.getPortletManagementBehavior();
+ }
+ if (WSRPV1RegistrationPortType.class.isAssignableFrom(serviceClass))
+ {
+ return (T)registry.getRegistrationBehavior();
+ }
+ return null;
+ }
+
+ public BehaviorRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(BehaviorRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public boolean isAvailable()
+ {
+ if (!initialized)
+ {
+ initialized = true;
+ return false;
+ }
+ return true;
+ }
+
+ public boolean isFailed()
+ {
+ return false;
+ }
+
+ public void setFailed(boolean failed)
+ {
+ // do nothing
+ }
+
+ public String getServiceDescriptionURL()
+ {
+ return SD_URL;
+ }
+
+ public String getMarkupURL()
+ {
+ return M_URL;
+ }
+
+ public String getRegistrationURL()
+ {
+ return R_URL;
+ }
+
+ public String getPortletManagementURL()
+ {
+ return PM_URL;
+ }
+
+ public void setServiceDescriptionURL(String serviceDescriptionURL)
+ {
+ // do nothing
+ }
+
+ public void setMarkupURL(String markupURL)
+ {
+ // do nothing
+ }
+
+ public void setRegistrationURL(String registrationURL)
+ {
+ // do nothing
+ }
+
+ public void setPortletManagementURL(String portletManagementURL)
+ {
+ // do nothing
+ }
+
+ public void create() throws Exception
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void start() throws Exception
+ {
+ // do nothing
+ }
+
+ public void stop()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void setWsdlDefinitionURL(String wsdlDefinitionURL) throws Exception
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public String getWsdlDefinitionURL()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void destroy()
+ {
+ throw new NotYetImplemented();
+ }
+
+ private class SimpleMarkupBehavior extends MarkupBehavior
+ {
+ public SimpleMarkupBehavior()
+ {
+ super(BehaviorBackedServiceFactory.this.registry);
+ registerHandle(MARKUP);
+ }
+
+ @Override
+ protected String getMarkupString(Mode mode, WindowState windowState, String navigationalState, GetMarkup getMarkup)
+ throws UnsupportedWindowState, InvalidCookie, InvalidSession, AccessDenied, InconsistentParameters,
+ InvalidHandle, UnsupportedLocale, UnsupportedMode, OperationFailed, MissingParameters, InvalidUserCategory,
+ InvalidRegistration, UnsupportedMimeType
+ {
+ return MARKUP;
+ }
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/BehaviorBackedServiceFactory.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockConsumerRegistry.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockConsumerRegistry.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockConsumerRegistry.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,148 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.support;
+
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.pc.federation.FederatingPortletInvoker;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.api.SessionEventBroadcaster;
+import org.gatein.wsrp.consumer.ConsumerException;
+import org.gatein.wsrp.consumer.EndpointConfigurationInfo;
+import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 12693 $
+ * @since 2.6
+ */
+public class MockConsumerRegistry implements ConsumerRegistry
+{
+ private Map consumers = new HashMap(3);
+ public static final String MOCK_SERVICE_DESCRIPTION = "mock-service-description";
+ public static final String MOCK_MARKUP = "mock-markup";
+ public static final String CONSUMER1 = "inDB";
+ public static final String CONSUMER2 = "inDB2";
+
+ /**
+ * Creates a ConsumerRegistry containing 2 consumers with id '{@link #CONSUMER1}' and '{@link #CONSUMER2}'
+ * respectively. CONSUMER2 is active and has a service description URL set to {@link #MOCK_SERVICE_DESCRIPTION} and a
+ * markup URL set to {@link #MOCK_MARKUP}
+ */
+ public MockConsumerRegistry()
+ {
+ reloadConsumers();
+ }
+
+ public List<WSRPConsumer> getConfiguredConsumers()
+ {
+ return new ArrayList<WSRPConsumer>(consumers.values());
+ }
+
+ public WSRPConsumer getConsumer(String id)
+ {
+ return (WSRPConsumer)consumers.get(id);
+ }
+
+ public FederatingPortletInvoker getFederatingPortletInvoker()
+ {
+ return null;
+ }
+
+ public WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds)
+ {
+ MockWSRPConsumer consumer = new MockWSRPConsumer(id);
+ consumer.getProducerInfo().setExpirationCacheSeconds(expirationCacheSeconds);
+ consumers.put(id, consumer);
+ return consumer;
+ }
+
+ public void persistConsumer(WSRPConsumer consumer)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(consumer, "WSRPConsumer");
+ consumers.put(consumer.getProducerId(), consumer);
+ }
+
+ public void activateConsumerWith(String id) throws ConsumerException
+ {
+ // do nothing
+ }
+
+ public void updateProducerInfo(ProducerInfo producerInfo)
+ {
+ // do nothing
+ }
+
+ public void deactivateConsumerWith(String id) throws ConsumerException
+ {
+ // do nothing
+ }
+
+ public void registerOrDeregisterConsumerWith(String id, boolean register)
+ {
+ // do nothing
+ }
+
+ public void destroyConsumer(String id)
+ {
+ // do nothing
+ }
+
+ public void reloadConsumers()
+ {
+ consumers.clear();
+ consumers.put(CONSUMER1, new MockWSRPConsumer(CONSUMER1));
+ MockWSRPConsumer consumer = new MockWSRPConsumer(CONSUMER2);
+ consumer.getProducerInfo().setActive(true);
+ EndpointConfigurationInfo info = consumer.getProducerInfo().getEndpointConfigurationInfo();
+ info.setServiceDescriptionURL(MOCK_SERVICE_DESCRIPTION);
+ info.setMarkupURL(MOCK_MARKUP);
+ consumers.put(CONSUMER2, consumer);
+ }
+
+ public void start() throws Exception
+ {
+ reloadConsumers();
+ }
+
+ public void stop() throws Exception
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void setFederatingPortletInvoker(FederatingPortletInvoker federatingPortletInvoker)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void setSessionEventBroadcaster(SessionEventBroadcaster sessionEventBroadcaster)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockConsumerRegistry.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpServletRequest.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpServletRequest.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpServletRequest.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,130 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.support;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.test.support.MockHttpServletRequest">Chris
+ * Laprun</a>
+ * @version $Revision: 11416 $
+ * @since 2.4
+ */
+public class MockHttpServletRequest implements InvocationHandler, Serializable
+{
+ private HttpSession session;
+
+ private Map attrs;
+ public static String scheme = "http";
+ public static String serverName = "test";
+ public static Integer serverPort = 1234;
+
+ private MockHttpServletRequest(HttpSession session)
+ {
+ this.session = session;
+ this.attrs = new HashMap();
+ }
+
+ /**
+ * @param session if <code>null</code>, a new MockHttpSession will be created and used instead
+ * @return
+ */
+ public static HttpServletRequest createMockRequest(HttpSession session)
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+
+ if (session == null)
+ {
+ session = MockHttpSession.createMockSession();
+ }
+
+ return (HttpServletRequest)Proxy.newProxyInstance(loader, new Class[]{HttpServletRequest.class},
+ new MockHttpServletRequest(session));
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ String methodName = method.getName();
+ if ("getSession".equals(methodName))
+ {
+ return session;
+ }
+ if ("getHeader".equals(methodName))
+ {
+ if ("User-Agent".equals(args[0]))
+ {
+ return "Mock Client User Agent";
+ }
+ return null;
+ }
+ if ("toString".equals(methodName))
+ {
+ return "MockHttpServletResponse";
+ }
+ if ("getAttribute".equals(methodName))
+ {
+ return attrs.get(args[0]);
+ }
+ if ("setAttribute".equals(methodName))
+ {
+ String name = (String)args[0];
+ Object value = args[1];
+ if (value != null)
+ {
+ attrs.put(name, value);
+ }
+ else
+ {
+ attrs.remove(value);
+ }
+ return null;
+ }
+ if ("removeAttribute".equals(methodName))
+ {
+ String name = (String)args[0];
+ attrs.remove(name);
+ return null;
+ }
+ if ("getScheme".equals(methodName))
+ {
+ return scheme;
+ }
+ if ("getServerName".equals(methodName))
+ {
+ return serverName;
+ }
+ if ("getServerPort".equals(methodName))
+ {
+ return serverPort;
+ }
+ throw new UnsupportedOperationException("MockHttpServletRequest does not support: " + method);
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpServletRequest.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpServletResponse.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpServletResponse.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpServletResponse.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,71 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.support;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.test.support.MockHttpServletResponse">Chris
+ * Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.4
+ */
+public class MockHttpServletResponse implements InvocationHandler, Serializable
+{
+ Object cookie;
+
+ private MockHttpServletResponse()
+ {
+ }
+
+ public static HttpServletResponse createMockResponse()
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ return (HttpServletResponse)Proxy.newProxyInstance(loader, new Class[]{HttpServletResponse.class}, new MockHttpServletResponse());
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ String methodName = method.getName();
+ if ("addCookie".equals(methodName))
+ {
+ cookie = args[0];
+ return null;
+ }
+ else if ("reset".equals(methodName))
+ {
+ cookie = null;
+ return null;
+ }
+ else if ("toString".equals(methodName))
+ {
+ return "MockHttpServletResponse";
+ }
+ throw new UnsupportedOperationException("MockHttpServletResponse does not support: " + method);
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpServletResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpSession.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpSession.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpSession.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,90 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.support;
+
+import org.gatein.common.util.Tools;
+
+import javax.servlet.http.HttpSession;
+import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com?subject=org.gatein.wsrp.test.support.MockHttpSession">Chris
+ * Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.4
+ */
+public class MockHttpSession implements InvocationHandler, Serializable
+{
+ private final Map map = new HashMap();
+
+ private MockHttpSession()
+ {
+ }
+
+ public static HttpSession createMockSession()
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ return (HttpSession)Proxy.newProxyInstance(loader, new Class[]{HttpSession.class}, new MockHttpSession());
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ String methodName = method.getName();
+ if ("setAttribute".equals(methodName))
+ {
+ map.put(args[0], args[1]);
+ return null;
+ }
+ else if ("removeAttribute".equals(methodName))
+ {
+ map.remove(args[0]);
+ return null;
+ }
+ else if ("getAttribute".equals(methodName))
+ {
+ return map.get(args[0]);
+ }
+ else if ("getAttributeNames".equals(methodName))
+ {
+ return Tools.toEnumeration(map.keySet().iterator());
+ }
+ else if ("toString".equals(methodName))
+ {
+ return "MockHttpSession";
+ }
+ else if ("getId".equals(methodName))
+ {
+ return "SESSION_ID";
+ }
+ else
+ {
+ throw new UnsupportedOperationException("MockHttpSession does not support: " + method);
+ }
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockHttpSession.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,178 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.support;
+
+import org.gatein.pc.api.Portlet;
+import org.gatein.pc.api.PortletContext;
+import org.gatein.pc.api.PortletInvokerException;
+import org.gatein.pc.api.PortletStateType;
+import org.gatein.pc.api.invocation.PortletInvocation;
+import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
+import org.gatein.pc.api.state.PropertyChange;
+import org.gatein.pc.api.state.PropertyMap;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.api.SessionEvent;
+import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.ProducerSessionInformation;
+import org.gatein.wsrp.consumer.RefreshResult;
+import org.gatein.wsrp.services.ServiceFactory;
+
+import javax.servlet.http.HttpSession;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class MockWSRPConsumer implements WSRPConsumer
+{
+ private ProducerInfo producerInfo;
+
+ public MockWSRPConsumer(String id)
+ {
+ producerInfo = new ProducerInfo();
+ producerInfo.setId(id);
+ }
+
+ public String getProducerId()
+ {
+ return producerInfo.getId();
+ }
+
+ public void setServiceFactory(ServiceFactory serviceFactory)
+ {
+ }
+
+ public ProducerSessionInformation getProducerSessionInformationFrom(PortletInvocation invocation)
+ {
+ return null;
+ }
+
+ public ProducerSessionInformation getProducerSessionInformationFrom(HttpSession session)
+ {
+ return null;
+ }
+
+ public ProducerInfo getProducerInfo()
+ {
+ return producerInfo;
+ }
+
+ public void setProducerInfo(ProducerInfo producerInfo)
+ {
+ }
+
+ public void refreshProducerInfo() throws PortletInvokerException
+ {
+ }
+
+ public void releaseSessions()
+ {
+ }
+
+ public void activate() throws Exception
+ {
+ }
+
+ public void deactivate() throws Exception
+ {
+ }
+
+ public boolean isActive()
+ {
+ return true;
+ }
+
+ public boolean isRefreshNeeded()
+ {
+ return false;
+ }
+
+ public RefreshResult refresh(boolean forceRefresh)
+ {
+ return null;
+ }
+
+ public Set getPortlets() throws PortletInvokerException
+ {
+ return null;
+ }
+
+ public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
+ {
+ return null;
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
+ {
+ return null;
+ }
+
+ public PortletContext createClone(PortletStateType stateType, PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public List destroyClones(List portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext, Set keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public void create() throws Exception
+ {
+ }
+
+ public void start() throws Exception
+ {
+ }
+
+ public void stop()
+ {
+ }
+
+ public void destroy()
+ {
+ }
+
+ public void onSessionEvent(SessionEvent event)
+ {
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java
___________________________________________________________________
Name: svn:executable
+ *
Added: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/TestPortletInvocationContext.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/TestPortletInvocationContext.java (rev 0)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/TestPortletInvocationContext.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -0,0 +1,132 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.wsrp.test.support;
+
+import org.gatein.common.net.media.MediaType;
+import org.gatein.common.util.MarkupInfo;
+import org.gatein.common.util.ParameterMap;
+import org.gatein.pc.api.ContainerURL;
+import org.gatein.pc.api.StateString;
+import org.gatein.pc.api.URLFormat;
+import org.gatein.pc.api.spi.PortletInvocationContext;
+import org.gatein.pc.portlet.impl.spi.AbstractPortletInvocationContext;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 11068 $
+ * @since 2.4
+ */
+public class TestPortletInvocationContext extends AbstractPortletInvocationContext implements PortletInvocationContext
+{
+
+ private HttpServletRequest mockRequest;
+ private HttpServletResponse mockResponse;
+
+ public TestPortletInvocationContext()
+ {
+ super(new MarkupInfo(MediaType.TEXT_HTML, "UTF-8")); // character set same as WSRPConstants.DEFAULT_CHARACTER_SET
+
+ mockRequest = MockHttpServletRequest.createMockRequest(null);
+ mockResponse = MockHttpServletResponse.createMockResponse();
+ }
+
+ public void setMockRequest(HttpServletRequest mockRequest)
+ {
+ this.mockRequest = mockRequest;
+ }
+
+ public void setMockResponse(HttpServletResponse mockResponse)
+ {
+ this.mockResponse = mockResponse;
+ }
+
+ public HttpServletRequest getClientRequest()
+ {
+ if (mockRequest == null)
+ {
+ throw new IllegalStateException();
+ }
+ return mockRequest;
+ }
+
+ public HttpServletResponse getClientResponse()
+ {
+ if (mockResponse == null)
+ {
+ throw new IllegalStateException();
+ }
+ return mockResponse;
+ }
+
+ public String encodeResourceURL(String url)
+ {
+ return null;
+ }
+
+ public String renderURL(ContainerURL containerURL, URLFormat urlFormat)
+ {
+ return null;
+ }
+
+ public String getCharacterEncoding()
+ {
+ return null;
+ }
+
+ public int getContentLength()
+ {
+ return 0;
+ }
+
+ public BufferedReader getReader() throws IOException
+ {
+ return null;
+ }
+
+ public InputStream getInputStream() throws IOException
+ {
+ return null;
+ }
+
+ public String getContentType()
+ {
+ return null;
+ }
+
+ public StateString getInteractionState()
+ {
+ return null;
+ }
+
+ public ParameterMap getForm()
+ {
+ return null;
+ }
+}
Property changes on: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/TestPortletInvocationContext.java
___________________________________________________________________
Name: svn:executable
+ *
Modified: components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPMessageContext.java
===================================================================
--- components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPMessageContext.java 2009-11-12 12:04:05 UTC (rev 578)
+++ components/wsrp/trunk/test/src/main/java/org/gatein/wsrp/test/handler/MockSOAPMessageContext.java 2009-11-12 12:42:15 UTC (rev 579)
@@ -23,6 +23,7 @@
package org.gatein.wsrp.test.handler;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.handler.soap.SOAPMessageContext;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
@@ -62,9 +63,15 @@
{
return getMessage();
}
- else if ("getProperty".equals(methodName))
+ else if ("get".equals(methodName))
{
- return "http://jboss.com"; // should only be called to get the endpoint address
+ // should only be called to get the endpoint address
+ if (BindingProvider.ENDPOINT_ADDRESS_PROPERTY.equals(args[0]))
+ {
+ return "http://jboss.com";
+ }
+ throw new IllegalArgumentException("MockSOAPMessageContext.get method should only be called to retrieve "
+ + BindingProvider.ENDPOINT_ADDRESS_PROPERTY + " value. Requested: " + args[0]);
}
else if ("toString".equals(methodName))
{
15 years, 2 months
gatein SVN: r578 - components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-11-12 07:04:05 -0500 (Thu, 12 Nov 2009)
New Revision: 578
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java
Log:
- Avoid NPE.
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java 2009-11-12 10:28:30 UTC (rev 577)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java 2009-11-12 12:04:05 UTC (rev 578)
@@ -741,12 +741,30 @@
serviceDescription.setRegistrationPropertyDescription(registrationPropertyDescription.value);
serviceDescription.setRequiresInitCookie(initCookie.value);
serviceDescription.setResourceList(resourceList.value);
- serviceDescription.getCustomModeDescriptions().addAll(modeDescriptions.value);
- serviceDescription.getCustomUserProfileItemDescriptions().addAll(userProfileItemDescriptions.value);
- serviceDescription.getCustomWindowStateDescriptions().addAll(windowStateDescriptions.value);
- serviceDescription.getLocales().addAll(locales.value);
- serviceDescription.getOfferedPortlets().addAll(offeredPortlets.value);
- serviceDescription.getUserCategoryDescriptions().addAll(userCategoryDescriptions.value);
+ if (WSRPUtils.existsAndIsNotEmpty(modeDescriptions.value))
+ {
+ serviceDescription.getCustomModeDescriptions().addAll(modeDescriptions.value);
+ }
+ if (WSRPUtils.existsAndIsNotEmpty(userProfileItemDescriptions.value))
+ {
+ serviceDescription.getCustomUserProfileItemDescriptions().addAll(userProfileItemDescriptions.value);
+ }
+ if (WSRPUtils.existsAndIsNotEmpty(windowStateDescriptions.value))
+ {
+ serviceDescription.getCustomWindowStateDescriptions().addAll(windowStateDescriptions.value);
+ }
+ if (WSRPUtils.existsAndIsNotEmpty(locales.value))
+ {
+ serviceDescription.getLocales().addAll(locales.value);
+ }
+ if (WSRPUtils.existsAndIsNotEmpty(offeredPortlets.value))
+ {
+ serviceDescription.getOfferedPortlets().addAll(offeredPortlets.value);
+ }
+ if (WSRPUtils.existsAndIsNotEmpty(userCategoryDescriptions.value))
+ {
+ serviceDescription.getUserCategoryDescriptions().addAll(userCategoryDescriptions.value);
+ }
return serviceDescription;
}
15 years, 2 months
gatein SVN: r577 - in portal/trunk: portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin and 2 other directories.
by do-not-reply@jboss.org
Author: tan_pham_dinh
Date: 2009-11-12 05:28:30 -0500 (Thu, 12 Nov 2009)
New Revision: 577
Removed:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.xml
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.xml
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ar.xml
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.properties
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_es.properties
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ru.properties
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_uk.properties
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_vi.xml
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
Log:
GTNPORTAL-91: After merged performance branch, some code reverted and changed, fix for that. GTNPORTAL-150: Change title Organize to Categories in ApplicationPortlet
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-11-12 10:28:30 UTC (rev 577)
@@ -28,26 +28,26 @@
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.CloneApplicationState;
import org.exoplatform.portal.config.model.Container;
-import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.ModelObject;
+import org.exoplatform.portal.config.model.PersistentApplicationState;
+import org.exoplatform.portal.config.model.TransientApplicationState;
import org.exoplatform.portal.pom.config.cache.DataCache;
import org.exoplatform.portal.pom.config.tasks.DashboardTask;
+import org.exoplatform.portal.pom.config.tasks.PageNavigationTask;
+import org.exoplatform.portal.pom.config.tasks.PageTask;
+import org.exoplatform.portal.pom.config.tasks.PortalConfigTask;
+import org.exoplatform.portal.pom.config.tasks.PortletPreferencesTask;
+import org.exoplatform.portal.pom.config.tasks.PreferencesTask;
+import org.exoplatform.portal.pom.config.tasks.SearchTask;
import org.exoplatform.portal.pom.data.DashboardData;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.pom.data.ModelDataStorage;
import org.exoplatform.portal.pom.data.NavigationData;
import org.exoplatform.portal.pom.data.NavigationKey;
import org.exoplatform.portal.pom.data.PageData;
-import org.exoplatform.portal.config.model.PersistentApplicationState;
import org.exoplatform.portal.pom.data.PageKey;
import org.exoplatform.portal.pom.data.PortalData;
import org.exoplatform.portal.pom.data.PortalKey;
-import org.exoplatform.portal.config.model.TransientApplicationState;
-import org.exoplatform.portal.pom.config.tasks.PageNavigationTask;
-import org.exoplatform.portal.pom.config.tasks.PageTask;
-import org.exoplatform.portal.pom.config.tasks.PortalConfigTask;
-import org.exoplatform.portal.pom.config.tasks.PortletPreferencesTask;
-import org.exoplatform.portal.pom.config.tasks.PreferencesTask;
-import org.exoplatform.portal.pom.config.tasks.SearchTask;
import org.exoplatform.services.cache.CacheService;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -75,7 +75,7 @@
/** . */
private final Log log = ExoLogger.getLogger(getClass());
-
+
/** . */
private final TaskExecutionDecorator executor;
@@ -152,8 +152,7 @@
return execute(new PageTask.Load(key)).getPage();
}
- public PageData clonePage(PageKey key, PageKey cloneKey)
- throws Exception
+ public PageData clonePage(PageKey key, PageKey cloneKey) throws Exception
{
return execute(new PageTask.Clone(key, cloneKey, true)).getPage();
}
@@ -241,7 +240,8 @@
}
else
{
- PreferencesTask.Load<S> load = new PreferencesTask.Load<S>(((PersistentApplicationState<S>)state).getStorageId());
+ PreferencesTask.Load<S> load =
+ new PreferencesTask.Load<S>(((PersistentApplicationState<S>)state).getStorageId());
execute(load);
return load.getState();
}
@@ -255,8 +255,18 @@
}
else
{
- PreferencesTask.Save<S> save = new PreferencesTask.Save<S>(((PersistentApplicationState<S>)state).getStorageId(), preferences);
- execute(save);
+ if (state instanceof PersistentApplicationState)
+ {
+ PreferencesTask.Save<S> save =
+ new PreferencesTask.Save<S>(((PersistentApplicationState<S>)state).getStorageId(), preferences);
+ execute(save);
+ }
+ else
+ {
+ PreferencesTask.Save<S> save =
+ new PreferencesTask.Save<S>(((CloneApplicationState<S>)state).getStorageId(), preferences);
+ execute(save);
+ }
return state;
}
}
@@ -284,7 +294,8 @@
}
else if (PortletPreferences.class.equals(type))
{
- return (LazyPageList<T>)execute(new SearchTask.FindPortletPreferences((Query<PortletPreferences>)q)).getResult();
+ return (LazyPageList<T>)execute(new SearchTask.FindPortletPreferences((Query<PortletPreferences>)q))
+ .getResult();
}
else if (PortalData.class.equals(type))
{
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ar.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ar.xml 2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ar.xml 2009-11-12 10:28:30 UTC (rev 577)
@@ -52,7 +52,7 @@
-->
<UIToolbar>
<label>
- <organize>تنظيم</organize>
+ <organize>الفئات</organize>
<portlet>مدخل</portlet>
<gadget>أداة</gadget>
</label>
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.properties 2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.properties 2009-11-12 10:28:30 UTC (rev 577)
@@ -25,7 +25,7 @@
application.msg.changeNotExist=Can not save changes to the application that no longer in database.
gadget.msg.changeNotExist=Can not save changes to the gadget that no longer in database.
## org.exoplatform.applicationregistry.webui.component.UIApplicationRegistryPortlet
-UIToolbar.label.organize=Organize
+UIToolbar.label.organize=Categories
UIToolbar.label.portlet=Portlet
UIToolbar.label.gadget=Gadget
@@ -70,7 +70,7 @@
## org.exoplatform.applicationregistry.webui.component.UIAddApplicationForm
UIAddApplicationForm.header.input=Choose
UIAddApplicationForm.label.option.portlet=Portlet
-UIAddApplicationForm.label.option.eXoGadget=Gadget
+UIAddApplicationForm.label.option.gadget=Gadget
UIAddApplicationForm.header.label=Display Name
UIAddApplicationForm.header.description=Description
UIAddApplicationForm.action.Add=Add
Deleted: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.xml 2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.xml 2009-11-12 10:28:30 UTC (rev 577)
@@ -1,283 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<bundle>
- <!--
- ##expression
- -->
- <word>
- <cancel>Cancel</cancel>
- </word>
- <label>
- <displayName>Display Name:</displayName>
- <description>Description:</description>
- </label>
- <category>
- <msg>
- <changeNotExist>Can not save changes to the category that no longer in database.</changeNotExist>
- </msg>
- </category>
- <application>
- <msg>
- <changeNotExist>Can not save changes to the application that no longer in database.</changeNotExist>
- </msg>
- <label />
- </application>
- <gadget>
- <msg>
- <changeNotExist>Can not save changes to the gadget that no longer in database.</changeNotExist>
- </msg>
- </gadget>
- <!--
- ## org.exoplatform.applicationregistry.webui.component.UIApplicationRegistryPortlet
- -->
- <UIToolbar>
- <label>
- <organize>Organize</organize>
- <portlet>Portlet</portlet>
- <gadget>Gadget</gadget>
- </label>
- </UIToolbar>
- <!--
- ## org.exoplatform.applicationregistry.webui.component.UIApplicationOrganizer
- -->
- <UIOrganizer>
- <label>
- <addCategory>Add Category</addCategory>
- <autoImport>Import Applications</autoImport>
- <categories>Categories</categories>
- </label>
- <title>
- <editCategory>Edit Category</editCategory>
- <addApplication>Add application to category</addApplication>
- <deleteCategory>Delete category</deleteCategory>
- <deleteApplication>Delete application</deleteApplication>
- </title>
- <msg>
- <importAll>This action will automatically create categories and import all the gadgets and portlets on it.</importAll>
- <deleteCategory>Are you sure to delete this category and all applications on it?</deleteCategory>
- <deleteApplication>Are you sure to delete this application?</deleteApplication>
- <emptyCategory>This category does not have any application, click (+) button to add application.</emptyCategory>
- <noCategory>There are no categories. You can click "Add Category" or "Auto Import" button to add category.</noCategory>
- <deleteCategoryInUse>Can not delete this category, it is in use.</deleteCategoryInUse>
- <deleteApplicationInUse>Can not delete this application, it is in use.</deleteApplicationInUse>
- <categoryNoExist>This category is no longer in database.</categoryNoExist>
- <applicationNoExist>This application is no longer in database.</applicationNoExist>
- </msg>
- </UIOrganizer>
-
- <!--
- ##org.exoplatform.applicationregistry.webui.component.UIApplicationRegistryEditMode
- -->
- <UIApplicationRegistryEditMode>
- <title>Import Applications</title>
- <label>
- <showImport>Change Show Import</showImport>
- </label>
- </UIApplicationRegistryEditMode>
-
- <!--
- ##org.exoplatform.applicationregistry.webui.component.UIApplicationInfo
- -->
- <UIPermissionForm>
- <label>
- <UIListPermissionSelector />
- </label>
- </UIPermissionForm>
- <UIApplicationInfo>
- <label>
- <name>Name:</name>
- <displayName>#{label.displayName}</displayName>
- <description>#{label.description}</description>
- <accessPermissions>Access Permissions</accessPermissions>
- </label>
- <title>
- <editApplication>Edit Application</editApplication>
- </title>
- </UIApplicationInfo>
- <!--
- ##org.exoplatform.applicationregistry.webui.component.UIApplicationForm
- -->
- <UIApplicationForm>
- <title>Edit application information</title>
- <label>
- <applicationName>Application Name:</applicationName>
- <displayName>#{label.displayName}</displayName>
- <description>#{label.description}</description>
- </label>
- <action>
- <Save>#{word.save}</Save>
- <Cancel>#{word.cancel}</Cancel>
- </action>
- </UIApplicationForm>
- <!--
- ## org.exoplatform.applicationregistry.webui.component.UIAddApplicationForm
- -->
- <UIAddApplicationForm>
- <header>
- <input>Choose</input>
- <label>Display Name</label>
- <description>Description</description>
- </header>
- <action>
- <Add>Add</Add>
- <Cancel>#{word.cancel}</Cancel>
- </action>
- <msg>
- <PortletExist>This Application is already in category, please select another one!</PortletExist>
- </msg>
- <label>
- <displayName>#{label.displayName}</displayName>
- <type>Application Type</type>
- </label>
- </UIAddApplicationForm>
- <!--
- ##org.exoplatform.applicationregistry.webui.component.UICategoryForm
- -->
- <UICategoryForm>
- <label>
- <name>Category name:</name>
- <displayName>#{label.displayName}</displayName>
- <description>#{label.description}</description>
- <UIListPermissionSelector />
- </label>
- <action>
- <Save>#{word.save}</Save>
- <Cancel>#{word.cancel}</Cancel>
- </action>
- <msg>
- <SameName>This category is existing, please enter another one!</SameName>
- </msg>
- <tab>
- <label>
- <categoryPermission>Permission Setting</categoryPermission>
- <categorySetting>Category Setting</categorySetting>
- </label>
- </tab>
- </UICategoryForm>
- <!--
- ## org.exoplatform.applicationregistry.webui.component.UIPortletManagement
- -->
- <UIPortletManagement>
- <title>
- <local>LOCAL</local>
- <remote>REMOTE</remote>
- </title>
- <msg>
- <noPortlet>There are no Portlets available.</noPortlet>
- </msg>
- </UIPortletManagement>
- <!--
- ## org.exoplatform.applicationregistry.webui.component.UIPortletInfo
- -->
- <UIPortletInfo>
- <label>
- <name>Portlet Name:</name>
- <display>#{label.displayName}</display>
- <description>#{label.description}</description>
- </label>
- <title>
- <portletPreferences>Portlet Preferences</portletPreferences>
- </title>
- <msg>
- <noPortletPreferences>No Portlet Preferences</noPortletPreferences>
- </msg>
- </UIPortletInfo>
- <!--
- ## org.exoplatform.portletregistry.webui.component.UIGadgetManagement
- -->
- <UIGadgetManagement>
- <label>
- <addRemote>Add a remote gadget</addRemote>
- <createNew>Create a new gadget</createNew>
- </label>
- <title>
- <deleteGadget>Delete Gadget</deleteGadget>
- </title>
- <msg>
- <noGadget>There are no Gadgets available.</noGadget>
- <deleteGadgetInUse>Can not delete this gadget, it is in use.</deleteGadgetInUse>
- <deleteGadget>Are you sure to delete this gadget?</deleteGadget>
- </msg>
- </UIGadgetManagement>
- <!--
- ## org.exoplatform.applicationregistry.webui.component.UIGadgetInfo
- -->
- <UIGadgetInfo>
- <label>
- <gadgetDetails>Gadget Details</gadgetDetails>
- <name>Gadget name:</name>
- <displayName>#{label.displayName}</displayName>
- <description>#{label.description}</description>
- <viewUrl>View URL:</viewUrl>
- <editUrl>Edit URL:</editUrl>
- <reference>Reference:</reference>
- </label>
- <title>
- <refresh>Refresh information</refresh>
- <editGadget>Edit Gadget</editGadget>
- <copy>Copy this gadget to local repository</copy>
- </title>
- <msg>
- <gadgetNotExist>Can not execute action on the gadget that no longer in database.</gadgetNotExist>
- </msg>
- </UIGadgetInfo>
- <!--
- ## org.exoplatform.applicationregistry.webui.component.UIAddGadget
- -->
- <UIAddGadget>
- <action>
- <Add>Add</Add>
- <Cancel>#{word.cancel}</Cancel>
- </action>
- <label>
- <url>URL</url>
- <urlExist>This url is existing, please select another one!</urlExist>
- <urlError>Data in url: '{0}' is not valid</urlError>
- </label>
- </UIAddGadget>
- <!--
- ## org.exoplatform.applicationregistry.webui.component.UIGadgetEditor
- -->
- <UIGadgetEditor>
- <label>
- <source>Source:</source>
- </label>
- <action>
- <Save>#{word.save}</Save>
- <Cancel>#{word.cancel}</Cancel>
- </action>
- <msg>
- <invalidSpec>This source is invalid gadget specification.</invalidSpec>
- </msg>
- </UIGadgetEditor>
- <!--
- ##package org.exoplatform.organization.webui.component.UIListPermissionSelector
- -->
- <UIListPermissionSelector>
- <header>
- <groupId>Group</groupId>
- <membership>Membership</membership>
- </header>
- </UIListPermissionSelector>
-</bundle>
-
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_es.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_es.properties 2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_es.properties 2009-11-12 10:28:30 UTC (rev 577)
@@ -25,7 +25,7 @@
application.msg.changeNotExist=No se pueden guardar los cambios a una aplicaci\u00f3n que ya no est\u00e1 en la Base de Datos.
gadget.msg.changeNotExist=No se pueden guardar los cambios a un gadget que ya no est\u00e1 en la Base de Datos.
## org.exoplatform.applicationregistry.webui.component.UIApplicationRegistryPortlet
-UIToolbar.label.organize=Organizar
+UIToolbar.label.organize=Categor\u00edas
UIToolbar.label.portlet=Portlet
UIToolbar.label.gadget=Gadget
@@ -70,7 +70,7 @@
## org.exoplatform.applicationregistry.webui.component.UIAddApplicationForm
UIAddApplicationForm.header.input=Elegir
UIAddApplicationForm.label.option.portlet=Aplicaci\u00f3n
-UIAddApplicationForm.label.option.eXoGadget=Gadget
+UIAddApplicationForm.label.option.gadget=Gadget
UIAddApplicationForm.header.label=nombre a Visualizar
UIAddApplicationForm.header.description=Descripci\u00f3n
UIAddApplicationForm.action.Add=A\u00f1adir
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ru.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ru.properties 2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ru.properties 2009-11-12 10:28:30 UTC (rev 577)
@@ -25,7 +25,7 @@
application.msg.changeNotExist=Невозможно сохранить изменения приложения, которое удалено из базы данных.
gadget.msg.changeNotExist=Невозможно сохранить изменения гаджета, который удален из базы данных.
## org.exoplatform.applicationregistry.webui.component.UIApplicationRegistryPortlet
-UIToolbar.label.organize=Управление
+UIToolbar.label.organize=Категории
UIToolbar.label.portlet=Портлет
UIToolbar.label.gadget=Гаджет
@@ -71,7 +71,7 @@
## org.exoplatform.applicationregistry.webui.component.UIAddApplicationForm
UIAddApplicationForm.header.input=Выбрать
UIAddApplicationForm.label.option.portlet=Портлет
-UIAddApplicationForm.label.option.eXoGadget=Гаджет
+UIAddApplicationForm.label.option.gadget=Гаджет
UIAddApplicationForm.header.label=Отображаемое имя
UIAddApplicationForm.header.description=Описание
UIAddApplicationForm.action.Add=Добавить
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_uk.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_uk.properties 2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_uk.properties 2009-11-12 10:28:30 UTC (rev 577)
@@ -25,7 +25,7 @@
application.msg.changeNotExist=Неможливо зберегти зміни, така програма не пов'язана з базою даних.
gadget.msg.changeNotExist=Неможливо зберегти зміни, ґаджет не пов'язаний з базою даних.
## org.exoplatform.applicationregistry.webui.component.UIApplicationRegistryPortlet
-UIToolbar.label.organize=Структура
+UIToolbar.label.organize=Категорії
UIToolbar.label.portlet=Портлет
UIToolbar.label.gadget=Ґаджет
@@ -71,7 +71,7 @@
## org.exoplatform.applicationregistry.webui.component.UIAddApplicationForm
UIAddApplicationForm.header.input=Вибрати
UIAddApplicationForm.label.option.portlet=Портлет
-UIAddApplicationForm.label.option.eXoGadget=Віджет
+UIAddApplicationForm.label.option.gadget=Віджет
UIAddApplicationForm.header.label=Відображення імені
UIAddApplicationForm.header.description=Опис
UIAddApplicationForm.action.Add=Додати
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_vi.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_vi.xml 2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_vi.xml 2009-11-12 10:28:30 UTC (rev 577)
@@ -52,7 +52,7 @@
-->
<UIToolbar>
<label>
- <organize>Tổ chức</organize>
+ <organize>Danh mục</organize>
<portlet>Portlet</portlet>
<gadget>Gadget</gadget>
</label>
Deleted: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.xml 2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.xml 2009-11-12 10:28:30 UTC (rev 577)
@@ -1,453 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- 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.
-
--->
-
-<bundle>
- <!--
- ##org.exoplatform.organization.webui.component.UIOrganizationPortlet
- -->
- <UIOrganizationPortlet>
- <label>
- <userManagement>User Management</userManagement>
- <groupManagement>Group Management</groupManagement>
- <membershipManagement>Membership Management</membershipManagement>
- </label>
- </UIOrganizationPortlet>
- <!--
- ##org.exoplatform.organization.webui.component.UIMembershipTypeForm
- -->
- <UIMembershipTypeForm>
- <title>Add/Edit Membership</title>
- <label>
- <name>Membership name</name>
- <description>Description</description>
- </label>
- <action>
- <Save>#{word.save}</Save>
- <Back>#{word.back}</Back>
- <Reset>Reset</Reset>
- </action>
- <msg>
- <SameName>This membership is existing, please enter another one!</SameName>
- </msg>
- </UIMembershipTypeForm>
- <!--
- ##org.exoplatform.organization.webui.component.UIGroupMembershipForm
- -->
- <UIGroupEditMembershipForm>
- <label>
- <username>User Name</username>
- <membership>Membership</membership>
- </label>
- <action>
- <Save>Save</Save>
- <Cancel>Cancel</Cancel>
- </action>
- <msg>
- <membership-delete>Can't save, membership removed!.</membership-delete>
- <membership-exist>"Membership type is existing, please enter another one!.</membership-exist>
- </msg>
- </UIGroupEditMembershipForm>
- <EditMembership>
- <title>
- <UIGroupEditMembershipForm>Edit Membership</UIGroupEditMembershipForm>
- <EditMembership>Edit Membership</EditMembership>
- </title>
- </EditMembership>
- <UIGroupMembershipForm>
- <label>
- <title>Group Membership</title>
- <username>Username</username>
- <membership>Membership</membership>
- <SearchUser>Select User</SearchUser>
- <Refresh>Refresh</Refresh>
- </label>
- <action>
- <Save>#{word.save}</Save>
- </action>
- <title>Add member</title>
- </UIGroupMembershipForm>
- <SearchUserForm>
- <label>
- <option>
- <userName>#{word.userName}</userName>
- <firstName>#{word.firstName}</firstName>
- <lastName>#{word.lastName}</lastName>
- <email>#{word.email}</email>
- </option>
- </label>
- </SearchUserForm>
- <SearchUser>
- <title>
- <UIUserSelector>Select User</UIUserSelector>
- <SearchUser>Select User</SearchUser>
- <ListUserForSearch>Search User</ListUserForSearch>
- </title>
- </SearchUser>
- <!--
- #{0} is the member that the remote memeber enter
- -->
- <UIMemberShipForm>
- <msg>
- <membershipType-exist>The membership type '{0}' is taken</membershipType-exist>
- </msg>
- </UIMemberShipForm>
- <!--
- ##org.exoplatform.organization.webui.component.UIMembershipForm
- -->
- <UIMembershipForm>
- <label>
- <username>User Name</username>
- <membership>Membership</membership>
- <name>Membership Name</name>
- <description>#{word.description}</description>
- </label>
- <action>
- <Save>#{word.save}</Save>
- <Back>#{word.back}</Back>
- </action>
- </UIMembershipForm>
- <!--
- ##org.exoplatform.organization.webui.component.UIListUser
- -->
- <UIListUsers>
- <header>
- <userName>#{word.userName}</userName>
- <lastName>#{word.lastName}</lastName>
- <firstName>#{word.firstName}</firstName>
- <email>#{word.email}</email>
- <action>#{word.action}</action>
- </header>
- <action>
- <title>
- <DeleteUser>Delete User</DeleteUser>
- <SelectUser>Select User</SelectUser>
- <ViewUserInfo>Edit User Info</ViewUserInfo>
- </title>
- </action>
- <label>
- <option>
- <userName>#{word.userName}</userName>
- <firstName>#{word.firstName}</firstName>
- <lastName>#{word.lastName}</lastName>
- <email>#{word.email}</email>
- </option>
- </label>
- <msg>
- <DeleteSuperUser>{0} is Super User, it can not be deleted</DeleteSuperUser>
- </msg>
- <deleteUser>Are you sure you want to delete {0} user?</deleteUser>
- </UIListUsers>
- <UIListMembershipType>
- <deleteMemberShip>Are you sure you want to delete this membership?</deleteMemberShip>
- </UIListMembershipType>
- <!--
- ##org.exoplatform.organization.webui.component.UIUserInfo
- -->
- <UIUserInfo>
- <title>User Profile Info</title>
- <tab>
- <label>
- <AccountInputSet>Account Info</AccountInputSet>
- <UIUserProfileInputSet>User Profile</UIUserProfileInputSet>
- <UIUserMembershipSelector>User Membership</UIUserMembershipSelector>
- <UIAccountEditInputSet>Account Info</UIAccountEditInputSet>
- </label>
- </tab>
- <label>
- <changePassword>Change Password:</changePassword>
- <newPassword>New Password:</newPassword>
- <confirmPassword>Confirm Password:</confirmPassword>
- <Profile>User Profile</Profile>
- <userName>#{word.userName}:</userName>
- <password>Password :</password>
- <Confirmpassword>Confirm Password :</Confirmpassword>
- <firstName>#{word.firstName}:</firstName>
- <lastName>#{word.lastName}:</lastName>
- <email>Email Address:</email>
- <HomeInfo>Home Informations</HomeInfo>
- <user>
- <name>
- <given>#{word.givenName}:</given>
- <family>#{word.familyName}:</family>
- <nickName>#{word.nickName}:</nickName>
- </name>
- <language>#{word.language}:</language>
- <bdate>#{word.birthday}:</bdate>
- <gender>#{word.gender}:</gender>
- <employer>#{word.employer}:</employer>
- <department>#{word.department}:</department>
- <jobtitle>#{word.jobTitle}:</jobtitle>
- <home-info>
- <postal>
- <name>#:</name>
- <street>#{word.street}:</street>
- <city>#{word.city}:</city>
- <stateprov>#{word.stateProv}:</stateprov>
- <postalcode>#{word.postalCode}:</postalcode>
- <country>#{word.country}:</country>
- </postal>
- <telecom>
- <mobile>
- <number>#{word.mobile}:</number>
- </mobile>
- <telephone>
- <number>#{word.tel}:</number>
- </telephone>
- </telecom>
- <online>
- <email>#{word.email}:</email>
- <uri>Website:</uri>
- </online>
- </home-info>
- <business-info>
- <postal>
- <name>#:</name>
- <city>#{word.city}:</city>
- <stateprov>State/Prov:</stateprov>
- <postalcode>Postal Code:</postalcode>
- <country>#{word.country}:</country>
- </postal>
- <telecom>
- <mobile>
- <number>#{word.mobile}:</number>
- </mobile>
- <telephone>
- <number>#{word.tel}:</number>
- </telephone>
- </telecom>
- <online>
- <email>#{word.email}:</email>
- <uri>#{word.website}:</uri>
- </online>
- </business-info>
- </user>
- <option>
- <male>Male</male>
- <female>Female</female>
- <en>English</en>
- <ma>Ma</ma>
- <vi>Vietnamese</vi>
- <ar>Arabic</ar>
- <fr>French</fr>
- <ru>Russian</ru>
- </option>
- <BusinessInfo>Business Informations</BusinessInfo>
- </label>
- <action>
- <Back>#{word.cancel}</Back>
- <Save>#{word.save}</Save>
- </action>
- </UIUserInfo>
- <!--
- ##org.exoplatform.organization.webui.component.UIUserInGroup
- -->
- <UIUserInGroup>
- <confirm>
- <deleteUser>Are you sure you want to delete user {0} from group {1}?</deleteUser>
- </confirm>
- <header>
- <userName>#{word.userName}</userName>
- <lastName>#{word.lastName}</lastName>
- <firstName>#{word.firstName}</firstName>
- <email>#{word.email}</email>
- <action>#{word.action}</action>
- <membershipType>Membership Type</membershipType>
- <lastLoginTime>Last Login</lastLoginTime>
- </header>
- <label>
- <username>#{word.userName}</username>
- <membership>Membership name</membership>
- </label>
- <action>
- <title>
- <DeleteUser>Delete member</DeleteUser>
- <Edit>Edit member</Edit>
- </title>
- </action>
- </UIUserInGroup>
- <!--
- ##org.exoplatform.organization.webui.component.UIGroupInfo
- -->
- <UIGroupInfo>
- <tab>
- <label>
- <UIUserInGroup>User In Group</UIUserInGroup>
- </label>
- </tab>
- <label>
- <UIUserInGroup />
- </label>
- <title>Group Info</title>
- </UIGroupInfo>
- <!--
- ##org.exoplatform.organization.webui.component.UIMembershipList
- -->
- <UIMembershipList>
- <header>
- <name>Membership name</name>
- <createdDate>Created date</createdDate>
- <modifiedDate>Modified date</modifiedDate>
- <action>#{word.action}</action>
- <description>#{word.description}</description>
- </header>
- <action>
- <title>
- <EditMembership>Edit Membership</EditMembership>
- <DeleteMembership>Delete Membership</DeleteMembership>
- </title>
- </action>
- <msg>
- <InUse>You can not delete this membership because it is in use</InUse>
- <DeleteMandatory>You can not delete this membership because it is mandatory</DeleteMandatory>
- </msg>
- </UIMembershipList>
- <!--
- ##org.exoplatform.organization.webui.component.UIGroupMembershipForm
- -->
- <UIUserMembershipSelector>
- <deleteMembership>Are you sure you want to delete this membership?</deleteMembership>
- </UIUserMembershipSelector>
- <!--
- ##org.exoplatform.organization.webui.component.UIGroupForm
- -->
- <AddGroup>
- <title>Add New Group</title>
- <action>
- <Save>#{word.save}</Save>
- <Back>#{word.cancel}</Back>
- </action>
- </AddGroup>
- <EditGroup>
- <title>Edit Current Group</title>
- <action>
- <Save>#{word.save}</Save>
- <Back>#{word.cancel}</Back>
- </action>
- </EditGroup>
- <UIGroupForm>
- <label>
- <groupName>Group Name</groupName>
- <description>Description</description>
- <label>Label</label>
- </label>
- <msg>
- <group-exist>This group name is existing, please enter another one!</group-exist>
- </msg>
- </UIGroupForm>
- <!--
- ############################################################################
- # org.exoplatform.portal.component.customization.UIShareNavigationForm #
- ############################################################################
- -->
- <UITabPane>
- <title>
- <UISharedNavigationForm>Shared Navigation</UISharedNavigationForm>
- <UISharedPortalForm>Shared Portal</UISharedPortalForm>
- <UIUserInGroup>Group Info</UIUserInGroup>
- <UISharedNavigation>Group Page Navigation</UISharedNavigation>
- </title>
- </UITabPane>
- <UISharedNavigationForm>
- <action>
- <Save>#{word.save}</Save>
- <Back>#{word.back}</Back>
- <Remove>Remove</Remove>
- </action>
- <label>
- <navigation>Navigation</navigation>
- <description>Description</description>
- <membership>Membership</membership>
- <priority>Priority</priority>
- </label>
- <tab>
- <label>
- <SharedNavigation>Shared Navigation Setting</SharedNavigation>
- <Permission>Permission Selector</Permission>
- </label>
- </tab>
- <msg>
- <user-nonexist>User "{0}" is not exist</user-nonexist>
- </msg>
- </UISharedNavigationForm>
- <UISharedNavigation>
- <msg>
- <notSelected>You must select a group!</notSelected>
- </msg>
- <label>
- <userNavigation>User Page Navigation Name</userNavigation>
- <priority>Priority</priority>
- </label>
- <action>
- <Save>Save</Save>
- </action>
- </UISharedNavigation>
- <!--
- #############################################################################
- # org.exoplatform.portal.component.customization.UISharePortalForm#
- #############################################################################
- -->
- <UISharedPortalForm>
- <action>
- <Save>#{word.save}</Save>
- <Back>#{word.back}</Back>
- <Remove>Remove</Remove>
- </action>
- <label>
- <portal>Portal</portal>
- <description>Description</description>
- <membership>Membership</membership>
- <priority>Priority</priority>
- </label>
- <tab>
- <label>
- <SharedPortal>Portal Setting</SharedPortal>
- <Permission>Permission Selector</Permission>
- </label>
- </tab>
- <msg>
- <user-nonexist>User "{0}" is not exist</user-nonexist>
- </msg>
- </UISharedPortalForm>
- <UIGroupSharedInfo>
- <title>Share Info</title>
- </UIGroupSharedInfo>
- <!--
- #############################################################################
- # org.exoplatform.portal.organization.component.UIGroupManagement#
- #############################################################################
- -->
- <UIGroupManagement>
- <label>
- <Groups>Groups</Groups>
- <AddGroup>Add New Group</AddGroup>
- <EditGroup>Edit Selected Group</EditGroup>
- <DeleteGroup>Delete Selected Group</DeleteGroup>
- </label>
- <deleteGroup>Are you sure you want to delete this group?</deleteGroup>
- </UIGroupManagement>
- <!--
- #############################################################################
- # org.exoplatform.portal.organization.component.UISharedNavigation#
- #############################################################################
- -->
-</bundle>
-
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java 2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java 2009-11-12 10:28:30 UTC (rev 577)
@@ -56,17 +56,20 @@
{
if (type == ApplicationType.PORTLET)
{
- @SuppressWarnings("unchecked") ModelAdapter<S, C> adapter = (ModelAdapter<S, C>)PORTLET;
+ @SuppressWarnings("unchecked")
+ ModelAdapter<S, C> adapter = (ModelAdapter<S, C>)PORTLET;
return adapter;
}
else if (type == ApplicationType.GADGET)
{
- @SuppressWarnings("unchecked") ModelAdapter<S, C> adapter = (ModelAdapter<S, C>)GADGET;
+ @SuppressWarnings("unchecked")
+ ModelAdapter<S, C> adapter = (ModelAdapter<S, C>)GADGET;
return adapter;
}
else if (type == ApplicationType.WSRP_PORTLET)
{
- @SuppressWarnings("unchecked") ModelAdapter<S, C> adapter = (ModelAdapter<S, C>)WSRP;
+ @SuppressWarnings("unchecked")
+ ModelAdapter<S, C> adapter = (ModelAdapter<S, C>)WSRP;
return adapter;
}
else
@@ -80,7 +83,8 @@
{
@Override
- public StatefulPortletContext<ExoPortletState> getPortletContext(ExoContainer container, String applicationId, ApplicationState<Portlet> applicationState) throws Exception
+ public StatefulPortletContext<ExoPortletState> getPortletContext(ExoContainer container, String applicationId,
+ ApplicationState<Portlet> applicationState) throws Exception
{
DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
Portlet preferences = dataStorage.load(applicationState);
@@ -97,7 +101,8 @@
}
@Override
- public ApplicationState<Portlet> update(ExoContainer container, ExoPortletState updateState, ApplicationState<Portlet> applicationState) throws Exception
+ public ApplicationState<Portlet> update(ExoContainer container, ExoPortletState updateState,
+ ApplicationState<Portlet> applicationState) throws Exception
{
// Compute new preferences
PortletBuilder builder = new PortletBuilder();
@@ -114,9 +119,8 @@
}
else
{
- PersistentApplicationState<Portlet> persistentState = (PersistentApplicationState<Portlet>)applicationState;
DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
- return dataStorage.save(persistentState, builder.build());
+ return dataStorage.save(applicationState, builder.build());
}
}
@@ -126,7 +130,8 @@
String[] chunks = Utils.split("/", applicationState);
String appName = chunks[0];
String portletName = chunks[1];
- return PortletContext.createPortletContext(PortletInvoker.LOCAL_PORTLET_INVOKER_ID + "./" + appName + "." + portletName);
+ return PortletContext.createPortletContext(PortletInvoker.LOCAL_PORTLET_INVOKER_ID + "./" + appName + "."
+ + portletName);
}
@Override
@@ -136,14 +141,17 @@
{
TransientApplicationState<Portlet> transientState = (TransientApplicationState<Portlet>)applicationState;
Portlet pref = transientState.getContentState();
- if(pref == null) pref = new Portlet();
+ if (pref == null)
+ pref = new Portlet();
return pref;
}
else
{
- PersistentApplicationState<Portlet> persistentState = (PersistentApplicationState<Portlet>)applicationState;
DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
- return dataStorage.load(persistentState);
+ Portlet pref = dataStorage.load(applicationState);
+ if (pref == null)
+ pref = new Portlet();
+ return pref;
}
}
};
@@ -158,9 +166,11 @@
private final PortletContext WRAPPER_CONTEXT = PortletContext.createPortletContext(WRAPPER_ID);
@Override
- public StatefulPortletContext<ExoPortletState> getPortletContext(ExoContainer container, String applicationId, ApplicationState<Gadget> applicationState) throws Exception
+ public StatefulPortletContext<ExoPortletState> getPortletContext(ExoContainer container, String applicationId,
+ ApplicationState<Gadget> applicationState) throws Exception
{
- GadgetRegistryService gadgetService = (GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
+ GadgetRegistryService gadgetService =
+ (GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
org.exoplatform.application.gadget.Gadget model = gadgetService.getGadget(applicationId);
GadgetApplication application = new GadgetApplication(model.getName(), model.getUrl(), model.isLocal());
String url = GadgetUtil.reproduceUrl(application.getUrl(), application.isLocal());
@@ -170,7 +180,8 @@
}
@Override
- public ApplicationState<Gadget> update(ExoContainer container, ExoPortletState updateState, ApplicationState<Gadget> gadgetApplicationState) throws Exception
+ public ApplicationState<Gadget> update(ExoContainer container, ExoPortletState updateState,
+ ApplicationState<Gadget> gadgetApplicationState) throws Exception
{
throw new UnsupportedOperationException("todo / julien");
}
@@ -189,13 +200,12 @@
}
};
-
private static final ModelAdapter<WSRP, WSRP> WSRP = new ModelAdapter<WSRP, WSRP>()
{
@Override
public Portlet getState(ExoContainer container, ApplicationState<WSRP> state) throws Exception
{
- return null; // return null for now
+ return null; // return null for now
}
@Override
@@ -205,7 +215,8 @@
}
@Override
- public StatefulPortletContext<WSRP> getPortletContext(ExoContainer container, String applicationId, ApplicationState<WSRP> state) throws Exception
+ public StatefulPortletContext<WSRP> getPortletContext(ExoContainer container, String applicationId,
+ ApplicationState<WSRP> state) throws Exception
{
DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
WSRP wsrp = dataStorage.load(state);
@@ -218,7 +229,8 @@
}
@Override
- public ApplicationState<WSRP> update(ExoContainer container, WSRP updateState, ApplicationState<WSRP> state) throws Exception
+ public ApplicationState<WSRP> update(ExoContainer container, WSRP updateState, ApplicationState<WSRP> state)
+ throws Exception
{
if (state instanceof TransientApplicationState)
{
@@ -237,9 +249,11 @@
public abstract PortletContext getProducerOfferedPortletContext(String applicationId);
- public abstract StatefulPortletContext<C> getPortletContext(ExoContainer container, String applicationId, ApplicationState<S> applicationState) throws Exception;
+ public abstract StatefulPortletContext<C> getPortletContext(ExoContainer container, String applicationId,
+ ApplicationState<S> applicationState) throws Exception;
- public abstract ApplicationState<S> update(ExoContainer container, C updateState, ApplicationState<S> applicationState) throws Exception;
+ public abstract ApplicationState<S> update(ExoContainer container, C updateState,
+ ApplicationState<S> applicationState) throws Exception;
/**
* Returns the state of the gadget as preferences or null if the preferences cannot be edited as such.
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2009-11-12 10:28:30 UTC (rev 577)
@@ -19,14 +19,18 @@
package org.exoplatform.portal.webui.portal;
+import org.exoplatform.application.registry.Application;
import org.exoplatform.commons.utils.PageList;
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.CloneApplicationState;
import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.TransientApplicationState;
+import org.exoplatform.portal.pom.spi.gadget.Gadget;
import org.exoplatform.portal.webui.application.PortletState;
import org.exoplatform.portal.webui.application.UIApplicationList;
+import org.exoplatform.portal.webui.application.UIGadget;
import org.exoplatform.portal.webui.application.UIPortlet;
import org.exoplatform.portal.webui.container.UIContainerList;
import org.exoplatform.portal.webui.login.UILogin;
@@ -235,10 +239,17 @@
}
else
{
- org.exoplatform.application.registry.Application app = null;
+ Application app = null;
UIApplicationList appList = uiApp.findFirstComponentOfType(UIApplicationList.class);
app = appList.getApplication(sourceId);
ApplicationType applicationType = app.getType();
+ Application temp = null;
+ if (applicationType.equals(ApplicationType.GADGET))
+ {
+ applicationType = ApplicationType.PORTLET;
+ temp = app;
+ app = appList.getApplication("dashboard/Gadget_Wrapper_Portlet");
+ }
//
UIPortlet uiPortlet = uiTarget.createUIComponent(UIPortlet.class, null, null);
@@ -268,6 +279,12 @@
//
uiPortlet.setState(new PortletState(state, applicationType));
+ if (temp != null && applicationType.equals(ApplicationType.PORTLET))
+ {
+ UIGadget uiGadget = uiPortlet.createUIComponent(UIGadget.class, null, null);
+ uiGadget.setState(new TransientApplicationState<Gadget>(temp.getApplicationName()));
+ uiPortlet.getPreferences().setValue("url", uiGadget.getUrl());
+ }
uiPortlet.setPortletInPortal(uiTarget instanceof UIPortal);
uiPortlet.setShowEditControl(true);
@@ -303,7 +320,6 @@
uiTarget.getChildren().add(position, uiSource);
uiSource.setParent(uiTarget);
}
-
}
public static class ChangeLanguageActionListener extends EventListener<UIPortal>
15 years, 2 months
gatein SVN: r576 - in portal/trunk/component/portal/src: test/java/org/exoplatform/portal/config and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-11-12 04:48:36 -0500 (Thu, 12 Nov 2009)
New Revision: 576
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
Log:
rewrote the few legacy remaining tests of the TestDataStorage
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java 2009-11-12 08:12:42 UTC (rev 575)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/PortalConfig.java 2009-11-12 09:48:36 UTC (rev 576)
@@ -198,11 +198,6 @@
modifiable = b;
}
- // public String getFactoryId() {
- // return factoryId;
- // }
- // public void setFactoryId(String factoryId) { this.factoryId = factoryId; }
-
public String getCreator()
{
return creator;
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-11-12 08:12:42 UTC (rev 575)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-11-12 09:48:36 UTC (rev 576)
@@ -82,124 +82,107 @@
mgr.closeSession(false);
}
- public void testPortalConfigCreate() throws Exception
+ public void testCreatePortal() throws Exception
{
- PortalConfig portalConfig = new PortalConfig();
- portalConfig.setName(testPortal);
- portalConfig.setLocale("en");
- portalConfig.setAccessPermissions(new String[]{UserACL.EVERYONE});
+ PortalConfig portal = new PortalConfig();
+ portal.setType("portal");
+ portal.setName("foo");
+ portal.setLocale("en");
+ portal.setAccessPermissions(new String[]{UserACL.EVERYONE});
- PortalConfig returnConfig = storage_.getPortalConfig(portalConfig.getName());
- if (returnConfig != null)
- storage_.remove(returnConfig);
-
- storage_.create(portalConfig);
- returnConfig = storage_.getPortalConfig(portalConfig.getName());
- assertNotNull(returnConfig);
- assertEquals(portalConfig.getName(), returnConfig.getName());
- assertEquals(portalConfig.getCreator(), returnConfig.getCreator());
+ //
+ storage_.create(portal);
+ portal = storage_.getPortalConfig(portal.getName());
+ assertNotNull(portal);
+ assertEquals("portal", portal.getType());
+ assertEquals("foo", portal.getName());
}
public void testPortalConfigSave() throws Exception
{
- testPortalConfigCreate();
+ PortalConfig portal = storage_.getPortalConfig("portal", "test");
+ assertNotNull(portal);
//
- PortalConfig portalConfig = storage_.getPortalConfig(testPortal);
+ portal.setLocale("vietnam");
+ storage_.save(portal);
- assertNotNull(portalConfig);
-
- String newLocale = "vietnam";
- portalConfig.setLocale(newLocale);
- storage_.save(portalConfig);
- portalConfig = storage_.getPortalConfig(testPortal);
- assertNotNull(portalConfig);
- assertEquals(newLocale, portalConfig.getLocale());
+ //
+ portal = storage_.getPortalConfig("portal", "test");
+ assertNotNull(portal);
+ assertEquals("vietnam", portal.getLocale());
}
public void testPortalConfigRemove() throws Exception
{
- testPortalConfigSave();
+ PortalConfig portal = storage_.getPortalConfig("portal", "test");
+ assertNotNull(portal);
//
- PortalConfig portalConfig = storage_.getPortalConfig(testPortal);
- assertNotNull(portalConfig);
-
- storage_.remove(portalConfig);
- assertNull(storage_.getPortalConfig(testPortal));
+ storage_.remove(portal);
+ portal = storage_.getPortalConfig(testPortal);
+ assertNull(portal);
}
- public void testPageConfigCreate() throws Exception
+ public void testCreatePage() throws Exception
{
- testPortalConfigRemove();
+ Page page = new Page();
+ page.setTitle("MyTitle");
+ page.setOwnerType(PortalConfig.PORTAL_TYPE);
+ page.setOwnerId("test");
+ page.setName("foo");
//
- createPageConfig(PortalConfig.PORTAL_TYPE, "portalone");
- createPageConfig(PortalConfig.USER_TYPE, "exoadmin");
- createPageConfig(PortalConfig.GROUP_TYPE, "portal/admin");
- }
+ storage_.create(page);
- private void createPageConfig(String ownerType, String ownerId) throws Exception
- {
- Page page = new Page();
- page.setName("testPage");
- page.setOwnerId("classic");
- page.setOwnerType("portal");
+ //
+ Page page2 = storage_.getPage(page.getPageId());
- try
- {
- storage_.create(page);
- }
- catch (Exception e)
- {
- page = storage_.getPage(page.getPageId());
- }
-
- Page returnPage = storage_.getPage(page.getPageId());
- assertNotNull(returnPage);
- assertEquals(page.getPageId(), returnPage.getPageId());
- assertEquals(page.getOwnerType(), returnPage.getOwnerType());
- assertEquals(page.getOwnerId(), returnPage.getOwnerId());
- assertEquals(page.getChildren().size(), returnPage.getChildren().size());
+ //
+ assertNotNull(page2);
+ assertEquals("portal::test::foo", page2.getPageId());
+ assertEquals("portal", page2.getOwnerType());
+ assertEquals("test", page2.getOwnerId());
+ assertEquals("foo", page2.getName());
+ assertEquals("MyTitle", page2.getTitle());
+ assertEquals(0, page2.getChildren().size());
}
- public void testPageConfigSave() throws Exception
+ public void testSavePage() throws Exception
{
- testPageConfigCreate();
+ Page page = new Page();
+ page.setTitle("MyTitle");
+ page.setOwnerType(PortalConfig.PORTAL_TYPE);
+ page.setOwnerId("test");
+ page.setName("foo");
//
- Page page = storage_.getPage(testPage);
- assertNotNull(page);
+ storage_.create(page);
//
- PortalConfig portalConfig = new PortalConfig();
- portalConfig.setName("customers");
- portalConfig.setLocale("en");
- portalConfig.setAccessPermissions(new String[]{UserACL.EVERYONE});
- storage_.create(portalConfig);
+ Page page2 = storage_.getPage(page.getPageId());
+ page2.setTitle("MyTitle2");
+ storage_.save(page2);
- page.setTitle("New Page Title");
- page.setOwnerId("customers");
- storage_.save(page);
-
- Page returnPage = storage_.getPage(page.getPageId());
- assertEquals("New Page Title", returnPage.getTitle());
- assertEquals(page.getPageId(), returnPage.getPageId());
- assertEquals(page.getOwnerType(), returnPage.getOwnerType());
- assertEquals(page.getOwnerId(), returnPage.getOwnerId());
- assertEquals(page.getChildren().size(), returnPage.getChildren().size());
+ //
+ assertNotNull(page2);
+ assertEquals("portal::test::foo", page2.getPageId());
+ assertEquals("portal", page2.getOwnerType());
+ assertEquals("test", page2.getOwnerId());
+ assertEquals("foo", page2.getName());
+ assertEquals("MyTitle2", page2.getTitle());
+ assertEquals(0, page2.getChildren().size());
}
- public void testPageConfigRemove() throws Exception
+ public void testPageRemove() throws Exception
{
- testPageConfigSave();
-
- //
- Page page = storage_.getPage(testPage);
+ Page page = storage_.getPage("portal::test::test1");
assertNotNull(page);
+ //
storage_.remove(page);
+ //
page = storage_.getPage(testPage);
assertNull(page);
}
@@ -247,59 +230,50 @@
// Need to make window move 2 unit test
- public void testNavigationCreate() throws Exception
+ public void testCreateNavigation() throws Exception
{
- testPageConfigRemove();
+ PortalConfig portal = new PortalConfig();
+ portal.setName("foo");
+ portal.setLocale("en");
+ portal.setAccessPermissions(new String[]{UserACL.EVERYONE});
+ storage_.save(portal);
//
- PortalConfig portalConfig = new PortalConfig();
- portalConfig.setName(testPortal);
- portalConfig.setLocale("en");
- portalConfig.setAccessPermissions(new String[]{UserACL.EVERYONE});
- storage_.save(portalConfig);
-
- //
- PageNavigation pageNavi = new PageNavigation();
- pageNavi.setOwnerId(testPortal);
- pageNavi.setOwnerType("portal");
- storage_.create(pageNavi);
+ PageNavigation navigation = new PageNavigation();
+ navigation.setOwnerId("foo");
+ navigation.setOwnerType("portal");
+ storage_.create(navigation);
}
- public void testNavigationSave() throws Exception
+ public void testSaveNavigation() throws Exception
{
- testNavigationCreate();
-
- //
- PageNavigation pageNavi = storage_.getPageNavigation("portal", testPortal);
+ PageNavigation pageNavi = storage_.getPageNavigation("portal", "test");
assertNotNull(pageNavi);
- String newModifier = "trong.tran";
- pageNavi.setModifier(newModifier);
+ //
+ pageNavi.setModifier("trong.tran");
storage_.save(pageNavi);
+ //
PageNavigation newPageNavi = storage_.getPageNavigation(pageNavi.getOwnerType(), pageNavi.getOwnerId());
- assertEquals(newModifier, newPageNavi.getModifier());
+ assertEquals("trong.tran", newPageNavi.getModifier());
}
- public void testNavigationRemove() throws Exception
+ public void testRemoveNavigation() throws Exception
{
- testNavigationSave();
+ PageNavigation navigation = storage_.getPageNavigation("portal", "test");
+ assertNotNull(navigation);
//
- PageNavigation pageNavi = storage_.getPageNavigation("portal", testPortal);
- assertNotNull(pageNavi);
+ storage_.remove(navigation);
- storage_.remove(pageNavi);
-
- pageNavi = storage_.getPageNavigation("portal", testPortal);
- // assertNull(pageNavi);
+ //
+ navigation = storage_.getPageNavigation("portal", "test");
+ assertNull(navigation);
}
- public void testPortletPreferencesCreate() throws Exception
+ public void testCreatePortletPreferences() throws Exception
{
- testNavigationRemove();
-
- //
ArrayList<Preference> prefs = new ArrayList<Preference>();
for (int i = 0; i < 5; i++)
{
@@ -309,29 +283,19 @@
prefs.add(pref);
}
+ //
PortletPreferences portletPreferences = new PortletPreferences();
portletPreferences.setWindowId(testPortletPreferences);
portletPreferences.setPreferences(prefs);
+ //
storage_.save(portletPreferences);
+ //
PortletPreferences portletPref = storage_.getPortletPreferences(testPortletPreferences);
assertEquals(portletPref.getWindowId(), testPortletPreferences);
}
- public void testPortletPreferencesSave() throws Exception
- {
- testPortletPreferencesCreate();
-
- //
- PortletPreferences portletPref = storage_.getPortletPreferences(testPortletPreferences);
- assertNotNull(portletPref);
-
- List<Preference> prefs = portletPref.getPreferences();
- assertNotNull(prefs);
- assertEquals(5, prefs.size());
- }
-
public void testWindowScopedPortletPreferences() throws Exception
{
Page page = new Page();
15 years, 2 months
gatein SVN: r575 - in portal/trunk/component/portal/src: test/java/org/exoplatform/portal/config and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-11-12 03:12:42 -0500 (Thu, 12 Nov 2009)
New Revision: 575
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/ModelChange.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
Log:
add a unit test for assessing window move
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 2009-11-12 03:51:21 UTC (rev 574)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2009-11-12 08:12:42 UTC (rev 575)
@@ -357,43 +357,6 @@
);
}
- public List<ModelChange> save(PageData src, Site site, String name)
- {
- org.gatein.mop.api.workspace.Page root = site.getRootPage();
- org.gatein.mop.api.workspace.Page pages = root.getChild("pages");
- org.gatein.mop.api.workspace.Page dst = pages.getChild(name);
-
- //
- LinkedList<ModelChange> changes = new LinkedList<ModelChange>();
-
- //
- if (dst == null)
- {
- dst = pages.addChild(name);
- changes.add(new ModelChange.Create(src));
- }
- else
- {
- changes.add(new ModelChange.Update(src));
- }
-
- //
- Attributes attrs = dst.getAttributes();
- attrs.setValue(MappedAttributes.TITLE, src.getTitle());
- attrs.setValue(MappedAttributes.FACTORY_ID, src.getFactoryId());
- attrs.setValue(MappedAttributes.ACCESS_PERMISSIONS, join("|", src.getAccessPermissions()));
- attrs.setValue(MappedAttributes.EDIT_PERMISSION, src.getEditPermission());
- attrs.setValue(MappedAttributes.SHOW_MAX_WINDOW, src.isShowMaxWindow());
- attrs.setValue(MappedAttributes.CREATOR, src.getCreator());
- attrs.setValue(MappedAttributes.MODIFIER, src.getModifier());
-
- //
- changes.addAll(saveChildren(src, dst.getRootComponent()));
-
- //
- return changes;
- }
-
private ContainerData load(UIContainer src, List<ComponentData> children)
{
Attributes attrs = src.getAttributes();
@@ -485,6 +448,47 @@
return children;
}
+ public List<ModelChange> save(PageData src, Site site, String name)
+ {
+ org.gatein.mop.api.workspace.Page root = site.getRootPage();
+ org.gatein.mop.api.workspace.Page pages = root.getChild("pages");
+ org.gatein.mop.api.workspace.Page dst = pages.getChild(name);
+
+ //
+ LinkedList<ModelChange> changes = new LinkedList<ModelChange>();
+
+ //
+ if (dst == null)
+ {
+ dst = pages.addChild(name);
+ changes.add(new ModelChange.Create(dst.getObjectId(), src));
+ }
+ else
+ {
+ changes.add(new ModelChange.Update(src));
+ }
+
+ //
+ Attributes attrs = dst.getAttributes();
+ attrs.setValue(MappedAttributes.TITLE, src.getTitle());
+ attrs.setValue(MappedAttributes.FACTORY_ID, src.getFactoryId());
+ attrs.setValue(MappedAttributes.ACCESS_PERMISSIONS, join("|", src.getAccessPermissions()));
+ attrs.setValue(MappedAttributes.EDIT_PERMISSION, src.getEditPermission());
+ attrs.setValue(MappedAttributes.SHOW_MAX_WINDOW, src.isShowMaxWindow());
+ attrs.setValue(MappedAttributes.CREATOR, src.getCreator());
+ attrs.setValue(MappedAttributes.MODIFIER, src.getModifier());
+
+ //
+ UIContainer rootContainer = dst.getRootComponent();
+ LinkedList<ModelChange> childrenChanges = saveChildren(src, rootContainer);
+
+ //
+ changes.addAll(childrenChanges);
+
+ //
+ return changes;
+ }
+
private void save(ContainerData src, UIContainer dst)
{
Attributes dstAttrs = dst.getAttributes();
@@ -502,6 +506,9 @@
dstAttrs.setValue(MappedAttributes.NAME, src.getName());
}
+ /*
+ * Performs routing of the corresponding save method
+ */
private void save(ModelData src, WorkspaceObject dst, LinkedList<ModelChange> changes,
Map<String, String> hierarchyRelationships)
{
@@ -526,18 +533,18 @@
private LinkedList<ModelChange> saveChildren(final ContainerData src, UIContainer dst)
{
-
- //
LinkedList<ModelChange> changes = new LinkedList<ModelChange>();
- //
+ // The relationship in the hierarchy
+ // basically it's a map of the relationships between parent/child nodes
+ // that is helpful to detect move operations
+ // that we make immutable to avoid any bug
Map<String, String> hierarchyRelationships = new HashMap<String, String>();
-
- //
build(src, hierarchyRelationships);
+ hierarchyRelationships = Collections.unmodifiableMap(hierarchyRelationships);
//
- saveChildren(src, dst, changes, Collections.unmodifiableMap(hierarchyRelationships));
+ saveChildren(src, dst, changes, hierarchyRelationships);
//
return changes;
@@ -572,9 +579,11 @@
//
for (ModelData srcChild : src.getChildren())
{
- String srcId = srcChild.getStorageId();
+ String srcChildId = srcChild.getStorageId();
// Replace dashboard application by container if needed
+ // this should be removed once we make the dashboard as first class
+ // citizen of the portal
if (srcChild instanceof ApplicationData)
{
ApplicationData app = (ApplicationData)srcChild;
@@ -599,13 +608,14 @@
//
UIComponent dstChild;
- if (srcId != null)
+ if (srcChildId != null)
{
- dstChild = session.findObjectById(ObjectType.COMPONENT, srcId);
+ dstChild = session.findObjectById(ObjectType.COMPONENT, srcChildId);
if (dstChild == null)
{
- throw new AssertionError("Could not find supposed present child with id " + srcId);
+ throw new AssertionError("Could not find supposed present child with id " + srcChildId);
}
+
// julien : this can fail due to a bug in chromattic not implementing equals method properly
// and is replaced with the foreach below
/*
@@ -614,23 +624,27 @@
"that is not present in the target ui container " + session.pathOf(dst));
}
*/
-
- //
boolean found = false;
for (UIComponent child : dst)
{
- if (child.getObjectId().equals(srcId))
+ if (child.getObjectId().equals(srcChildId))
{
found = true;
break;
}
}
+
+ //
if (!found)
{
- if (hierarchyRelationships.containsKey(srcId))
+ String srcId = hierarchyRelationships.get(srcChildId);
+ if (srcId != null)
{
// It's a move operation, so we move the node first
dst.add(dstChild);
+
+ //
+ changes.add(new ModelChange.Move(srcId, dst.getObjectId(), srcChildId));
}
else
{
@@ -666,34 +680,40 @@
{
throw new AssertionError("Was not expecting child " + srcChild);
}
- changes.add(new ModelChange.Create(srcChild));
+ changes.add(new ModelChange.Create(dst.getObjectId(), srcChild));
}
//
save(srcChild, dstChild, changes, hierarchyRelationships);
//
- String dstId = dstChild.getObjectId();
- modelObjectMap.put(dstId, srcChild);
- orders.add(dstId);
+ String dstChildId = dstChild.getObjectId();
+ modelObjectMap.put(dstChildId, srcChild);
+ orders.add(dstChildId);
}
- // Take care of move operation that could be seen as a remove
+ // Take care of move operation that could be seen as a remove otherwise
for (UIComponent dstChild : dst)
{
- String dstId = dstChild.getObjectId();
- if (!modelObjectMap.containsKey(dstId) && hierarchyRelationships.containsKey(dstId))
+ String dstChildId = dstChild.getObjectId();
+ if (!modelObjectMap.containsKey(dstChildId))
{
- String parentId = hierarchyRelationships.get(dstId);
+ String parentId = hierarchyRelationships.get(dstChildId);
+ if (parentId != null)
+ {
+ // Get the new parent
+ UIContainer parent = session.findObjectById(ObjectType.CONTAINER, parentId);
- // Get the new parent
- UIContainer parent = session.findObjectById(ObjectType.CONTAINER, parentId);
+ // Perform the move
+ parent.add(dstChild);
- // Perform the move
- parent.add(dstChild);
+ //
+ changes.add(new ModelChange.Move(dst.getObjectId(), parentId, dstChildId));
- //
- changes.add(new ModelChange.Destroy(dstId));
+ // julien : we do not need to create an update operation
+ // as later the update operation will be created when the object
+ // will be processed
+ }
}
}
@@ -701,11 +721,11 @@
for (Iterator<UIComponent> i = dst.iterator(); i.hasNext();)
{
UIComponent dstChild = i.next();
- String dstId = dstChild.getObjectId();
- if (!modelObjectMap.containsKey(dstId))
+ String dstChildId = dstChild.getObjectId();
+ if (!modelObjectMap.containsKey(dstChildId))
{
i.remove();
- changes.add(new ModelChange.Destroy(dstId));
+ changes.add(new ModelChange.Destroy(dstChildId));
}
}
@@ -771,7 +791,7 @@
);
}
- public <S, I> void save(ApplicationData<S> src, UIWindow dst)
+ public <S> void save(ApplicationData<S> src, UIWindow dst)
{
Attributes attrs = dst.getAttributes();
attrs.setValue(MappedAttributes.THEME, src.getTheme());
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelChange.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelChange.java 2009-11-12 03:51:21 UTC (rev 574)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelChange.java 2009-11-12 08:12:42 UTC (rev 575)
@@ -30,10 +30,14 @@
{
/** . */
+ private final String parentId;
+
+ /** . */
private final ModelData object;
- public Create(ModelData object)
+ public Create(String parentId, ModelData object)
{
+ this.parentId = parentId;
this.object = object;
}
@@ -41,6 +45,12 @@
{
return object;
}
+
+ @Override
+ public String toString()
+ {
+ return "ModelChange.Create[parentId=" + parentId + "id=" + object.getStorageId() + ",name=" + object.getStorageName() + "]";
+ }
}
public static class Update extends ModelChange
@@ -58,22 +68,75 @@
{
return object;
}
+
+ @Override
+ public String toString()
+ {
+ return "ModelChange.Update[id=" + object.getStorageId() + "]";
+ }
}
public static class Destroy extends ModelChange
{
/** . */
- private final String objectId;
+ private final String id;
- public Destroy(String objectId)
+ public Destroy(String id)
{
- this.objectId = objectId;
+ this.id = id;
}
- public String getObjectId()
+ public String getId()
{
- return objectId;
+ return id;
}
+
+ @Override
+ public String toString()
+ {
+ return "ModelChange.Destroy[id=" + id + "]";
+ }
}
+
+ public static class Move extends ModelChange
+ {
+
+ /** . */
+ private final String srcId;
+
+ /** . */
+ private final String dstId;
+
+ /** . */
+ private final String id;
+
+ public Move(String srcId, String dstId, String id)
+ {
+ this.srcId = srcId;
+ this.dstId = dstId;
+ this.id = id;
+ }
+
+ public String getSrcId()
+ {
+ return srcId;
+ }
+
+ public String getDstId()
+ {
+ return dstId;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "ModelChange.Move[srcId=" + srcId + ",dstId=" + dstId + ",id" + id + "]";
+ }
+ }
}
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-11-12 03:51:21 UTC (rev 574)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-11-12 08:12:42 UTC (rev 575)
@@ -204,6 +204,49 @@
assertNull(page);
}
+ public void testWindowMove1() throws Exception
+ {
+ Page page = storage_.getPage("portal::test::test4");
+ Application<?> a1 = (Application<?>)page.getChildren().get(0);
+ Container a2 = (Container)page.getChildren().get(1);
+ Application<?> a3 = (Application<?>)a2.getChildren().get(0);
+ Application<?> a4 = (Application<?>)a2.getChildren().remove(1);
+ page.getChildren().add(1, a4);
+ List<ModelChange> changes = storage_.save(page);
+
+ //
+ page = storage_.getPage("portal::test::test4");
+ assertEquals(3, page.getChildren().size());
+ Application<?> c1 = (Application<?>)page.getChildren().get(0);
+ assertEquals(a1.getStorageId(), c1.getStorageId());
+ Application<?> c2 = (Application<?>)page.getChildren().get(1);
+ assertEquals(a4.getStorageId(), c2.getStorageId());
+ Container c3 = (Container)page.getChildren().get(2);
+ assertEquals(a2.getStorageId(), c3.getStorageId());
+ assertEquals(1, c3.getChildren().size());
+ Application<?> c4 = (Application<?>)c3.getChildren().get(0);
+ assertEquals(a3.getStorageId(), c4.getStorageId());
+
+ //
+ assertEquals(6, changes.size());
+ ModelChange.Update ch1 = (ModelChange.Update)changes.get(0);
+ assertEquals(page.getStorageId(), ch1.getObject().getStorageId());
+ ModelChange.Update ch2 = (ModelChange.Update)changes.get(1);
+ assertEquals(a1.getStorageId(), ch2.getObject().getStorageId());
+ ModelChange.Move ch3 = (ModelChange.Move)changes.get(2);
+// assertEquals(a2.getStorageId(), ch3.getSrcId());
+// assertEquals(page.getStorageId(), ch3.getDstId());
+ assertEquals(a4.getStorageId(), ch3.getId());
+ ModelChange.Update ch4 = (ModelChange.Update)changes.get(3);
+ assertEquals(a4.getStorageId(), ch4.getObject().getStorageId());
+ ModelChange.Update ch5 = (ModelChange.Update)changes.get(4);
+ assertEquals(a2.getStorageId(), ch5.getObject().getStorageId());
+ ModelChange.Update ch6 = (ModelChange.Update)changes.get(5);
+ assertEquals(a3.getStorageId(), ch6.getObject().getStorageId());
+ }
+
+ // Need to make window move 2 unit test
+
public void testNavigationCreate() throws Exception
{
testPageConfigRemove();
15 years, 2 months
gatein SVN: r574 - portal/trunk/web/portal/src/main/webapp/login/jsp.
by do-not-reply@jboss.org
Author: truong.le
Date: 2009-11-11 22:51:21 -0500 (Wed, 11 Nov 2009)
New Revision: 574
Modified:
portal/trunk/web/portal/src/main/webapp/login/jsp/login.jsp
Log:
GTNPORTAL-59: Cyryllic symbols don't show
Modified: portal/trunk/web/portal/src/main/webapp/login/jsp/login.jsp
===================================================================
--- portal/trunk/web/portal/src/main/webapp/login/jsp/login.jsp 2009-11-12 02:01:12 UTC (rev 573)
+++ portal/trunk/web/portal/src/main/webapp/login/jsp/login.jsp 2009-11-12 03:51:21 UTC (rev 574)
@@ -53,6 +53,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Login</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" type="image/x-icon" href="<%=contextPath%>/favicon.ico" />
<link rel='stylesheet' type='text/css' href='<%=contextPath%>/login/skin/Stylesheet.css'/>
<script type="text/javascript" src="/eXoResources/javascript/eXo.js"></script>
15 years, 2 months
gatein SVN: r573 - in portal/trunk: webui/portal/src/main/java/org/exoplatform/portal/webui/application and 1 other directories.
by do-not-reply@jboss.org
Author: tan_pham_dinh
Date: 2009-11-11 21:01:12 -0500 (Wed, 11 Nov 2009)
New Revision: 573
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/jcr/DataMapper.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/jcr/GadgetRegistryServiceImpl.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
Log:
make gatein can built today, some change to format code
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/jcr/DataMapper.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/jcr/DataMapper.java 2009-11-11 20:51:06 UTC (rev 572)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/jcr/DataMapper.java 2009-11-12 02:01:12 UTC (rev 573)
@@ -67,7 +67,7 @@
root.setAttribute(EXO_GADGET_IS_REMOTE, String.valueOf(app.isLocal()));
}
- public Gadget toApplciation(Document doc) throws Exception
+ public Gadget toApplication(Document doc) throws Exception
{
Element root = doc.getDocumentElement();
Gadget app = new Gadget();
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/jcr/GadgetRegistryServiceImpl.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/jcr/GadgetRegistryServiceImpl.java 2009-11-11 20:51:06 UTC (rev 572)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/jcr/GadgetRegistryServiceImpl.java 2009-11-12 02:01:12 UTC (rev 573)
@@ -127,7 +127,7 @@
{
sessionProvider.close();
}
- Gadget gadget = mapper_.toApplciation(entry.getDocument());
+ Gadget gadget = mapper_.toApplication(entry.getDocument());
return gadget;
}
@@ -152,7 +152,7 @@
{
String entryPath = itr.nextNode().getPath().substring(regNode.getPath().length() + 1);
RegistryEntry entry = regService_.getEntry(sessionProvider, entryPath);
- Gadget gadget = mapper_.toApplciation(entry.getDocument());
+ Gadget gadget = mapper_.toApplication(entry.getDocument());
gadgets.add(gadget);
}
if (sortComparator != null)
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2009-11-11 20:51:06 UTC (rev 572)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2009-11-12 02:01:12 UTC (rev 573)
@@ -103,7 +103,7 @@
}
else
{
- // todo: fix me as this shouldn't probably be done only for the WSRP case�
+ // todo: fix me as this shouldn't probably be done only for the WSRP case
PortletContext clonedContext = instanceCtx.getClonedContext();
if (clonedContext != null)
{
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-11-11 20:51:06 UTC (rev 572)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-11-12 02:01:12 UTC (rev 573)
@@ -22,7 +22,7 @@
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.UserPortalConfig;
import org.exoplatform.portal.config.UserPortalConfigService;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.PortalProperties;
@@ -537,11 +537,13 @@
UIPortalToolPanel uiToolPanel = uiWorkingWS.findFirstComponentOfType(UIPortalToolPanel.class);
UIPortalComposer composer = uiWorkingWS.findFirstComponentOfType(UIPortalComposer.class).setRendered(false);
composer.setEditted(false);
- if (composer.isUsedInWizard()) {
+ if (composer.isUsedInWizard())
+ {
UIWizard wizard = (UIWizard)uiToolPanel.getUIComponent();
int step = wizard.getCurrentStep();
- step ++;
- Event<UIComponent> uiEvent = wizard.createEvent("ViewStep" + step, Phase.PROCESS, event.getRequestContext());
+ step++;
+ Event<UIComponent> uiEvent =
+ wizard.createEvent("ViewStep" + step, Phase.PROCESS, event.getRequestContext());
uiEvent.broadcast();
return;
}
@@ -581,13 +583,15 @@
public void execute(Event<UIPortalComposer> event) throws Exception
{
UIPortalComposer composer = event.getSource();
- if (composer.isUsedInWizard()) {
+ if (composer.isUsedInWizard())
+ {
UIWorkingWorkspace uiWorkingWS = composer.getAncestorOfType(UIWorkingWorkspace.class);
UIPortalToolPanel uiToolPanel = uiWorkingWS.findFirstComponentOfType(UIPortalToolPanel.class);
UIWizard wizard = (UIWizard)uiToolPanel.getUIComponent();
int step = wizard.getCurrentStep();
- step --;
- Event<UIComponent> uiEvent = wizard.createEvent("ViewStep" + step, Phase.PROCESS, event.getRequestContext());
+ step--;
+ Event<UIComponent> uiEvent =
+ wizard.createEvent("ViewStep" + step, Phase.PROCESS, event.getRequestContext());
uiEvent.broadcast();
}
}
15 years, 2 months
gatein SVN: r567 - in portal/trunk: sample/extension/war/src/main/webapp/WEB-INF/classes/locale/navigation/portal and 8 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-11-11 05:18:27 -0500 (Wed, 11 Nov 2009)
New Revision: 567
Added:
portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/users_es.properties
portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/navigation/portal/classic_es.properties
portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/portal/sample_es.properties
portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/users_es.properties
portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/navigation/portal/classic_es.properties
portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/portal/sample_es.properties
portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/organization/management/executive-board_es.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/administrators_es.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/guests_es.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/users_es.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/portal/classic_es.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/expression_es.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/services_es.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
Log:
GTNPORTAL-226: Spanish translation
Applied Spanish translation, contribution from David Calvente
Added: portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/users_es.properties
===================================================================
--- portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/users_es.properties (rev 0)
+++ portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/users_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+platform.users.samplePage=Grupo de P\u00e1ginas del Sample-Ext
Added: portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/navigation/portal/classic_es.properties
===================================================================
--- portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/navigation/portal/classic_es.properties (rev 0)
+++ portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/navigation/portal/classic_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+portal.classic.samplePage=P\u00e1gina de Portal del Sample-Ext
Added: portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/portal/sample_es.properties
===================================================================
--- portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/portal/sample_es.properties (rev 0)
+++ portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/portal/sample_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+UIHomePagePortlet.Label.SampleRB.SampleKey=Esta es una nueva key del nuevo Resource Bundle "locale.portal.sample" del "sample-ext"
Added: portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
===================================================================
--- portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties (rev 0)
+++ portal/trunk/sample/extension/war/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+#############################################################################
+#org.exoplatform.portal.webui.component.UIHomePagePortlet #
+#############################################################################
+
+UIHomePagePortlet.Label.Username=Usr:
+UIHomePagePortlet.Label.Password=Pwd:
+UIHomePagePortlet.Label.SampleKey=Esta es una nueva key i18n
Added: portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/users_es.properties
===================================================================
--- portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/users_es.properties (rev 0)
+++ portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/users_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+platform.users.samplePage=Grupo de p\ufffdginas del Sample-Portal
Added: portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/navigation/portal/classic_es.properties
===================================================================
--- portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/navigation/portal/classic_es.properties (rev 0)
+++ portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/navigation/portal/classic_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+portal.classic.samplePage=P\ufffdgina del Portal Sample-Portal
Added: portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/portal/sample_es.properties
===================================================================
--- portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/portal/sample_es.properties (rev 0)
+++ portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/portal/sample_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+
+UIHomePagePortlet.Label.SampleRB.SampleKey=Esta es una nueva key del nuevo Resource Bundle "locale.portal.sample" del "sample-portal"
Added: portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
===================================================================
--- portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties (rev 0)
+++ portal/trunk/sample/portal/war/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+#############################################################################
+#org.exoplatform.portal.webui.component.UIHomePagePortlet #
+#############################################################################
+
+UIHomePagePortlet.Label.Username=Usr:
+UIHomePagePortlet.Label.Password=Pwd:
+UIHomePagePortlet.Label.SampleKey=Esta es una nueva key que ha sido a\ufffdadida al Resource Bundle "locale.portal.webui" del "sample-portal"
Added: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/organization/management/executive-board_es.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/organization/management/executive-board_es.properties (rev 0)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/organization/management/executive-board_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+organization.title=Organizaci\u00f3n
+organization.newstaff=Nuevos Empleados
+organization.management=Administraci\u00f3n
Added: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/administrators_es.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/administrators_es.properties (rev 0)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/administrators_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+administration.title=Administraci\u00f3n
+administration.application-registry=Registrarse
+administration.newAccount=Nueva Cuenta
+administration.community-management=Administraci\u00f3n de Comunidad
+administration.i18n=Internacionalizaci\u00f3n
+administration.console=Consola Web
+administration.pageManagement=Administraci\u00f3n de P\u00e1gina
Added: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/guests_es.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/guests_es.properties (rev 0)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/guests_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+platform.guests.register=Registrarse
+platform.guests.sitemap=Mapa del Sitio
+platform.guests.link=Enlace
Added: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/users_es.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/users_es.properties (rev 0)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/group/platform/users_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+platform.users.iframe=IFrame
+platform.users.mylink=Mi Enlace
+platform.users.mylink-blog=Blog
+platform.users.mylink-google=Google
+platform.users.mylink-facebook=Facebook
+platform.users.sitemap=Mapa del Sitio
+platform.users.dashboard=Panel de Instrumentos
Added: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/portal/classic_es.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/portal/classic_es.properties (rev 0)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/navigation/portal/classic_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+portal.classic.home=Inicio
+portal.classic.sitemap=Mapa del Sitio
+portal.classic.groupnavigation=Navegaci\u00f3n por Grupos
+portal.classic.portalnavigation=Navegaci\u00f3n por Portales
+portal.classic.register=Registrarse
+portal.classic.webexplorer=Explorador Web
+UIAddNewApplication.label.AddApplication = A\u00f1adir Aplicaci\u00f3n
Added: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/expression_es.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/expression_es.properties (rev 0)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/expression_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,159 @@
+#
+# 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.
+#
+
+###################################################################
+# EXPRESSION START WITH 'A' #
+###################################################################
+word.accessPermission=Permiso de Acceso
+word.abort=Abortar
+word.action=Acci\u00f3n
+###################################################################
+# EXPRESSION START WITH 'B' #
+###################################################################
+word.back=Atr\u00e1s
+word.birthday=D\u00eda de nacimiento
+
+###################################################################
+# EXPRESSION START WITH 'c' #
+###################################################################
+word.cancel=Cancelar
+word.category=Categor\u00eda
+word.change=Cambiar
+word.city=Ciudad
+word.close=Cerrar
+word.comment=Comentario
+word.content=Contenido
+word.country=Pa\u00eds
+
+###################################################################
+# EXPRESSION START WITH 'd' #
+###################################################################
+word.date=Fecha
+word.decorator=Decorador
+word.department=Departamento
+word.description=Descripci\u00f3n
+
+###################################################################
+# EXPRESSION START WITH 'e' #
+###################################################################
+word.editPermission=Permiso de Edici\u00f3n
+word.email=Email
+word.employer=Empleador
+
+###################################################################
+# EXPRESSION START WITH 'f' #
+###################################################################
+word.familyName=Nombre de Familia
+word.finish=Finalizar
+word.firstName=Nombre
+word.format=Formato
+
+###################################################################
+# EXPRESSION START WITH 'g' #
+###################################################################
+word.groupId=Id de Grupo
+word.gender=G\u00e9nero
+word.givenName=Apodo
+
+###################################################################
+# EXPRESSION START WITH 'h' #
+###################################################################
+word.height=Altura
+
+###################################################################
+# EXPRESSION START WITH 'i' #
+###################################################################
+word.icon=Icono
+
+###################################################################
+# EXPRESSION START WITH 'i' #
+###################################################################
+word.jobTitle=Cargo
+
+###################################################################
+# EXPRESSION START WITH 'l' #
+###################################################################
+word.locale=Locale
+word.label=Etiqueta
+word.language=idioma
+word.lastName=Apellido
+
+###################################################################
+# EXPRESSION START WITH 'm' #
+###################################################################
+word.mobile=M\u00f3vil
+
+###################################################################
+# EXPRESSION START WITH 'n' #
+###################################################################
+word.name=Nombre
+word.nickName=Apodo
+word.next=Siguiente
+
+###################################################################
+# EXPRESSION START WITH 'o' #
+###################################################################
+word.owner=Propietario
+
+###################################################################
+# EXPRESSION START WITH 'p' #
+###################################################################
+word.postalCode=C\u00f3digo Postal
+
+###################################################################
+# EXPRESSION START WITH 'r' #
+###################################################################
+word.refresh=Refrescar
+word.restore=Restaurar
+
+###################################################################
+# EXPRESSION START WITH 's' #
+###################################################################
+word.save=Guardar
+word.stateProv=Estado/Prov
+word.street=Calle
+word.style=Estilo
+word.subject=Asunto
+word.summary=Sumario
+word.skin=Skin
+
+###################################################################
+# EXPRESSION START WITH 't' #
+###################################################################
+word.template=Plantilla
+word.tel=Tel
+word.title=T\u00edtulo
+
+###################################################################
+# EXPRESSION START WITH 'u' #
+###################################################################
+word.uri=Uri
+word.userName=Nombre de usuario
+word.update=Actualizar
+
+###################################################################
+# EXPRESSION START WITH 'v' #
+###################################################################
+word.viewPermission=Ver Permiso
+
+###################################################################
+# EXPRESSION START WITH 'w' #
+###################################################################
+word.width=Ancho
+word.website=Website
Added: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/services_es.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/services_es.properties (rev 0)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/services_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,130 @@
+#
+# 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.
+#
+
+#############################################################################
+# Empty String Validator #
+#############################################################################
+#class org.exoplatform.webui.form.Validator.EmptyFieldValidator
+#{0}=input field name
+EmptyStringValidator.msg.empty-input=El campo "{0}" es obligatorio
+
+#############################################################################
+# Email Address Validator #
+#############################################################################
+#class org.exoplatform.webui.form.validator.Validator.EmailAddressValidator
+#{1}=input field name, {0} user input email address
+EmailAddressValidator.msg.invalid-email=Has introducido "{0}" en el campo {1}, la direcci\u00f3n de correo no es v\u00e1lida
+
+#############################################################################
+# Number Format Validator #
+#############################################################################
+#class org.exoplatform.webui.form.validator.Validator.NumberFormatValidator
+#{0}=input field name, {1} user input limit access
+# old:NumberFormatValidator.msg.invalid-limitAccess=You have entered "{0}" in field {1}, it is an invalid \ limit access
+NumberFormatValidator.msg.invalid-limitAccess=Has introducido "{0}" en el campo {1}, el acceso a este campo est\u00e1 restringido
+#{0}=input field name
+NumberFormatValidator.msg.Invalid-input=El valor del campo {0} debe ser num\u00e9rico
+
+#############################################################################
+# Identifier String Validator #
+#############################################################################
+#class org.exoplatform.webui.form.validator.Validator.IdentifierValidator
+#{0}=input field name
+IdentifierValidator.msg.empty-input=El campo "{0}" no puede quedar vac\u00edo
+#{0}=input field name
+IdentifierValidator.msg.invalid-char=El campo {0} solo admite alfanum\u00e9ricos, d\u00edgitos, gui\u00f3n y subrayado
+
+#############################################################################
+# Name String Validator #
+#############################################################################
+#class org.exoplatform.webui.form.validator.Validator.NameValidator
+#{0}=input field name
+NameValidator.msg.empty-input=El campo "{0}" no puede quedar vac\u00edo
+#{0}=input field name
+NameValidator.msg.invalid-char=El campo {0} solo admite alfanum\u00e9ricos, d\u00edgitos, gui\u00f3n, punto y subrayado
+
+#############################################################################
+# Valid User Validator #
+#############################################################################
+#class org.exoplatform.faces.user.validator.ValidUserValidator
+#{0}=input field name, {1} input user name
+ValidUserValidator.msg.empty-input=Por favor, introduzca un valor en el campo {0}
+#{0}=input field name, {1} input user name
+ValidUserValidator.msg.invalid-username=El sistema no encuentra el usuario {0}
+
+#############################################################################
+# Valid User Validator #
+#############################################################################
+#class org.exoplatform.faces.user.validator.ValidGroupValidator
+#{0}=input field name, {1} input group id
+ValidGroupValidator.msg.empty-input=Por favor, introduzca un valor v\u00e1lido en el campo {0}
+#{0}=input field name, {1} input group id
+ValidGroupValidator.msg.invalid-group-id=El sistema no encuentra el grupo {0}
+
+#############################################################################
+# Valid Permission Validator #
+#############################################################################
+PermissionValidator.msg.invalid-permission-input=Permiso invaido. El formato del permiso debe ser miembro:/Id de Grupo.
+PermissionValidator.msg.membership-group-not-found=Tipo de miembro o grupo no encontrado.
+
+#############################################################################
+# CheckAdminOrOwnerRoleInterceptor #
+#############################################################################
+#class org.exoplatform.faces.core.event.CheckAdminOrOwnerRoleInterceptor
+#{0}=action name
+CheckAdminOrOwnerRoleInterceptor.msg.owner-or-admin-require=Necesitas estar logado con una cuenta con rol "admin" para ejecutar la acci\u00f3n '{0}'
+
+#############################################################################
+# CheckOwnerInterceptor #
+#############################################################################
+#class org.exoplatform.faces.core.event.CheckOwnerInterceptor
+#{0}=action name
+CheckOwnerInterceptor.msg.owner-require=Necesitas estar logado para ejecutar la acci\u00f3n '{0}'
+
+#############################################################################
+# ExoPermissionException #
+#############################################################################
+#class org.exoplatform.commons.exception.ExoPermissionException
+#{0}=require role, {1} action name
+ExoPermissionException.msg.message=Necesitas el rol {0} para ejecutar la acci\u00f3n {1}
+
+#############################################################################
+# Message Service properties #
+#############################################################################
+#this exception is throw in GroupQueryHandler class
+OrganizationService.unique-group-exception=El nombre de grupo {0} ya existe
+#Throw in org.exoplatform.commons.utils.PageList, {0}=request page parameter, {1}=available pages parameter
+PageList.page-out-of-range=Est\u00e1s intentando abrir la p\u00e1gina {0}, pero solo hay {1} p\u00e1ginas disponibles
+#Throw in exo.services.communication.message.impl.MessageServiceImpl.
+#{0}=account name, {1}=user name
+MessageService.account-not-found=No se ha podido encontrar la cuenta {0} para el usuario {1}
+#Throw in exo.services.communication.message.impl.StandaloneProtocolPlugin.
+#{0}=to address
+MessageService.invalid-standalone-message-address=Est\u00e1s usando el tipo de cuenta standalone account y \ la direcci\u00f3n {0} no es v\u00e1lida. El sistema espera una direcci\u00f3n con el siguiente formato: \ receptor#nombreCuenta
+#Throw in exo.services.communication.message.impl.MailServiceImpl
+#{0}=The orginal error message thrown by java mail library
+MessageService.send-message-fail=No se pudo enviar el mensaje. Verifica tu direcci\u00f3n de correo \n\ Error: {0}
+
+#############################################################################
+# Forum Service properties #
+#############################################################################
+#Throw in org.exoplatform.services.communication.forum.impl.ForumServiceImpl
+#Throw in org.exoplatform.services.indexing.Searcher
+#{0}=The orginal error message throw by lucence
+Searcher.msg.search-expression-error=Hay un error en esta expresi\u00f3n de entrada.<br />{0}
Added: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties (rev 0)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2009-11-11 10:18:27 UTC (rev 567)
@@ -0,0 +1,1365 @@
+#
+# 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.
+#
+
+UIContentNavigation.msg.EditNode=Debes seleccionar un nodo.
+UIPortletRegistryCategory.msg.editPortlet=Debes seleccionar un portlet.
+PopupPermissionSelector.title.null=null
+PopupPermissionSelector.title.UIGroupMembershipSelector=Selector de Permiso
+PopupPermissionSelector.title.PermissionSelector=Selector de Permiso
+UIPermissionForm.label.null=Permiso
+UICategoryForm.action.Close=Cerrar
+AddCategory.title.UICategoryForm=A\u00f1adir Categor\u00eda
+WorkingPopup.title.WorkingPopup=Working Popup
+DeleteUser.title.UIPopupDialog=\u00bfQuieres borrar este usuario?
+
+ #############################################################################
+ # Empty String Validator #
+ #############################################################################
+ #class org.exoplatform.webui.form.validator.Validator.EmptyFieldValidator
+ #{0}=input field name
+
+EmptyFieldValidator.msg.empty-input=El campo "{0}" es obligatorio.
+EmptyFieldValidator.msg.empty=La informaci\u00f3n del campo "{0}" no puede ser vac\u00eda.
+ExpressionValidator.msg.value-invalid=El campo "{0}" debe tener el formato "{1}".
+UITestForm.label.UIAddApplication=A\u00f1adir Aplicaci\u00f3n
+StringLengthValidator.msg.length-invalid=El texto del campo "{0}" debe tener entre "{1}" y "{2}" caracteres.
+
+ #############################################################################
+ # Email Address Validator #
+ #############################################################################
+ #class org.exoplatform.webui.form.validator.Validator.EmailAddressValidator
+ #{0}=input field name, {1} user input email address
+
+EmailAddressValidator.msg.Invalid-input=Tu direcci\u00f3n de correo es inv\u00e1lida. Por favor, introduce una direcci\u00f3n diferente.
+
+ #############################################################################
+ # Mandatory Validator #
+ #############################################################################
+ #{0} = input field name
+
+MandatoryValidatorIterator.msg.empty=La lista "{0}" no puede estar vac\u00eda.
+
+ #############################################################################
+ # Number Format Validator #
+ #############################################################################
+ #class org.exoplatform.webui.form.validator.Validator.NumberFormatValidator
+ #{0}=input field name
+
+NumberFormatValidator.msg.Invalid-number=Formato num\u00e9rico inv\u00e1lido en el campo {0}.
+
+ #class org.exoplatform.webui.form.validator.Validator.PositiveNumberFormatValidator
+ #{0}=input field name
+
+PositiveNumberFormatValidator.msg.Invalid-number=El campo {0} debe contener un n\u00famero positivo.
+
+ #############################################################################
+ # Empty Iterator Validator #
+ #############################################################################
+ #class org.exoplatform.webui.organization.UIListPermissionSelector.EmptyIteratorValidator
+ #{0}=input field name
+
+EmptyIteratorValidator.msg.empty=La lista "{0}" no puede estar vac\u00eda.
+
+ #############################################################################
+ # Resource Validator #
+ #############################################################################
+
+ResourceValidator.msg.Invalid-char= El campo {0} solo admite caracteres alfanum\u00e9ricos, d\u00edgitos, subrayado, gui\u00f3n y punto.
+
+ #############################################################################
+ # Special Character Validator #
+ #############################################################################
+ #class org.exoplatform.webui.form.validator.Validator.SpecialCharacterValidator
+ #{0}=input field name
+
+SpecialCharacterValidator.msg.invalid-digit=El campo "{0}" debe empezar por un caracter.
+SpecialCharacterValidator.msg.Invalid-char=El campo {0} solo admite caracteres alfanum\u00e9ricos, d\u00edgitos, subrayado, gui\u00f3n y espacio
+
+ #############################################################################
+ # Date Time Validator #
+ #############################################################################
+
+DateTimeValidator.msg.Invalid-input=El campo "{0}" no contiene un valor v\u00e1lildo.
+
+ #############################################################################
+ # URL Validator #
+ #############################################################################
+
+URLValidator.msg.invalid-url=El campo "{0}" no contiene una URL v\u00e1lilda.
+
+ #############################################################################
+ # Label for UIFormMultiValueInputSet #
+ #############################################################################
+
+UIFormMultiValueInputSet.label.remove=Eliminar Item
+UIFormMultiValueInputSet.label.add=A\u00f1adir Item
+
+ #############################################################################
+ #org.exoplatform.portal.webui.portal.UIPortalComposer #
+ #############################################################################
+
+UIPortalComposer.title.UIPortalComposer=Editar con el Inline Composer
+UIPortalComposer.action.Abort=Abortar
+UIPortalComposer.action.Finish=Finalizar
+UIPortalComposer.action.ViewProperties=Propiedades del Portal
+UIPortalComposer.action.SwitchMode=Cambiar a Modo Vista
+UITabPane.title.UIApplicationList=Aplicaciones
+UITabPane.title.UIContainerList=Contenedores
+
+ #############################################################################
+ #Container config options #
+ #############################################################################
+
+ContainerOptions.Category.row=Distribuci\u00f3n de Filas
+ContainerOptions.Category.column=Distribuci\u00f3n de Columnas
+ContainerOptions.Category.tabs=Distribuci\u00f3n de Tabs
+ContainerOptions.Category.mix=Distribuci\u00f3n Mixta
+
+ContainerOptions.Item.oneRow=Una Fila
+ContainerOptions.Item.twoRows=Dos Filas
+ContainerOptions.Item.threeRows=Tres Filas
+ContainerOptions.Item.oneColumns=Una Columna
+ContainerOptions.Item.twoColumns=Dos Columnas
+ContainerOptions.Item.threeColumns=Tres Columnas
+ContainerOptions.Item.threeToolbarColumns=Barra de Herramientas de Tres Columnas
+ContainerOptions.Item.twoTabs=Dos Tabs
+ContainerOptions.Item.threeTabs=Tres Tabs
+ContainerOptions.Item.twoColumnsOneRow=Dos Columnas, Una Fila
+ContainerOptions.Item.oneRowTwoColumns=Una Fila, Dos Columnas
+ContainerOptions.Item.oneRow2Column1Row=Una Fila, Dos Columnas, Una Fila
+
+ #############################################################################
+ # Identifier String Validator #
+ #############################################################################
+ #class org.exoplatform.webui.form.validator.Validator.IdentifierValidator
+ #{0}=input field name
+
+IdentifierValidator.msg.Invalid-char=El campo {0} solo admite caracteres alfanum\u00e9ricos, d\u00edgitos, subrayado y gui\u00f3n
+
+ #############################################################################
+ # UIChangeLanguage #
+ #############################################################################
+
+UIChangeLanguage.title.LanguageSetting=Ajustes del Idioma del Interfaz
+UIChangeLanguage.action.save=Aplicar
+UIChangeLanguage.action.close=Cancelar
+Euro.label=Euro
+Asia.label=Asia
+Language.left.title=Selecciona un Idioma
+
+ #############################################################################
+ # Change Skin #
+ #############################################################################
+
+UIChangeSkin.action.save=Aplicar
+UIChangeSkin.action.close=#{word.cancel}
+UIChangeSkin.title.SkinSetting=Ajustes de Skin
+UIChangeSkin.Default.label=Estilo de Skin por Defecto
+UIChangeSkin.Mac.label=Estilo de Skin Mac
+UIChangeSkin.Vista.label=Estilo de Skin Vista
+Skin.title=Lista de Skins
+Skin.left.title=Ver y seleccionar un skin
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIChangePortal #
+ #############################################################################
+
+UIChangePortal.header.creator=Creador
+UIChangePortal.header.name=Nombre
+UIChangePortal.header.skin=Skin
+UIChangePortal.header.action=Acci\u00f3n
+UIChangePortal.header.factoryId=Factory Id
+UIChangePortal.lable.TitleBar=Selecciona un Portal
+UIChangePortal.action.close=Cerrar
+UIChangePortal.action.title.SelectPortal=Selecciona un Portal
+UIChangePortal.msg.Invalid-viewPermission=No tienes permiso para utilizar este Portal
+
+ #############################################################################
+ # Selector #
+ #############################################################################
+
+Template.title=Lista de Skins
+Template.left.title=Ver y seleccionar un skin
+Desktop.label=Distribuci\u00f3n de Escritorio
+AccountTemplate.left.title=Previsualizaci\u00f3n del ejemplo de Plantilla Cuenta
+AccountTemplate.title=Plantilas Cuenta
+DefaultAccount.label=Cuenta por Defecto
+CommunityAccount.label=Cuenta de Comunidad
+CompanyAccount.label=Cuenta de Compa\u00f1\u00eda
+AdminAccount.label=Cuenta de Admin
+
+ #############################################################################
+ # Name String Validator #
+ #############################################################################
+ #class org.exoplatform.webui.form.validator.Validator.NameValidator
+ #{0}=input field name
+
+NameValidator.msg.Invalid-char=El campo {0} solo admite caracteres alfanum\u00e9ricos, d\u00edgitos, punto, subrayado y gui\u00f3n
+FirstCharacterNameValidator.msg=El Campo "{0}" debe comenzar con un car\u00e1cter.
+
+ #############################################################################
+ # Message Info #
+ #############################################################################
+
+UIAccountForm.msg.password-is-not-match=La Contrase\u00f1a y la Contrase\u00f1a de Confirnaci\u00f3n deben ser la mismaPassword and Confirm Password must be the same.
+UIAccountInputSet.msg.user-exist=Este nombre de usuario ya existe, por favor, introduzca un nombre de usuario diferente.
+UIAccountInputSet.msg.user-not-exist=Este nombre de usuario est\u00e1 disponible.
+UIAccountInputSet.msg.email-exist=Este e-mail ya existe, por favor, introduzca un e-mail diferente.
+UIAccountInputSet.msg.empty-input=El nombre de usuario no puede estar vac\u00edo.
+UIAccountInputSet.msg.successful.create.user=Has registrado una nueva cuenta.
+UIAccountInputSet.msg.successful.update.user=El perfil del usuario ha sido actualizado.
+UIUserProfileInputSet.msg.sucsesful.update.userprofile=El perfil del usuario ha sido actualizado.
+UIUserProfileInputSet.title=Informaci\u00f3n Personal
+UIUserProfileInputSet.label.Profile=Perfil
+UIUserProfileInputSet.label.HomeInfo=Informaci\u00f3n de Casa
+UIUserProfileInputSet.label.BusinessInfo=Informaci\u00f3n del Trabajo
+UIGroupMembershipForm.msg.user-not-exist=El usuario {0} no existe
+UIGroupMembershipForm.msg.user-not-empty=Este nombre de usuario no puede estar vac\u00edo.
+UIGroupMembershipForm.msg.Invalid-char=El campo {0} solo admite caracteres alfanum\u00e9ricos, d\u00edgitos, coma y gui\u00f3n.
+UIGroupMembershipForm.msg.duplicate-user=El usuario est\u00e1 duplicado. Por favor, verif\u00edcalo
+UIGroupMembershipForm.msg.group-not-select=Seleccione un Grupo.
+UIGroupMembershipForm.msg.membership-exist=El usuarior {0} ya es miembro del grupo {1}, por favor, seleccione otro grupo.
+UILoginForm.msg.Invalid-account=El nombre de Usuario y/o la Cantrase\u00f1a son incorrectas o est\u00e1n vac\u00edas. Ppor favor, pruebe de nuevo.
+UILoginForm.label.welcome=Bienvenido a eXo.
+UILoginForm.label.login=Login
+UILoginForm.label.Discard=Descartar
+UILoginForm.label.user=Usuario
+UILoginForm.label.forgot=\u00bfOlvidaste tu Nombre de Usuario/Contrase\u00f1a?
+UILoginForm.label.password=Contrase\u00f1a
+UILoginForm.label.UserName=Nombre de usuario
+UILoginForm.label.RememberOnComputer=Recordar mis Credenciales
+UILoginForm.label.NotMember=\u00bfNo es Miembro?
+UILoginForm.label.Signup=Ingresar
+UILoginForm.label.Signin=Ingresar
+UILoginForm.label.ForAccount=Registarse ahora para crear una cuenta
+UILoginForm.label.SigninFail=No se ha podido ingresar. Nombre de usuario o Contrase\u00f1a inv\u00e1lida.
+UILoginForm.label.Copyright=Copyright © 2009. Todos los derechos reservados, eXo Platform SAS y Red Hat, Inc.
+
+ #############################################################################
+ # Message Error #
+ #############################################################################
+
+UIApplication.msg.unknown-error=Error desconocido
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIContainerForm#
+ #############################################################################
+
+UIContainerForm.title=Editar Contenedor
+UIContainerForm.action.Save=#{word.save}
+UIContainerForm.action.Close=Cancelar
+UIContainerForm.label.id=Id del Contenedor
+UIContainerForm.label.title=T\u00edtulo del Contenedor
+UIContainerForm.label.decorator=#{word.decorator}
+UIContainerForm.label.template=#{word.template}
+UIContainerForm.label.width=#{word.width}
+UIContainerForm.label.height=#{word.height}
+UIContainerForm.label.style=#{word.style}
+UIContainerForm.label.ContainerSetting=Ajustes del Contenedor
+UIContainerForm.tab.label.ContainerSetting=Ajustes del Contenedor
+UIContainerForm.tab.label.UIContainerPermission=Permisos de Acceso
+UIContainerForm.tab.label.Template=Plantilla
+UIContainerForm.tab.label.Icon=Icono
+UIContainerForm.msg.InvalidWidthHeight=Debes introducir un pixel o un valor porcentual en el campo "{0}".
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIPortletForm#
+ #############################################################################
+
+UIPortletForm.title=Ver/Editar Portlet
+UIPortletForm.label.title=T\u00edtulo del Portlet :
+UIPortletForm.label.width=#{word.width}:
+UIPortletForm.label.height=#{word.height}:
+UIPortletForm.label.showInfoBar=Mostrar en la Barra :
+UIPortletForm.label.windowId=Id de Ventana :
+UIPortletForm.label.showPortletMode=Mostrar el Modo Portlet :
+UIPortletForm.label.showWindowState=Mostrar el Estado de la Ventana :
+UIPortletForm.label.id=Id del Portlet :
+UIPortletForm.label.displayName=Nombre a Visualizar:
+UIPortletForm.label.description=Descrici\u00f3n :
+UIPortletForm.label.template=Plantilla
+UIPortletForm.action.Close=Cancelar
+UIPortletForm.action.Save=#{word.save}
+UIPortletForm.tab.label.PortletPref=Preferencias
+UIPortletForm.tab.label.PortletSetting=Ajustas del Portlet
+UIPortletForm.tab.label.Renderer=Renderizador
+UIPortletForm.tab.label.Template=Plantilla
+UIPortletForm.tab.label.Decorator=Decorador
+UIPortletForm.tab.label.Icon=Selecciona un Icono
+UIPortletForm.tab.label.Theme=Temas de Decoraci\u00f3n
+UIPortletForm.tab.label.EditMode=Modo Edici\u00f3n
+UIPortletForm.tab.label.PortletPermission=Permiso de Acceso
+UIPortletForm.Theme.title.Preview=Previsualizaci\u00f3n de Temas
+UIPortletForm.Theme.title.SetDefault=Obtener el Por Defecto
+UIPortletForm.Icon.title.SetDefault=Obtener el Por Defecto
+UIPortletForm.msg.InvalidWidthHeight=Debes introducir un valor de pixel en el campo "{0}".
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIDescription #
+ #############################################################################
+
+UIDescription.title.pageManagement=Navegar por p\u00e1ginas
+UIDescription.title.portalManagement=Navegar por el Portal
+UIDescription.title.pageWizard=Asistente de Creaci\u00f3n de P\u00e1gina
+UIDescription.title.pageEditWizard=Asistente de Edici\u00f3n de Pagina
+UIDescription.content.pageManagement=<strong>Gestiona p\u00e1ginas:</strong><br/>Esta es una lista de todas las p\u00e1ginas.<br/>Puedes previsualizar (solo p\u00e1ginas Normales),</br/><br/> editar o borrar p\u00e1ginas si tienes los permisos adecuados.<br/><br/>Puedes buscar p\u00e1ginas por <em>Tipo de Propietarios</em> (portal/group/user), por <em>Id de Propietario</em> (name of owner type), o por <em>Nombre de p\u00e1gina.</em><br/><br/>Para crear una nueva p\u00e1gina, haz click en el bot\u00f3n "A\u00f1adir nueva P\u00e1gina" y rellena los campos requeridos.
+UIDescription.content.portalManagement=<strong>Gestiona Portales: </strong><br/>Esta es una lista de todos los portales. Para crear un nuevo Portal, haz click en el Bot\u00f3a "Crear nuevo Portal" y rellena los campor requeridos.<br/>Solo puedes crear o borrar un portal de esta lista si tienes los permisos adecuados.
+UIDescription.content.pageWizard=debes borrar
+UIDescription.content.pageWizard2=<strong>Paso 1: Establecer la informaci\u00f3n de la p\u00e1gina incluye el path, el nombre del nodo y el nombre a visualizar.</strong><br/> Procede como sigue: <br/>- Selecciona una navegaci\u00f3n de la lista <br/>- Selecciona un nodo en el cual quieras crear una \u00e1gina hijo <br/>- Introduce un <em>Nombre de Nodo </em><br/>- Introduce un <em>Nombre a Visualizar</em> (opcional)<br/>- Pon el valor deseado en el check box <em>Visible</em> (opcional)<br/>- Pon el valor deseado en el check box <em>Fecha de Publicaci\u00f3n & hora</em> (opcional)<br/> Si el checkbox <em>Fecha de Publicaci\u00f3n & hora</em> est\u00e1 selccionado:<br/> - Introduce una <em>Fecha de inicio de Publicaci\u00f3n</em><br/> - Introduce una <em>Fecha de fin de Publicaci\u00f3n</em><br/>- Haz Click en "Siguiente" para ir al siguiente paso
+UIDescription.content.pageWizard3=<strong>Paso 2: Establecer la distribuci\u00f3n de la p\u00e1gina.</strong><br/> Procede como sigue:<br/>- Selecciona uno de las Distribuciones (Layouts) de la lista <br/>- Haz "Click" en "Siguiente" para ir al siguiente paso o "Atr\u00e1s" para volver al paso anterior
+UIDescription.content.pageEditWizard=La descripci\u00f3n del Asistente de Edici\u00f3n de P\u00e1gina<br/> y gu\u00eda va aqu\u00ed.
+UIDescription.content.pageEditWizard1=<strong>Paso 1: Cambio del nombre a visualizar, la visibilidad y el periodo de publicaci\u00f3n de una p\u00e1gina.</strong><br/> Procede como sigue:<br/>- Select a navigation from the drop down list <br/>- Select the page you want to edit <br/>- Modify the <em>Display name</em> if required<br/>- Check or uncheck the <em>Visible</em> check box<br/>- Check or uncheck the <em>Publication date & time</em> check box<br/> If <em>Publication date & time</em> is checked:<br/> - Change the <em>Start Publication Date</em><br/> - Change the <em>End Publication Date</em><br/>- Click "Next" to proceed to the next step
+UIDescription.content.pageEditWizard2=<strong>Paso 2: Modicar la distribuci\u00f3n de una p\u00e1gina.</strong><br/> Procede como sigue:<br/>- Select a new page layout or keep the current layout<br/>- Click "Next" to move to the next step or "Back" to return to the previous step
+UIDescription.content.pageEditWizard3=<strong>Paso 2: Modicar la distribuci\u00f3n de una p\u00e1gina.</strong><br/> Procede como sigue:<br/>- Select a new page layout or keep the current layout<br/>- Click "Next" to move to the next step or "Back" to return to the previous step
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIPortalForm#
+ #############################################################################
+
+UIPortalForm.title=Editar el Portal
+UIPortalForm.action.Save=#{word.save}
+UIPortalForm.action.Close=Cancelar
+UIPortalForm.msg.sameName=Este nombre de portal ya existe.
+UIPortalForm.label.name=Nombre del Portal :
+UIPortalForm.label.locale=#{word.locale} :
+UIPortalForm.label.date=#{word.date} :
+UIPortalForm.label.factoryId=Tipos de Portal
+UIPortalForm.label.skin=Skin :
+UIPortalForm.label.sessionAlive=Mantener viva la sesi\u00f3n :
+UIPortalForm.label.option.always=Siempre
+UIPortalForm.label.option.onDemand=Segun Demanda
+UIPortalForm.label.option.never=Nunca
+UIPortalForm.tab.label.PortalSetting=justes del Portal
+UIPortalForm.tab.label.PortalTemplate=Plantillas del Portal
+UIPortalForm.tab.label.PermissionSetting=Ajustes de los Permisos
+UIPortalForm.tab.label.FactoryId=Id de Factor\u00eda
+PortalTemplate.title=Plantillas de Portal
+PortalTemplate.left.title=Previsualizaci\u00f3n de la Plantilla de Ejemplo del Portal
+
+ #####################################################################################
+ # org.exoplatform.webui.organization.UIListPermissionSelector#
+ # org.exoplatform.webui.organization.UIPermissionSelector#
+ # org.exoplatform.webui.organization.UIGroupSelector#
+ ###############################################################################3#####
+
+UITabPane.title.UIPermissionSelector=Editar los Ajustes de los Permisos
+UITabPane.title.UIListPermissionSelector=Acceder a los Ajustes de los Permisos
+UITabPane.title.UIAccountProfiles=Periles de la Cuenta
+UITabPane.title.UIAccountChangePass=Cambiar la Contrase\u00f1a
+UIListPermissionSelector.header.groupId=Id de Grupo
+UIListPermissionSelector.header.membership=Tipo de Afiliaci\u00f3n
+UIListPermissionSelector.header.action=Acci\u00f3n
+UIListPermissionSelector.action.addPermission=A\u00f1adir Permisos
+UIListPermissionSelector.action.title.Delete=Borrar
+UIListPermissionSelector.label.publicMode=Hacerlo p\u00fablico (cualquiera puede acceder):
+UIGroupMembershipSelector.msg.selectGroup=Primero debes seleccionar un Grupo.
+UIGroupMembershipSelector.title=Selector de pertenencia a Grupo
+UIGroupMembershipSelector.title.ListPermissionSelector=Selector de Grupo y Afiliaci\u00f3n
+UIGroupMembershipSelector.label.selectPermission=Selecciona un Permiso
+UIGroupMembershipSelector.label.selectMembership=Selecciona una Afiliaci\u00f3n
+UIGroupMembershipSelector.label.selectGroup=Navega y selecciona un Grupo
+UIGroupMembershipSelector.tooltip.selectMembership=Haz Click aqu\u00ed para seleccionar una afiliaci\u00f3n
+UIGroupSelector.title.UIGroupMembershipSelector=Selector de Afiliaci\u00f3n
+UIGroupSelector.title.selectGroup=Navega y selecciona un Grupo
+UIGroupSelector.title.selectGroupInfo=Informaci\u00f3n del Grupo Seleccionado
+UIGroupSelector.lable.name=Nombre:
+UIGroupSelector.lable.groupId=Id del Grupo:
+UIGroupSelector.lable.description=Descripci\u00f3n:
+UIGroupSelector.action.done=Hecho
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIPageSelector#
+ #############################################################################
+
+UIPageSelector2.header.name=Nombre
+UIPageSelector2.header.id=Id de P\u00e1gina
+UIPageSelector2.header.accessGroups=Grupos de Acceso
+UIPageSelector2.header.title=#{word.title}
+UIPageSelector2.header.action=#{word.action}
+UIPageSelector2.label.clearPage=Limpiar P\u00e1gina
+UIPageSelector2.label.createPage=Crear P\u00e1gina
+UIPageSelector2.label.searchandSelectPage=Buscar y Seleccionar P\u00e1gina
+UIPageSelector2.label.currentSelectedPage=Informaci\u00f3n de la P\u00e1gina Seleccionada
+UIPageSelector2.label.title=T\u00edtulo
+UIPageSelector2.label.name=#{word.name}
+UIPageSelector2.label.accessGroups=Grupos de Acceso
+UIPageBrowser.msg.NoPermission=No tienes permisos para acceder a esta p\u00e1gina.
+UIPageBrowser.msg.PageNotExist=La p\u00e1gina no existe.
+UIPageBrowser.msg.UserNotPermission=No tienes permisos para acceder a la p\u00e1gina del nodo.
+UIPageBrowser.msg.InvalidQueryException=Invalid Query.
+UIPageBrowser.msg.Invalid-viewPermission=No tienes permisos para acceder a la p\u00e1gina {0}.
+UIPageBrowser.msg.Invalid-editPermission=No tienes permisos para editar la p\u00e1gina {0}.
+UIPageBrowser.msg.Invalid-deletePermission=No tienes permisos para borrar la p\u00e1gina {0}.
+UIPageBrowser.msg.Invalid-Preview=Esta es una p\u00e1gina de escritorio. No puedes previsualizar p\u00e1ginas de este tipo.
+UIPageBrowser.msg.NotViewPage=No tienes permisos para ver esta p\u00e1gina.
+UIPageBrowser.msg.edit.NotEditPage=No tienes permisos para editar esta p\u00e1gina.
+UIPageBrowser.msg.delete.NotDelete=No tienes permisos para borrar esta p\u00e1gina.
+UIPageBrowser.selectItem.ownerType=Tipo de Propietario
+UIPageBrowser.selectItem.ownerId=Id de Propietario
+UIPageBrowser.selectItem.name=Nombre
+UIPageBrowser.action.title.Delete=Borrar p\u00e1gina
+UIPageBrowser.action.title.Preview=Previsualizar p\u00e1gina
+UIPageBrowser.action.title.EditInfo=Editar p\u00e1gina
+UIPageBrowser.action.title.SelectPage=Seleccionar p\u00e1gina
+UIPageBrowser.action.addNewPage=A\u00f1adir p\u00e1gina nueva
+UIPageBrowser.header.name=nombre de p\u00e1gina
+UIPageBrowser.header.ownerType=Tipo de Propietario
+UIPageBrowser.header.ownerId=Id de Propietario
+UIPageBrowser.header.pageId=Id de p\u00e1gina
+UIPageBrowser.header.title=T\u00edtulo
+UIPageBrowser.header.accessGroups=Grupos de Acceso
+UIPageBrowser.header.action=#{word.action}
+UIPageBrowser.header.accessPermissions=Permisos de Acceso
+UIPageBrowser.header.editPermission=Editar Permisos
+UIPageBrowser.label.option.owner=#{word.owner}
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIPageNodeSelector#
+ #############################################################################
+
+UIPageNodeSelector.UIDropDown.title=Seleccionar Navegaciones
+UIPageNodeSelector.msg.notAvailable=La p\u00e1gina de este nodo no est\u00e1 disponible.
+UIPageNodeSelector.msg.Invalid-editPermission=No tienes permisos para borrar esta p\u00e1gina
+UIPageNodeSelector.msg.deleteNav=No puedes borrar la navegaci\u00f3n de esta p\u00e1gina.
+UIPageNodeSelector.msg.NoPageNavigation=Debes crear una navegaci\u00f3n antes de usar esta funci\u00f3n.
+UIPageNodeSelector.msg.curentPage=No puedes borrar esta p\u00e1gina: La p\u00e1gina est\u00e1 siendo usada por otro programa.
+UIPageNodeSelector.msg.paste.sameName=Este nombre de nodo ya existe.
+UIPageNodeSelector.msg.paste.sameSrcAndDes=El origen y destino deben ser distintos.
+UIPageNodeSelector.deleteNode=\u00bfEst\u00e1s seguro de que deseas borrar esta navegaci\u00f3n?
+UIPageNodeSelector.deleteNavigation=\u00bfEst\u00e1s seguro de que deseas borrar este nodo?
+UIPageNodeSelector.tooltip.newPageNavigation=Crear una nueva Navegaci\u00f3n de P\u00e1gina
+UIPageNodeSelectorPopupMenu.event.AddUserNavigation=A\u00f1adir Navegaci\u00f3n
+UIPageNodeSelectorPopupMenu.event.AddNode=A\u00f1adir nuevo Nodo
+UIPageNodeSelectorPopupMenu.event.PasteNode=Pegar Nodo
+UIPageNodeSelectorPopupMenu.event.CreateNavigation=Crear Navegaci\u00f3n
+UIPageNodeSelectorPopupMenu.event.DeleteNavigation=Borrar Navegaci\u00f3n
+UIPageNodeSelectorPopupMenu.event.EditNavigation=Editar Navegaci\u00f3n
+UIPageNodeSelectorPopupMenu.event.SaveNavigation=Guardar Navegaci\u00f3n
+
+ #############################################################################
+ # org.exoplatform.portal.webui.portal.UIComposer #
+ #############################################################################
+
+UIPageEditor.action.Abort=Abortar
+UIPageEditor.action.Finish=Finalizar
+UIPageEditor.title.UIPageEditor=Editor de P\u00e1gina
+UIPageEditor.action.ViewProperties=Ver propiedades de la P\u00e1gina
+UIPageEditor.action.SwitchMode=Cambiar a modo Vista
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIPageForm #
+ #############################################################################
+
+UIPageForm.title=Ver/Editar P\u00e1gina
+UIPageForm.label.pageId=Id de P\u00e1gina :
+UIPageForm.label.ownerType=Tipo de Propietario:
+UIPageForm.label.ownerId=Id de Propietario:
+UIPageForm.label.name=Nombre de P\u00e1gina:
+UIPageForm.label.title=T\u00edtulo de P\u00e1gina :
+UIPageForm.label.showMaxWindow=Mostrar m\u00e1ximo de Ventana :
+UIPageForm.action.Close=Cancelar
+UIPageForm.action.Save=#{word.save}
+UIPageForm.action.Back=atr\u00e1s
+UIPageForm.tab.label.PageSetting=Ajustes de P\u00e1gina
+UIPageForm.tab.label.Template=Plantillas de P\u00e1gina
+UIPageForm.tab.label.PermissionSetting=Ajustes de Permisos
+UIPageForm.tab.label.UIPageTemplateOptions=Distribuci\u00f3n de P\u00e1gina
+UIPageForm.msg.sameName=Este nombre de P\u00e1gina ya existe.
+UIOwnerIdSelector.title.OwnerIdSelector=Selector de Id de Propietario
+UIPopupGroupSelector.title.UIGroupSelector=Selector de Grupo
+UIPopupGroupSelector.title.GroupSelector=Selecciona Grupo
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIPageNodeForm#
+ #############################################################################
+
+UIPageNodeForm2.msg.SameName=Este nombre de nodo ya existe.
+UIPageNodeForm2.msg.selectPage=Debes seleccionar una p\u00e1gina.
+UIPageNodeForm2.msg.startDateBeforeEndDate=La fecha de finalizaci\u00f3n debe ser posterior a la fecha de inicio.
+UIPageNodeForm2.action.Save=#{word.save}
+UIPageNodeForm2.action.Back=#{word.back}
+UIPageNodeForm2.action.Close=#{word.cancel}
+UIPageNodeForm2.label.name=Nombre de Nodo:
+UIPageNodeForm2.label.uri=#{word.uri}:
+UIPageNodeForm2.label.pageReference=Referencia a P\u00e1gina
+UIPageNodeForm2.label.description=#{word.description}
+UIPageNodeForm2.label.type=Tipo de P\u00e1gina
+UIPageNodeForm2.label.creator=Creador de la P\u00e1gina
+UIPageNodeForm2.label.modifier=Modificador de la P\u00e1gina
+UIPageNodeForm2.label.label=#{word.label}:
+UIPageNodeForm2.label.visible=Visible:
+UIPageNodeForm2.label.showPublicationDate=Fecha y hora de Publicaci\u00f3n:
+UIPageNodeForm2.label.startPublicationDate=Fecha de inicio de Publicaci\u00f3n:
+UIPageNodeForm2.label.endPublicationDate=Fecha de fin de Publicaci\u00f3n:
+UIPageNodeForm2.Icon.title.SetDefault=Obtener el por Defecto
+UIPageNodeForm.tab.label.PageNodeSetting=Ajustes de Nodo de P\u00e1gina
+UIPageNodeForm.tab.label.Icon=#{word.icon}
+UIPageNodeForm.tab.label.UIPageSelector2=Selector P\u00e1gina
+
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIPageBrowser #
+ #############################################################################
+
+UIPageBrowse.deletePage=\u00bfQuieres borrar esta P\u00e1gina?
+UIPageSearch.label.option.ownerType=Tipo de Propietario
+UIPageSearch.label.option.ownerId=Id de Propietario
+UIPageSearch.label.option.name=Nombre
+UIPageSearch.label.option.title=#{word.title}
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIPageNavigationForm #
+ #############################################################################
+
+UIPageNavigationForm.title=Explorador de P\u00e1gina & Navegaci\u00f3n
+UIPageNavigationForm.label.priority=Prioridad :
+UIPageNavigationForm.label.creator=Creador :
+UIPageNavigationForm.label.modifier=Modificador :
+UIPageNavigationForm.label.ownerType=Tipo de Propietario :
+UIPageNavigationForm.label.ownerId=Id de Propietario :
+UIPageNavigationForm.label.description=#{word.description}:
+UIPageNavigationForm.label.uri=#{word.uri}:
+UIPageNavigationForm.label.name=#{word.name}:
+UIPageNavigationForm.tab.label.AccessGroup=Grupos de Acceso
+UIPageNavigationForm.tab.label.PageNavigationSetting=Ajustes de Navegaci\u00f3n de P\u00e1gina
+UIPageNavigationForm.tab.label.Icon=#{word.icon}
+UIPageNavigationForm.tab.label.PermissionSetting=Ajustes de Permisos
+UIPageNavigationForm.action.Save=#{word.save}
+UIPageNavigationForm.action.ClosePopup=#{word.close}
+UIPageNavigationForm.action.Close=Cancelar
+UIPageNavigationForm.msg.selectGroup=Debes seleccionar un Grupo.
+UIPageNavigationForm.msg.existPageNavigation=La Navegaci\u00f3n de P\u00e1gina para {0} ya existe.
+UIPageNavigation.msg.noMakablePageNavigation=No tienes permisos para crear la Navegaci\u00f3n de P\u00e1gina para este Grupo.
+UIPageNavigation.tooltip.upLevel=Ir al nivel anterior
+UIPageNavigation.label.navigation={0} navegaciones
+UIPageNavigation.label.titleBar={0} p\u00e1ginas
+
+ #############################################################################
+ # org.exoplatform.portal.webui.component.UIPortalApplication #
+ #############################################################################
+
+UIPortalApplication.label.Loading=Cargando...
+UIPortalApplication.label.Abort=Abortar
+UIPortalApplication.msg.deletePageBody=Este componente contiene PageBody. No se puede Borrar !
+
+ #############################################################################
+ # org.exoplatform.organization.webui.component.UIPermissionSelector #
+ #############################################################################
+
+UIPermissionSelector.label.AccessPermission=#{word.accessPermission}
+UIPermissionSelector.label.EditPermission=#{word.editPermission}
+UIPermissionSelector.label.ViewPermission=#{word.viewPermission}
+UIPermissionSelector.label.PermissionInfo=Informaci\u00f3n de los Permisos
+UIPermissionSelector.label.membershipMember=Afiliaci\u00f3n
+UIPermissionSelector.label.groupId=#{word.groupId}
+UIPermissionSelector.label.addEditPermission=Ajustes de los Permisos
+UIPermissionSelector.label.currentSelectedPermissionInfo=Permiso Actual
+UIPermissionSelector.label.permissionType=Tipo de Permiso
+UIPermissionSelector.action.SelectPermission=Seleccionar Permiso
+UIPermissionSelector.action.DeletePermission=Borrar Permiso
+
+ #############################################################################
+ # org.exoplatform.organization.webui.component.UIGroupMembershipSelector #
+ #############################################################################
+
+UIPopupGroupMembershipSelector.title.ListPermissionSelector=Selector de Grupo y Afiliaci\u00f3n
+UIPageFormPopupGroupMembershipSelector.title.ListPermissionSelector=Selector de Grupo y Afiliaci\u00f3n
+
+ #############################################################################
+ # org.exoplatform.organization.webui.component.UIUserMembershipSelector #
+ #############################################################################
+
+UIUserMembershipSelector.header.userName=Nombre de Usuario
+UIUserMembershipSelector.header.membershipType=Tipo de Afiliaci\u00f3n
+UIUserMembershipSelector.header.action=#{word.action}
+UIUserMembershipSelector.header.groupId=#{word.groupId}
+UIUserMembershipSelector.action.SelectPermission=Selecciona Permiso
+UIUserMembershipSelector.action.title.DeleteMembership=Borra Afiliaci\u00f3n
+UserPermissionSelector.title.UIGroupMembershipSelector=Selewctor de pertenencia a Grupo
+
+ #############################################################################
+ # org.exoplatform.webui.form.UIFormInputItemSelector #
+ #############################################################################
+
+UIFormInputItemSelector.selectType.page=Selecciona una Plantilla de P\u00e1gina
+UIFormInputItemSelector.selectType.portal=Selecciona una Plantilla de Portal
+UIFormInputSet.tooltip.selectgroup=Selecciona otro Grupo
+
+ #############################################################################
+ # org.exoplatform.webui.form.UIFormInputIconSelector #
+ #############################################################################
+
+UIFormInputIconSelector.label.selectIconSet=Selecciona un Conjunto de Iconos
+UIFormInputIconSelector.label.iconPreview=Previsualiza y selecciona un icono
+UIFormInputIconSelector.label.iconName=Nombre del icono seleccionado
+UIFormInputIconSelector.label.iconCatergory=Categor\u00eda del Icono
+UIFormInputIconSelector.label.miscIcons=Iconos no catalogados
+UIFormInputIconSelector.label.officeIcons=Iconos de Office
+UIFormInputIconSelector.label.Icon16x16=Icono 16x16
+UIFormInputIconSelector.label.Icon24x24=Icono 24x24
+UIFormInputIconSelector.label.Icon48x48=Icono 48x48
+UIFormInputIconSelector.label.Icon32x32=Icono 32x32
+UIFormInputIconSelector.label.Icon64x64=Icono 64x64
+UIFormInputIconSelector.label.Icon72x72=Icono 72x72
+UIFormInputIconSelector.label.misc=Iconos no catalogados
+UIFormInputIconSelector.label.offices=Iconos Office
+UIFormInputIconSelector.label.navigation=Navegaci\u00f3n de Iconos
+UIFormInputIconSelector.label.tool=Iconos de herramientas
+UIFormInputIconSelector.label.user=Icons de usuario
+UIFormInputIconSelector.option.IconSet16x16=16x16
+UIFormInputIconSelector.option.IconSet24x24=24x24
+UIFormInputIconSelector.option.IconSet32x32=32x32
+Icon.UIDropDown.label.IconSet16x16=IconSet16x16
+Icon.UIDropDown.label.IconSet24x24=IconSet24x24
+Icon.UIDropDown.label.IconSet32x32=IconSet32x32
+Icon.UIDropDown.title=IconSet 16x16
+
+ #############################################################################
+ # org.exoplatform.webui.core.UIWizard #
+ #############################################################################
+
+UIPageWizardHelp.title.UIPageWizardHelp=Ayuda del Asistente de P\u00e1gina
+UIPageCreationWizard.label.pageCreateWizard=Asistente Creaci\u00f3n de P\u00e1gina
+UIPageCreationWizard.label.step=Paso
+UIPageCreationWizard.label.wizardSteps=Pasos del Asistente
+UIPageCreationWizard.label.step1.title=Bienvenido al Asistente Creaci\u00f3n de P\u00e1gina
+UIPageCreationWizard.label.step2.title=Selecciona un Nodo de Navegaci\u00f3n y crea la P\u00e1gina
+UIPageCreationWizard.label.step3.title=Selecciona una Plantilla de Distribuci\u00f3n de P\u00e1gina
+UIPageCreationWizard.label.step4.title=Reorganiza la Distribuci\u00f3n de la P\u00e1gina y a\u00f1ade Portlets a la P\u00e1gina
+UIPageCreationWizard.label.abort=#{word.abort}
+UIPageCreationWizard.label.back=#{word.back}
+UIPageCreationWizard.label.next=#{word.next}
+UIPageCreationWizard.label.done=#{word.save}
+UIPageCreationWizard.label.previousStep=Paso Anterior
+UIPageCreationWizard.label.nextStep=Paso Siguiente
+UIPageCreationWizard.msg.NameNotSame=Este nombre ya existe.
+UIPageCreationWizard.msg.notSelectedPageNavigation=Tienes que seleccionar una Navegaci\u00f3n.
+UIPageCreationWizard.msg.StepByStep=Al principio debes ir paso a paso.
+UIPageNodeWizardPreview.action.Finish=Guardar y finalizar
+UIPageNodeWizardPreview.label.nodeName=Nombre del Nodo
+UIPageNodeWizardPreview.label.nodeLabel=Etiqueta del Nodo
+UIPageNodeWizardPreview.label.icon=#{word.icon}
+UIPageNodeWizardPreview.label.creator=Creador
+UIPageNodeWizardPreview.label.accessPermission=Permisos de Acceso
+UIPageNodeWizardPreview.label.editPermission=Editar Permisos
+UIPageNodeWizardPreview.label.pageReference=Referencia de la P\u00e1gina
+UIPageCreateDescription.title.create=Asistente Creaci\u00f3n de P\u00e1gina
+UIPageCreateDescription.title.edit=Asistente Edici\u00f3n de P\u00e1gina
+UIPageTemplateOptions.UIDropDown.title=Configuraciones de la P\u00e1gina
+UIPageTemplateOptions.UIDropDown.label.normalPageConfigs=Configuraciones de la P\u00e1gina
+UIPageTemplateOptions.UIDropDown.label.columnPageConfigs=Configuraciones de las Columnas de la P\u00e1gina
+UIPageTemplateOptions.UIDropDown.label.mixPageConfigs=Configuraciones de la P\u00e1gina Mezcladas
+UIPageTemplateOptions.UIDropDown.label.rowPageConfigs=Configuraciones de la fila de la P\u00e1gina
+UIPageTemplateOptions.UIDropDown.label.tabsPageConfigs=Configuraciones de los tabs de la P\u00e1gina
+
+ ##################################################################
+ # UIWizardPageSelectLayoutForm #
+ ##################################################################
+
+UIWizardPageSelectLayoutForm.tab.label.UIPageTemplateOptions=Opciones de la Plantilla de P\u00e1gina
+UIWizardPageSelectLayoutForm.label.normalPage.EmptyLayout=Distribuci\u00f3n Vac\u00eda
+UIWizardPageSelectLayoutForm.label.normalPage.CurrentLayout=Distribuci\u00f3n actual
+UIWizardPageSelectLayoutForm.label.normalPage.DesktopImage=Distribuci\u00f3n del Escritorio
+UIWizardPageSelectLayoutForm.label.normalPage.DashboardLayout=Distribuci\u00f3n del Tabl\u00f3n
+UIWizardPageSelectLayoutForm.label.columnPage.TwoColumnsLayout=Distribuci\u00f3n a dos Columnas
+UIWizardPageSelectLayoutForm.label.columnPage.ThreeColumnsLayout=Distribuci\u00f3n a tres Columnas
+UIWizardPageSelectLayoutForm.label.rowPage.TwoRowsLayout=Distribuci\u00f3n a dos filas
+UIWizardPageSelectLayoutForm.label.rowPage.ThreeRowsLayout=Distribuci\u00f3n a tres filas
+UIWizardPageSelectLayoutForm.label.tabsPage.TwoTabsLayout=Dos Tabs
+UIWizardPageSelectLayoutForm.label.tabsPage.ThreeTabsLayout=Tres Tabs
+UIWizardPageSelectLayoutForm.label.mixPage.TwoColumnsOneRowLayout=Distribuci\u00f3n a dos Columnas y una fila
+UIWizardPageSelectLayoutForm.label.mixPage.OneRowTwoColumnsLayout=Distribuci\u00f3n a una Columna y dos filas
+UIWizardPageSelectLayoutForm.label.mixPage.ThreeRowsTwoColumnsLayout=Distribuci\u00f3n a dos Columnas y tres filas
+UIWizardPageSelectLayoutForm.label.UIPageTemplateOptions=null
+
+ ############################################################################
+ # org.exoplatform.portal.component.customization.UIWizardPageCreationForm #
+ ############################################################################
+
+UIWizardPageSetInfo.title=A\u00f1adir una nueva p\u00e1gina
+UIWizardPageSetInfo.label.curentSelectedNodeInfo=Nodo de P\u00e1gina Seleccionado
+UIWizardPageSetInfo.label.pageName=Nombre de Nodo
+UIWizardPageSetInfo.label.pageDisplayName=Nombre a Visualizar
+UIWizardPageSetInfo.label.visible=Visible
+UIWizardPageSetInfo.label.showPublicationDate=Fecha y hora de Publicaci\u00f3n
+UIWizardPageSetInfo.label.startPublicationDate=Fecha de inicio de Publicaci\u00f3n
+UIWizardPageSetInfo.label.endPublicationDate=Fecha de fin de Publicaci\u00f3n
+UIWizardPageSetInfo.action.Save=#{word.save}
+UIWizardPageSetInfo.msg.null=P\u00e1gina no encontrada.
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIPageNodeWizardPreview #
+ #############################################################################
+
+EditWizard.label.curentSelectedNodeInfo=Nodo de P\u00e1gina Seleccionado
+EditWizard.label.pageName=Nombre de Nodo
+EditWizard.label.pageDisplayName=Nombre a Visualizar
+EditWizard.label.visible=Visible
+EditWizard.label.showPublicationDate=Fecha y hora de Publicaci\u00f3n
+EditWizard.label.startPublicationDate=Fecha de inicio de Publicaci\u00f3n
+EditWizard.label.endPublicationDate=Fecha de fin de Publicaci\u00f3n
+EditWizard.title=Editar P\u00e1gina
+EditWizard.action.Save=#{word.save}
+UIPageCreationWizardStepForm.label.pageName=Nombre de P\u00e1gina
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIAdvancedCustomization #
+ #############################################################################
+
+UIAdvancedCustomization.icon.UIPortalManagement=Portal
+UIAdvancedCustomization.icon.UIPageManagement=P\u00e1gina
+UIAdvancedCustomization.label.UIPortalManagement=Gesti\u00f3n del Portal
+UIAdvancedCustomization.label.UIPageManagement=Gesti\u00f3n de la P\u00e1gina
+UIPortalManagement.msg.Invalid-EditLayout-Permission=No tienes permisos para editar esta distribuci\u00f3n.
+UIPortalManagement.msg.Invalid-EditPage-Permission=No tienes permisos para editar esta p\u00e1gina.
+UIPortalManagement.title.EDIT=Editar el portal actual
+UIPortalManagement.title.BROWSE=Getionar Portales
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIContainerConfigOptions #
+ #############################################################################
+
+UIContainerConfigOptions.label.ContainerConfigTitle=Categor\u00eda del Contenedor
+UIContainerConfigOptions.label.selectContainerCategory=Haz Click aqu\u00ed para selccionar otra categor\u00eda de Contenedor
+UIContainerConfigOptions.tab.row=Distribuci\u00f3n en filas del Contenedor
+UIContainerConfigOptions.tab.column=Distribuci\u00f3n en columnas del Contenedor
+UIContainerConfigOptions.tab.tabs=Distribuci\u00f3n en Tabs del Contenedor
+UIContainerConfigOptions.tab.mixed=Distribuci\u00f3n Mixta del Contenedor
+UIContainerConfigOptions.UIDropDown.title=Distribuci\u00f3n en filas
+UIContainerConfigOptions.UIDropDown.label.ContainerCategory=Categor\u00eda del Contenedor
+UIContainerConfigOptions.UIDropDown.label.row=Distribuci\u00f3n en filas
+UIContainerConfigOptions.UIDropDown.label.column=Distribuci\u00f3n en columnas
+UIContainerConfigOptions.UIDropDown.label.tabs=Distribuci\u00f3n en Tabs
+UIContainerConfigOptions.UIDropDown.label.mixed=Distribuci\u00f3n Mixta
+UIContainerConfigOptions.template.oneRow=Contenedor de una Fila
+UIContainerConfigOptions.template.twoRows=Contenedor de dos Filas
+UIContainerConfigOptions.template.threeRows=Contenedor de tres Filas
+UIContainerConfigOptions.template.oneColumns=Contenedor de una Columna
+UIContainerConfigOptions.template.twoColumns=Contenedor de dos Columnas
+UIContainerConfigOptions.template.threeColumns=Contenedor de tres Columnas
+UIContainerConfigOptions.template.twoTabs=Contenedor de dos Tabs
+UIContainerConfigOptions.template.threeTabs=Contenedor de tres Tabs
+UIContainerConfigOptions.template.twoColumnsOneRow=Contenedor de dos Columnas, una Fila
+UIContainerConfigOptions.template.oneRowTwoColumns=Contenedor de una Fila, dos Columnas
+UIContainerConfigOptions.template.oneRow2Column1Row=Contenedor de una Fila, dos Columnas, una Fila
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIDecoratorConfigOptions #
+ #############################################################################
+
+UIDecoratorConfigOptions.label.selectDecorator=Select Decorator
+
+ #############################################################################
+ #############################################################################
+ #############################################################################
+
+UIPortlet.label.portlet=Portlet
+UIPortlet.label.title=Portlet
+UIPortlet.label.description=Portlet eXo Platform
+UIPortlet.label.portletContent=Descripci\u00f3n del Portlet
+UIPortlet.label.View=Ver
+UIPortlet.lable.information=Hecho
+UIPortlet.deletePortlet=\u00bfEst\u00e1s seguro de que deseas borrar este Portlet?
+UIPortlet.tooltip.PortletMode=Modo Portlet
+UIPortlet.tooltip.Minimize=Minimizar
+UIPortlet.tooltip.MinimizeRestore=Restaurar
+UIPortlet.tooltip.Maximize=Maximizar
+UIPortlet.tooltip.MaximizeRestore=Restaurar
+UIPortlet.tooltip.editPortlet=Editar Portlet
+UIPortlet.tooltip.deletePortlet=Borrar Portlet
+UIPortlet.tooltip.ResizeWindow=Cambiar Tama\u00f1o a la Ventana
+UIPortlet.tooltip.DragControl=Mantener este \u00e1rea para arrastrar este portlet
+UIPortlet.message.RuntimeError=Este Portlet ha encontrado un error y no puede mostrarse
+ #############################################################################
+
+PortletMode.label.help=Ayuda
+PortletMode.label.view=Ver
+PortletMode.label.edit=Editar
+
+ #############################################################################
+
+UIPagePreview.action.Back=#{word.back}
+UIPagePreview.msg.empty=Esta P\u00e1gina no tiene contenido. Haz Click en "Editar P\u00e1gina" para a\u00f1adir contenido.
+
+ #############################################################################
+
+UIVTabInputSet.label.personalInfo=Informaci\u00f3n Personal
+
+ #############################################################################
+ # org.exoplatform.portletregistry.webui.component.UIFormAvailablePortlet #
+ #############################################################################
+
+UIFormAvailablePortlet.label.UIFormTableInputSet=Portlet
+
+ #############################################################################
+ # org.exoplatform.portal.component.control.UIQuickBar #
+ #############################################################################
+
+UIQuickBar.tooltip.BasicCustomization=Personalizaci\u00f3n B\u00e1sica
+UIQuickBar.tooltip.AdvanceCustomization=Personalizaci\u00f3n Avanzada
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIPageEditBar #
+ #############################################################################
+
+UIPageEditBar.tooltip.PagePreview=Previsualizar P\u00e1gina
+UIPageEditBar.tooltip.EditPage=Editar las propiedades de la P\u00e1gina
+UIPageEditBar.tooltip.SharedNavigation=Configuraci\u00f3n de la Navegaci\u00f3n Comunitaria
+UIPageEditBar.tooltip.EditContainer=Mostrar control de Contenedor
+UIPageEditBar.tooltip.EditPortlet=Mostrar control de Portlet
+UIPageEditBar.tooltip.Decorator=Decorador
+UIPageEditBar.tooltip.SavePage=Guardar P\u00e1gina
+UIPageEditBar.tooltip.TurnOffPreview=Haz Click aqu\u00ed para desactivar el modo de Previsualizaci\u00f3n
+UIPageManagement.title.BROWSE=Gestionar P\u00e1gina
+UIPageManagement.title.EDIT=Explorador de P\u00e1gina & Navegaci\u00f3n
+UIPageManagement.msg.Invalid-editPermission=no tienes permisos para editar esta P\u00e1gina.
+
+ #############################################################################
+ #org.exoplatform.webui.core.UIPageIterator #
+ #############################################################################
+
+UIPageIterator.label.totalPage=Total de p\u00e1ginas
+UIPageIterator.label.backTenPages=Anteriores 10 p\u00e1ginas
+UIPageIterator.label.previous=P\u00e1gina Anterior
+UIPageIterator.label.next=P\u00e1gina Siguiente
+UIPageIterator.label.nextTenPages=Siguientes 10 p\u00e1ginas
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIPortalBrowser #
+ #############################################################################
+
+UIPortalBrowser.header.creator=Creador
+UIPortalBrowser.header.editPermission=Editar Permisos
+UIPortalBrowser.header.accessPermissions=Permisos de Acceso
+UIPortalBrowser.header.name=#{word.name}
+UIPortalBrowser.header.skin=#{word.skin}
+UIPortalBrowser.header.action=#{word.action}
+UIPortalBrowser.header.factoryId=Id Factory
+UIPortalBrowser.action.addNewPortal=Crea Nuevo Portal
+UIPortalBrowser.action.title.DeletePortal=Borrar Portal
+UIPortalBrowser.msg.Invalid-viewPermission=El Portal no permite el acceso
+UIPortalBrowser.msg.PortalInUse=portal {0} est\u00e1 siendo usado.
+UIPortalBrowser.msg.Invalid-deletePermission=no tienes permisos para borrar el portal {0}.
+UIPortalBrowser.msg.Invalid-createPermission=no tienes permisos para crear un nuevo portal. Contacta con el administrador.
+UIPortalBrowser.deletePortal=\u00bfEst\u00e1s seguro de que deseas borrar este portal?
+SitePortal.label=Portal del Sitio Web
+ClassicPortal.label=Portal Classic
+WebOSPortal.label=Portal WebOS
+
+ ############################################################################
+
+UIPageEditor.tooltip.PagePreview=Previsualizar P\u00e1gina
+UIPageEditor.tooltip.EditPage=Editar P\u00e1gina
+UIPageEditor.tooltip.EditContainer=Editar Contenedor
+UIPageEditor.tooltip.EditPortlet=Editar Portlet
+UIPageEditor.tooltip.Decorator=Decorador
+UIPageEditor.tooltip.SavePage=Guardar P\u00e1gina
+
+ ############################################################################
+ # org.exoplatform.webui.form.UIPopupWindow #
+ ############################################################################
+
+PopupPageSelector.title.UIPageBrowser=Buscar y Seleccionar P\u00e1gina
+PopupPageSelector.title.SelectPage=Selecciona una P\u00e1gina
+UIControWSPopupWindow.title.UIApplicationTree=\u00c1rbol de Aplicaci\u00f3n
+EditGroup.title.UIPageNavigationForm=A\u00f1adir Navegaci\u00f3n
+
+ ############################################################################
+ # org.exoplatform.portal.component.widget.UILogged #
+ ############################################################################
+
+UILogged.note.loggedUser=Bienvenid
+UILogged.note.ItemContainer=Este componente est\u00e1 siendo desarrollado.
+UILogged.action.logout=Desconectarse
+UILogged.action.signout=Desconectar
+UILogged.action.Youhave=Tienes:
+UILogged.title.widgetNews=Gadgets eXo
+UILogged.title.widgetCategory=Categoria del Gadget
+UILogged.title.widgetItem=Gadgets
+UILogged.title.BrowsersSupport=Soporte a Navegadores
+UILogged.label.Workbeston=Funciona mejor es
+UILogged.label.Workableon=Tambien posible
+UILogged.label.DownloadNow=Desc\u00e1rgalo ahora
+UILogged.label.RollBack=Deshacer
+UILogged.label.Save=Guardar
+UILogged.label.Finish=Finalizar
+UILogged.label.Abort=Abortar
+
+ ############################################################################
+ # org.exoplatform.portal.component.widget.UILoginForm #
+ ############################################################################
+
+UIPortalComponentLogin.label.password=Contrase\u00f1a
+UIPortalComponentLogin.label.username=Nombre de Usuario
+UIForgetPasswordWizard.title=\u00bfPorqu\u00e9 no puedes acceder a eXo?
+UIForgetPasswordWizard.action.Next=Siguiente
+UIForgetPasswordWizard.action.Back=Atr\u00e1s
+UIForgetPasswordWizard.info=Sentimos cualquier inconveniente por no poder acceder a eXo.<br />Para resolver esta incidencia tan pronto como sea posible, por favor sigue los pasos de resoluci\u00f3n de incidencias que siguen.<br /><br />1. Recuperar tu Contrase\u00f1a: introduce <strong>tu nombre de usuario</strong> y pulsa enviar.<br/>2. Recuperar tu nombre de usuario: introduce <strong>tu correo electr\u00f3nico</strong> y pulsa enviar.<br/>
+UIForgetPasswordWizard.label.forgotpassword=Olvid\u00e9 mi Contrase\u00f1a
+UIForgetPasswordWizard.label.forgotusername=Olvid\u00e9 mi Nombre de Usuario
+
+ ############################################################################
+ # org.exoplatform.webui.portal.UIForgetPassword & UIResetPassword #
+ ############################################################################
+
+UIForgetPassword.title=Olvid\u00f3 su nombre de Usuario/Contrase\u00f1a
+UIForgetPassword.action.Send=Enviar
+UIForgetPassword.action.Back=Atr\u00e1s
+UIForgetPassword.label.username=Nombre de Usuario :
+UIForgetPassword.label.email=Correo Electr\u00f3nico :
+UIForgetPassword.msg.user-delete=Tu nombre de usuario ha sido borrado de la base de datos.
+UIForgetPassword.msg.user-not-exist=Este nombre de usuario no existe en eXo.
+UIForgetPassword.msg.email-not-exist=Este correo electr\u00f3nico no existe en eXo.
+UIForgetPassword.msg.send-mail-success=Por favor, verifica tu correo electr\u00f3nico.
+UIForgetPassword.msg.expration=Tu enlace ha expirado, tienes que repetir el proceso de activaci\u00f3n.
+UIForgetPassword.mail.header=Gracias por contactar con el servicio de soporte del Portal eXo. Has enviado una petici\u00f3n de envio de tu Nombre de Usuario y Contrase\u00f1a.
+UIForgetPassword.mail.footer=Gracias, Soporte del Portal eXo.
+UIForgetPassword.mail.user=El Nombre de usuario de tu cuenta es :
+UIForgetPassword.mail.password=La Contrase\u00f1a para del Nombre de usuario de tu cuenta es :
+UIForgetPassword.mail.link=Puedes solicitar una nueva Contrase\u00f1a para tu Nombre de Usuario, por favor. haz click en este link :
+UIResetPassword.title=Camiar contrase\u00f1a
+UIResetPassword.action.Save=Guardar
+UIResetPassword.action.Close=Cerrar
+UIResetPassword.label.username=Nombre de usuario:
+UIResetPassword.label.password=Contrase\u00f1a:
+UIResetPassword.label.changepass=Camiar contrase\u00f1a:
+UIResetPassword.label.newpassword=Nueva contrase\u00f1a:
+UIResetPassword.label.confirmnewpassword=Confirmar nueva contrase\u00f1a:
+UIResetPassword.msg.change-password-successfully=La contrase\u00f1a ha sido cambiada.
+UIResetPassword.msg.password-is-not-match=La nueva contrase\u00f1a y la Confirmaci\u00f3n de contrase\u00f1a deben ser las mismas.
+UIResetPassword.msg.Invalid-account=El Nombre de Usuario o la Contrase\u00f1a son incorrectos o est\u00e1n vac\u00edos. Por favor, intentelo de nuevo.
+
+ ############################################################################
+ # org.exoplatform.webui.core.UIPopupMessages #
+ ############################################################################
+
+UIPopupMessages.title.exoMessages=Mensajes eXo
+UIPopupMessages.button.ok=OK
+UIPopupMessages.label.Error=Error
+UIPopupMessages.label.Warning=Aviso
+UIPopupMessages.label.Info=Informaci\u00f3n
+UIPopupMessages.Close=Cerrar Ventana
+
+ ############################################################################
+ # org.exoplatform.portal.webui.component.UISitemapPortlet #
+ ############################################################################
+
+UISitemap.label.message=No hay ninguna p\u00e1gina hijo en esta ubicaci\u00f3n.
+
+ ############################################################################
+ # org.exoplatform.portal.component.customization.UIPortalToolPanel #
+ ############################################################################
+
+UIPortalToolPanel.label.copyrightText=Copyright © 2009. All rights Reserved,
+UIPortalToolPanel.label.companyTitleText= eXo Platform SAS and Red Hat, Inc..
+
+ ############################################################################
+ # org.exoplatform.portal.component.view.UIContainer #
+ ############################################################################
+
+UIContainer.title.Container=Contenedor
+UIContainer.title.DragControlArea=Manten este \u00e1rea para arrastrar este contenedor
+UIContainer.label.Thecontainer=El contenedor
+UIContainer.deleteContainer=\u00bfEst\u00e1s seguro de que deseas borrar este Contenedor?
+UIContainer.tooltip.closeContainer=Borrar Contenedor
+UIContainer.tooltip.editContainer=Editar Contenedor
+UIContainer.tooltip.drag=Arrastrar Contenedor aqu\u00ed
+
+ ############################################################################
+ # org.exoplatform.portal.component.view.UIPage #
+ ############################################################################
+
+UIPage.label.title=P\u00e1gina del Portal
+UIPage.label.description=El cuerpo de la p\u00e1gina del portal
+UIPage.label.pageContent=Descripci\u00f3n de la P\u00e1gina
+UIPage.msg.EditPermission.null=No tienes permisos para editar esta p\u00e1gina.
+
+ ############################################################################
+ # org.exoplatform.portal.component.view.UIPageDesktop #
+ ############################################################################
+
+UIPageDesktop.Default.img.location=/eXoResources/skin/DefaultSkin/portal/webui/component/view/UIPageDesktop/icons/80x80
+UIPageDesktop.Mac.img.location=/eXoResources/skin/DefaultSkin/portal/webui/component/view/UIPageDesktop/icons/80x80
+UIPageDesktop.Vista.img.location=/eXoResources/skin/DefaultSkin/portal/webui/component/view/UIPageDesktop/icons/80x80
+UIPageDesktop.label.pagebody=El cuerpo de la p\u00e1gina del portal
+UIPageDesktop.label.PageContent=Contenido de la P\u00e1gina
+UIPageDesktop.label.View=Ver
+UIPageDesktop.label.Edit=Editar
+UIPageDesktop.label.Done=Hecho
+UIPageDesktop.title.PortalPage=P\u00e1gina del Portal
+UIPageDesktop.title.SaveToDatabase=Guardar en la Base de Datos
+UIPageDesktop.title.AddApplication=A\u00f1adir Aplicaciones
+UIPageDesktop.title.PageNavigation=Navegaci\u00f3n de P\u00e1gina
+UIPageDesktop.title.eXoBrowser=Browser eXo.
+UIPageDesktop.title.ShowPortletDesktop=Mostrar/Ocultar Portlets
+UIPageDesktop.title.ShowWidgetDesktop=Mostrar/Ocultar Gadgets
+UIPageDesktop.title.SignIn=Ingresar
+UIPageDesktop.title.SignOut=Salir
+UIPageDesktop.title.pageNavigation=Navegaciones de P\u00e1gina
+UIPageDesktop.msg.hasNotPermission=No tienes permisos de edici\u00f3n en esta P\u00e1gina.
+UIPageDesktop.action.Close=Eliminar esta aplicaci\u00f3n del dockbar
+UIPageDesktop.action.Quit=Salir
+UIPageDesktop.action.action.Open=Abrir
+
+ ############################################################################
+ # org.exoplatform.portal.component.view.UIPageBody #
+ ############################################################################
+
+UIPageBody.label.title=Cuerpo de la P\u00e1gina del Portal
+UIPageBody.label.description=El Cuerpo de la P\u00e1gina del Portal
+UIPageBody.msg.pageNotFoundLine1=P\u00e1gina no encontrada.
+UIPageBody.msg.pageNotFoundLine2=No tienes permisos para ver esta P\u00e1gina.
+UIPageBody.msg.pageNotFoundLine3=La P\u00e1gina no puede ser borrada.
+UIPageBody.msg.pageNotFoundLine4=Este nodo no tiene ninguna P\u00e1gina.
+
+ ############################################################################
+ # org.exoplatform.portal.component.view.UIPortal #
+ ############################################################################
+
+UIPortal.label.title=Contenedor UIPortal
+UIPortal.label.description=El Contenedor UIPortal
+
+ ############################################################################
+ # org.exoplatform.portal.component.view.UITableColumnContainer#
+ ############################################################################
+
+UITableColumnContainer.label.title=Contenedor de Navegaci\u00f3n
+UITableColumnContainer.label.description=El Contenedor de Navegaci\u00f3n
+
+ ###############################################################################
+ # org.exoplatform.portal.webui.component.UISearchForm #
+ ###############################################################################
+
+UISearch.label.AdvancedSearch=B\u00fasqueda Avanzada
+UISearch.label.UISavedQuery=Consulta guardada
+UISearch.label.UISearchResult=Resultados de la B\u00fasqueda avanzada
+UISearch.label.UIMetadataSearch=B\u00fasqueda de Metadatos
+UISearch.label.Search=B\u00fasqueda
+UISearch.label.QuickSearch=B\u00fasqueda R\u00e1pida
+UISearchForm.msg.empty=No se ha encontrado ning\u00fan resultado.
+
+ ###############################################################################
+ # org.exoplatform.portal.webui.component.UIFormUploadInput #
+ ###############################################################################
+
+UIFormUploadInput.label.Uploaded=Subida
+UIFormUploadInput.label.remove=Elinimar Subida
+UIFormUploadInput.label.Cancel=Cancelar
+UIFormUploadInput.msg.limit=El tama\u00f1o del fichero debe ser inferior a {0} MB.
+
+ ###############################################################################
+ # org.exoplatform.portal.webui.component.customization.UIPageNodeSelector #
+ ###############################################################################
+
+NavigationNodePopupMenu.event.AddNode=A\u00f1adir un nuevo Nodo
+NavigationNodePopupMenu.event.EditPageNode=Editar el Nodo de la P\u00e1gina
+NavigationNodePopupMenu.event.EditSelectedNode=Editar este Nodo
+NavigationNodePopupMenu.event.EditNavigation=Editar la Navegaci\u00f3n
+NavigationNodePopupMenu.event.CopyNode=Copiar Nodo
+NavigationNodePopupMenu.event.CloneNode=Clonar Nodo
+NavigationNodePopupMenu.event.CutNode=Cortar Nodo
+NavigationNodePopupMenu.event.MoveUp=mover hacia arriba
+NavigationNodePopupMenu.event.MoveDown=Mover hacia abajo
+NavigationNodePopupMenu.event.PasteNode=Pegar Nodo
+NavigationNodePopupMenu.event.SaveNavigation=Guardar Navegaci\u00f3n
+NavigationNodePopupMenu.event.DeleteNode=Borrar Nodo
+UIGroupManagement.msg.Edit=Debes seleccionar un Grupo.
+UIGroupManagement.msg.Delete=No puedes borrar este grupo porque est\u00e1 siendo usado por otro programa.
+UIGroupManagement.msg.DeleteMandatory=No puedes borrar este grupo porque o el nodo o alguno de sus hijos es obligatorio.
+
+ ###############################################################################
+ # org.exoplatform.portal.webui.component.customization.UIEditCurentPage #
+ ###############################################################################
+
+UIEditCurentPage.label.pageCreateWizard=Asistente de edici\u00f3n de la p\u00e1gina actual
+UIEditCurentPage.label.step1.title=Bienvenid a la edici\u00f3n de la p\u00e1gina actual
+UIEditCurentPage.label.wizardSteps=Pasos
+UIEditCurentPage.label.next=Siguiente
+UIEditCurentPage.label.done=Guardar
+UIEditCurentPage.label.back=Atr\u00e1s
+UIEditCurentPage.label.abort=Abortar
+UIEditCurentPage.label.step2.title=Selecciona un nodo de P\u00e1gina y crea el nombre de P\u00e1gina
+UIEditCurentPage.label.step3.title=Selecciona una plantilla de distribuci\u00f3n de p\u00e1gina
+UIEditCurentPage.label.step4.title=Drag and Drop
+
+ ###############################################################################
+ # org.exoplatform.portal.webui.UIAccessGroup #
+ ###############################################################################
+
+UIAccessGroup.deleteAccessGroup=\u00bfEst\u00e1s seguro de que deseas eliminar este Grupo de Acceso?
+
+ #############################################################################
+ # org.exoplatform.portal.organization.component.UISharedPortalResources#
+ #############################################################################
+
+UISharedPortalResources.msg.notSelected=Tienes que seleccionar un Grupo
+UISharedNavigation.msg.notSelected=Tienes que seleccionar un Grupo.
+Office.label=Office
+Default.label=Por Defecto
+FactoryId.left.title=Id Factory
+FactoryId.title=Id Factory
+
+ ################################################################################
+ # org.exoplatform.webui.core.UIGrid
+ ################################################################################
+
+UIGrid.msg.empty=Datos vac\u00edos
+
+ ################################################################################
+ #
+ ################################################################################
+
+UIItemSelector.lable.ItemDetailTitle=Previsualizaci\u00f3n de la Distribuci\u00f3n de la p\u00e1gina de ejemplo
+
+ ################################################################################
+ # UITree
+ ################################################################################
+
+UITree.tooltip.UpLevel=Nivel previo
+
+ ################################################################################
+ # UIAccountSettings # tungnd
+ ################################################################################
+
+UIAccountSetting.tab.label.UIAccountProfiles=Perfiles de Cuenta
+UIAccountSetting.tab.label.UIAccountChangePass=Cambiar Contrase\u00f1a
+UIAccountSetting.action.Close=Cerrar
+
+ #se xoa##
+
+
+ #se xoa#
+
+UIAccountProfiles.action.Save=Guardar
+UIAccountProfiles.action.Reset=Resetear
+UIAccountProfiles.label.userName=Nombre de Usuario :
+UIAccountProfiles.label.firstName=Nombre :
+UIAccountProfiles.label.lastName=Apellido :
+UIAccountProfiles.label.email=Correo Elctr\u00f3nico :
+UIAccountProfiles.msg.update.success=La informaci\u00f3n de la Cuenta ha sido atualizada.
+UIAccountChangePass.action.Save=Guardar
+UIAccountChangePass.action.Reset=Resetear
+UIAccountChangePass.label.currentpass=Contrase\u00f1a Actual :
+UIAccountChangePass.label.newpass=Nueva Contrase\u00f1a :
+UIAccountChangePass.label.confirmnewpass=Confirmar Nueva Contrase\u00f1a :
+UIAccountChangePass.msg.change.pass.success=La Contrase\u00f1a ha sido Actualizada.
+UIAccountChangePass.msg.password-is-not-match=La nueva Contrase\u00f1a no coincide con la Confirmaci\u00f3n de Contrase\u00f1a.
+UIAccountChangePass.msg.currentpassword-is-not-match=La Contrase\u00f1a actual no es correcta.
+
+ ################################################################################
+ # UIDropDownControl # tungnd
+ ################################################################################
+
+UIDropDownControl.title.Empty=Control Drop Down
+UIDropDownPageTemp.item.normalPageConfigs=Configuraciones de P\u00e1gina
+UIDropDownPageTemp.item.columnPageConfigs=Configuraciones de Columna de P\u00e1gina
+UIDropDownPageTemp.item.mixPageConfigs=Configuraciones Mixtas de P\u00e1gina
+UIDropDownPageTemp.item.rowPageConfigs=Configuraciones de Fila de P\u00e1gina
+UIDropDownPageTemp.item.tabsPageConfigs=Configuraciones de Tabs de P\u00e1gina
+
+
+ ################################################################################
+ # org.exoplatform.portal.webui.application.UIGadgetContainerManagement
+ ################################################################################
+
+UIGadgetContainerManagement.action.close=Cancelar
+UIGadgetContainerManagement.action.save=#{word.save}
+UIGadgetContainerManagement.confirm.DeleteContainer=\u00bfEst\u00e1s seguro de que deseas borrar este Contenedor?
+UIGadgetContainerManagement.confirm.DeleteGadget=\u00bfEst\u00e1s seguro de que deseas borrar este gadget?
+UIGadgetContainerManagement.title.manager=Gesti\u00f3n de Contenedores de Gadgets
+UIGadgetContainerManagement.title.containers=Contenedores
+UIGadgetContainerManagement.title.selectedContainer=Informaci\u00f3n del Contenedor del Gadget Seleccionado:
+UIGadgetContainerManagement.msg.emptyList=No hay ningun Contenedor en esta Categor\u00eda.
+UIGadgetContainerManagement.msg.noSelected=No hay ningun Contenedor Seleccionado
+UIGadgetContainerManagement.label.label=Etiqueta del Contenedor:
+UIGadgetContainerManagement.label.description=Descripci\u00f3n del Contenedor:
+UIGadgetContainerManagement.tooltip.remove=Eliminar el Contenedor del Gadget Seleccionado
+UIGadgetContainerManagement.tooltip.edit=Editar el Contenedor del Gadget Seleccionado
+UIGadgetContainerManagement.tooltip.addnew=A\u00f1adir nuevo Contenedor de Gadget
+
+ ################################################################################
+ # org.exoplatform.portal.webui.application.UIGadgetContainerForm
+ ################################################################################
+
+GadgetContainerPopup.title.UIGadgetContainerForm=Formulario de Contenedor de Gadget
+UIGadgetContainerForm.label.name=Etiqueta:
+UIGadgetContainerForm.label.description=Descripci\u00f3n:
+UIGadgetContainerForm.action.Save=#{word.save}
+UIGadgetContainerForm.action.Close=Cancelar
+UIGadgetContainerForm.msg.exist=Este Id de Contenedor ya existes. Por favor, introduzca otro.
+
+ ################################################################################
+ # org.exoplatform.portal.webui.container.UIWidgetContainer
+ ################################################################################
+
+UIWidgetContainer.tooltip.addWidget=A\u00f1adir Gadget
+UIWidgetContainer.tooltip.scrollDown=Scroll abajo
+UIWidgetContainer.tooltip.scrollUp=Scroll arriba
+
+ ################################################################################
+ # org.exoplatform.web.portal.UIItemThemeSelector
+ ################################################################################
+
+Theme.UIItemThemeSelector.item.SimpleBlue=Azul Simple
+Theme.UIItemThemeSelector.item.SimpleGreen=Verde Simple
+Theme.UIItemThemeSelector.item.SimplePink=Rosa Simple
+Theme.UIItemThemeSelector.item.SimpleViolet=Violeta Simple
+Theme.UIItemThemeSelector.item.SimpleOrange=Naranja Simple
+Theme.UIItemThemeSelector.item.RoundConerPink=Esquina Redondeada Rosa
+Theme.UIItemThemeSelector.item.RoundConerOrange=Esquina Redondeada Naranja
+Theme.UIItemThemeSelector.item.RoundConerGreen=Esquina Redondeada Verde
+Theme.UIItemThemeSelector.item.RoundConerViolet=Esquina Redondeada Violeta
+Theme.UIItemThemeSelector.item.RoundConerBlue=Esquina Redondeada Azul
+Theme.UIItemThemeSelector.item.ShadowPink=Sombra Rosa
+Theme.UIItemThemeSelector.item.ShadowOrange=Sombra Naranja
+Theme.UIItemThemeSelector.item.ShadowBlue=Sombra Azul
+Theme.UIItemThemeSelector.item.ShadowViolet=Sombra Violeta
+Theme.UIItemThemeSelector.item.ShadowGreen=Sombra Verde
+Theme.UIItemThemeSelector.item.VistaBlue=Azul Vista
+Theme.UIItemThemeSelector.item.VistaTheme=Tema Vista
+Theme.UIItemThemeSelector.item.MacBlack=Mac Negro
+Theme.UIItemThemeSelector.item.MacGreenSteel=Mac Acero Verde
+Theme.UIItemThemeSelector.item.MacTheme=Tema Mac
+Theme.UIItemThemeSelector.item.MacGray=Mac Gris
+Theme.UIItemThemeSelector.item.DefaultTheme=Tema por Defecto
+ThemeDropDown.item.Shadow=Estilo Sombra
+ThemeDropDown.item.Simple=Estilo Simple
+ThemeDropDown.item.VistaStyle=Estilo Vista
+ThemeDropDown.item.MacStyle=Estilo Mac
+ThemeDropDown.item.RoundConer=Estilo esquinas redondeadas
+
+ ################################################################################
+ # org.exoplatform.dashboard.webui.component.UIDashboard
+ ################################################################################
+
+UIAddGadgetPopup.title.UIDashboardSelectContainer=Area de Trabajo del Tablero
+UIDashboardSelectContainer.action.addGadget=A\u00f1adir Gadget
+UIDashboardContainer.label.openWorkspace=A\u00f1adir Gadgets
+UIDashboardContainer.label.SaveTitle=Guardar
+UIDashboardContainer.label.CancelTitle=Cancelar
+UIDashboardContainer.label.Debug=Debug
+UIDashboardContainer.label.Cache=Sin Cache
+UIDashboardEditForm.label.totalColumns=N\u00famero de Columnas
+UIDashboardEditForm.label.isPrivate=Es Privado:
+UIDashboardEditForm.label.owner=Propietario:
+UIDashboard.msg.required=El Campo de Texto es obligatorio.
+UIDashboard.msg.addGadget=Arrastra tus gadgets aqu\u00ed.
+UIDashboard.msg.notUrl=La URL es inv\u00e1lida. Por favor, introduce la url correcta de xml de un gadget o de un RSS feed.
+
+ ################################################################################
+ # org.exoplatform.webui.organization.account.UIUserSelector
+ ################################################################################
+
+UIUserSelector.label.option.userName=Nombre de Usuario
+UIUserSelector.label.option.lastName=Apellido
+UIUserSelector.label.option.firstName=Nombre
+UIUserSelector.label.option.email=Correo electr\u00f3nico
+UIUserSelector.label.group=Grupo :
+UIUserSelector.label.searchUser=B\u00fasqueda :
+UIUserSelector.label.userName=Nombre de Usuario
+UIUserSelector.label.lastName=Apellido
+UIUserSelector.label.firstName=Nombre
+UIUserSelector.label.email=Correo electr\u00f3nico
+UIUserSelector.label.action=Acci\u00f3n
+UIUserSelector.label.Add=A\u00f1adir
+UIUserSelector.label.Close=Cerrar
+UIUserSelector.msg.empty=Datos vac\u00edos
+UIUserSelector.msg.user-required=Por favor, selecciona al menos un usuario.
+
+ ################################################################################
+ # org.exoplatform.portal.webui.application.UIAddNewApplication
+ ################################################################################
+
+UIAddNewApplication.label.AddApplication=A\u00f1adir Aplicaci\u00f3n
+UIAddNewApplication.label.Categories=Categor\u00edas
+UIAddNewApplication.label.Select=Seleccionar Aplicaciones
+UIAddNewApplication.label.NoneApp=No hay aplicaciones en esta ubicaci\u00f3n. Ve al portlet de registro de Aplicaciones para importar aplicaciones.
+UIAddNewApplication.label.Type=Tipe:
+UIAddNewApplication.label.Created=Creado por:
+UIAddNewApplication.label.Description=Descripci\u00f3n:
+UIAddNewApplication.label.Close=Cerrar
+UIAddNewApplication.label.Add=A\u00f1ade y manten esta aplicaci\u00f3n en una p\u00e1gina
+UIAddNewApplication.label.AddToStartup=A\u00f1ade y ejecuta esta aplicaci\u00f3n inmediatamente
+
+ #############################################################################
+ #org.exoplatform.portal.webui.component.UIPortalNavigation #
+ #############################################################################
+
+UIPortalNavigation.Label.Next=Siguiente
+UIPortalNavigation.Label.Previous=Previo
+
+ #############################################################################
+ # org.exoplatform.portal.component.customization.UIDropDownConfigs #
+ #############################################################################
+
+UIDropDownConfigs.item.row=En lineas
+UIDropDownConfigs.item.column=En columnas
+UIDropDownConfigs.item.tabs=En tabs
+UIDropDownConfigs.item.mix=Mezclado
+
+ #############################################################################
+ # org.exoplatform.portal.webui.container.UITabContainer #
+ #############################################################################
+
+UITabContainer.tab=Tab
+
+ ############################################################################
+ # org.exoplatform.portal.webui.container.UIBrowserPortlet #
+ ############################################################################
+
+UIBrowserPortlet.Back=Atr\u00e1s
+UIBrowserPortlet.Forward=Adelante
+UIBrowserPortlet.Refresh=Refrescar
+UIBrowserPortlet.Stop=Stop
+UIBrowserPortlet.Goto=Ir a la direcci\u00f3n de la barra de direcciones
+UIBrowserPortlet.Go=Ir
+UIBrowserPortlet.Untitled=(Untitled)
+UIBrowserPortlet.Tab=Nuevo tab
+
+ ############################################################################
+ # org.exoplatform.portal.webui.container.UIPopupWindow #
+ ############################################################################
+
+UIPopupWindow.Close=Cerrar Ventana
+UIPopupWindow.title.UIPageNodeForm2=A\u00d1ADIR/EDITAR NODO DE P\u00c1GINA
+UIPopupWindow.title.UINavigationManagement=Gesti\u00f3n de Navegaci\u00f3n
+UIPopupWindow.title.UIPageNavigationForm=Formulario de Navegaci\u00f3n de P\u00e1gina
+
+PopupPageSelector2.title.SelectPage=Selecciona P\u00e1gina
+
+ ############################################################################
+ # org.exoplatform.navigation.webui.component.UIGroupNavigationManagement #
+ ############################################################################
+
+UIGroupNavigationManagement.Action.Add=A\u00f1ade Navegaci\u00f3n
+UIGroupNavigationManagement.Delete.Confirm=\u00bfEst\u00e1s seguro de que deseas eliminar esta navegaci\u00f3n?
+
+ ############################################################################
+ # org.exoplatform.navigation.webui.component.UIGroupNavigationManagement #
+ ############################################################################
+
+UINavigationManagement.action.addNode=A\u00f1adir Nodo
+
+ ############################################################################
+ # org.exoplatform.navigation.webui.component.UIAddGroupNavigation #
+ ############################################################################
+
+UIAddGroupNavigation.Action.Add=A\u00f1adir Navegaci\u00f3n
+UIAddGroupNavigation.Label.NoPermission=Este usuario no tiene permisos para a\u00f1adir una Navegaci\u00f3n
+UIAddGroupNavigation.header.Group=Grupo
15 years, 2 months
gatein SVN: r572 - in portal/trunk/component/portal/src: main/java/org/exoplatform/portal/config/model and 4 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-11-11 15:51:06 -0500 (Wed, 11 Nov 2009)
New Revision: 572
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelChange.java
Removed:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelChange.java
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorageImpl.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java
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/ModelDataStorage.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
Log:
- re enable commented dashboard unit test (by me, forgot to uncomment)
- start to test again the model changes returned by the mop portal layer to use it for cache eviction
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java 2009-11-11 17:48:34 UTC (rev 571)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorage.java 2009-11-11 20:51:06 UTC (rev 572)
@@ -22,14 +22,12 @@
import org.exoplatform.commons.utils.LazyPageList;
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.config.model.ApplicationState;
-import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.Dashboard;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PortalConfig;
-import org.exoplatform.portal.pom.config.POMTask;
import java.util.Comparator;
import java.util.List;
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorageImpl.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorageImpl.java 2009-11-11 17:48:34 UTC (rev 571)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/DataStorageImpl.java 2009-11-11 20:51:06 UTC (rev 572)
@@ -24,7 +24,7 @@
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.Dashboard;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.ModelObject;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2009-11-11 17:48:34 UTC (rev 571)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/UserPortalConfigService.java 2009-11-11 20:51:06 UTC (rev 572)
@@ -23,7 +23,7 @@
import org.exoplatform.container.component.ComponentPlugin;
import org.exoplatform.portal.config.model.Application;
import org.exoplatform.portal.config.model.Container;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.ModelObject;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
Deleted: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelChange.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelChange.java 2009-11-11 17:48:34 UTC (rev 571)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelChange.java 2009-11-11 20:51:06 UTC (rev 572)
@@ -1,81 +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.config.model;
-
-import org.exoplatform.portal.pom.data.ModelData;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public abstract class ModelChange
-{
-
- public static class Create extends ModelChange
- {
-
- /** . */
- private final ModelData object;
-
- public Create(ModelData object)
- {
- this.object = object;
- }
-
- public ModelData getObject()
- {
- return object;
- }
- }
-
- public static class Update extends ModelChange
- {
-
- /** . */
- private final ModelData object;
-
- public Update(ModelData object)
- {
- this.object = object;
- }
-
- public ModelData getObject()
- {
- return object;
- }
- }
-
- public static class Destroy extends ModelChange
- {
-
- /** . */
- private final String objectId;
-
- public Destroy(String objectId)
- {
- this.objectId = objectId;
- }
-
- public String getObjectId()
- {
- return objectId;
- }
- }
-}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-11-11 17:48:34 UTC (rev 571)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-11-11 20:51:06 UTC (rev 572)
@@ -28,7 +28,7 @@
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.CloneApplicationState;
import org.exoplatform.portal.config.model.Container;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.ModelObject;
import org.exoplatform.portal.pom.config.cache.DataCache;
import org.exoplatform.portal.pom.config.tasks.DashboardTask;
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java 2009-11-11 17:48:34 UTC (rev 571)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/PageTask.java 2009-11-11 20:51:06 UTC (rev 572)
@@ -22,9 +22,9 @@
import org.exoplatform.portal.pom.config.cache.DataAccessMode;
import org.exoplatform.portal.pom.config.cache.CacheableDataTask;
import org.exoplatform.portal.pom.data.Mapper;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.pom.data.PageData;
-import org.exoplatform.portal.config.model.ModelChange;
import org.exoplatform.portal.pom.config.AbstractPOMTask;
import org.exoplatform.portal.pom.config.POMSession;
import org.exoplatform.portal.pom.data.PageKey;
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 2009-11-11 17:48:34 UTC (rev 571)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2009-11-11 20:51:06 UTC (rev 572)
@@ -23,7 +23,7 @@
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.CloneApplicationState;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.PersistentApplicationState;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.TransientApplicationState;
Copied: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelChange.java (from rev 558, portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/model/ModelChange.java)
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelChange.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelChange.java 2009-11-11 20:51:06 UTC (rev 572)
@@ -0,0 +1,79 @@
+/**
+ * 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.pom.data;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public abstract class ModelChange
+{
+
+ public static class Create extends ModelChange
+ {
+
+ /** . */
+ private final ModelData object;
+
+ public Create(ModelData object)
+ {
+ this.object = object;
+ }
+
+ public ModelData getObject()
+ {
+ return object;
+ }
+ }
+
+ public static class Update extends ModelChange
+ {
+
+ /** . */
+ private final ModelData object;
+
+ public Update(ModelData object)
+ {
+ this.object = object;
+ }
+
+ public ModelData getObject()
+ {
+ return object;
+ }
+ }
+
+ public static class Destroy extends ModelChange
+ {
+
+ /** . */
+ private final String objectId;
+
+ public Destroy(String objectId)
+ {
+ this.objectId = objectId;
+ }
+
+ public String getObjectId()
+ {
+ return objectId;
+ }
+ }
+}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelDataStorage.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelDataStorage.java 2009-11-11 17:48:34 UTC (rev 571)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/ModelDataStorage.java 2009-11-11 20:51:06 UTC (rev 572)
@@ -23,13 +23,10 @@
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.config.Query;
import org.exoplatform.portal.config.model.ApplicationState;
-import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.Container;
-import org.exoplatform.portal.config.model.Dashboard;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.pom.data.PageData;
import org.exoplatform.portal.pom.data.PortalData;
-import org.exoplatform.portal.pom.config.POMTask;
import java.util.Comparator;
import java.util.List;
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-11-11 17:48:34 UTC (rev 571)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-11-11 20:51:06 UTC (rev 572)
@@ -29,7 +29,7 @@
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.Dashboard;
-import org.exoplatform.portal.config.model.ModelChange;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PortalConfig;
@@ -321,17 +321,17 @@
List<ModelChange> changes = storage_.save(page);
assertEquals(6, changes.size());
ModelChange.Update c0 = (ModelChange.Update)changes.get(0);
-// assertSame(page, c0.getObject());
+ assertSame(page.getStorageId(), c0.getObject().getStorageId());
ModelChange.Update c1 = (ModelChange.Update)changes.get(1);
-// assertSame(page.getChildren().get(0), c1.getObject());
+ assertSame(page.getChildren().get(0).getStorageId(), c1.getObject().getStorageId());
ModelChange.Update c2 = (ModelChange.Update)changes.get(2);
-// assertSame(page.getChildren().get(1), c2.getObject());
+ assertSame(page.getChildren().get(1).getStorageId(), c2.getObject().getStorageId());
ModelChange.Update c3 = (ModelChange.Update)changes.get(3);
-// assertSame(container.getChildren().get(0), c3.getObject());
+ assertSame(container.getChildren().get(0).getStorageId(), c3.getObject().getStorageId());
ModelChange.Create c4 = (ModelChange.Create)changes.get(4);
-// assertSame(container.getChildren().get(1), c4.getObject());
+ assertSame(container.getChildren().get(1).getStorageId(), c4.getObject().getStorageId());
ModelChange.Update c5 = (ModelChange.Update)changes.get(5);
-// assertSame(container.getChildren().get(2), c5.getObject());
+ assertSame(container.getChildren().get(2).getStorageId(), c5.getObject().getStorageId());
// Check it is existing at the correct location
// and also that the ids are still the same
@@ -432,7 +432,7 @@
// assertEquals(banner2.getInstanceId(), banner1.getInstanceId());
}
- public void _testDashboard() throws Exception
+ public void testDashboard() throws Exception
{
Page page = new Page();
page.setPageId("portal::test::foo");
@@ -470,7 +470,7 @@
assertEquals("foo/bar", storage_.getId(app.getState()));
}
- public void _testDashboardLayout() throws Exception
+ public void testDashboardLayout() throws Exception
{
Application<Portlet> dashboardPortlet = Application.createPortletApplication();
ApplicationState<Portlet> state = new TransientApplicationState<Portlet>("dashboard/DashboardPortlet");
@@ -498,7 +498,7 @@
assertEquals(3, dashboard.getChildren().size());
}
- public void _testDashboardMoveRight() throws Exception
+ public void testDashboardMoveRight() throws Exception
{
Page page = new Page();
page.setPageId("portal::test::foo");
@@ -542,7 +542,7 @@
assertEquals("foo", storage_.getId(gadgetApp.getState()));
}
- public void _testDashboardMoveLeft() throws Exception
+ public void testDashboardMoveLeft() throws Exception
{
Page page = new Page();
page.setPageId("portal::test::foo");
15 years, 2 months
gatein SVN: r571 - in portal/trunk/component/portal/src: main/java/org/exoplatform/portal/pom/config/cache and 2 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-11-11 12:48:34 -0500 (Wed, 11 Nov 2009)
New Revision: 571
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/TaskExecutionDecorator.java
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/cache/DataCache.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/OwnerKey.java
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
Log:
- fix issues with data cache
- add unit tests to ensure cache works
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-11-11 12:40:30 UTC (rev 570)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java 2009-11-11 17:48:34 UTC (rev 571)
@@ -77,7 +77,7 @@
private final Log log = ExoLogger.getLogger(getClass());
/** . */
- private final TaskExecutor executor;
+ private final TaskExecutionDecorator executor;
public POMDataStorage(CacheService cacheService, POMSessionManager pomMgr, ConfigurationManager confManager)
{
@@ -90,7 +90,12 @@
{
return pomMgr;
}
-
+
+ public <E extends TaskExecutionDecorator> E getDecorator(Class<E> decoratorClass)
+ {
+ return executor.getDecorator(decoratorClass);
+ }
+
/**
* <p>Execute the task with a session. The method attempts first to get a current session and if no such session
* is found then a session will be created for the scope of the method.</p>
@@ -115,7 +120,7 @@
}
else
{
- session.execute(task);
+ executor.execute(session, task);
}
//
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/TaskExecutionDecorator.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/TaskExecutionDecorator.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/TaskExecutionDecorator.java 2009-11-11 17:48:34 UTC (rev 571)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.config;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TaskExecutionDecorator implements TaskExecutor
+{
+
+ /** . */
+ private final TaskExecutor next;
+
+ public TaskExecutionDecorator(TaskExecutor next)
+ {
+ this.next = next;
+ }
+
+ public void execute(POMSession session, POMTask task) throws Exception
+ {
+ next.execute(session, task);
+ }
+
+ public <E extends TaskExecutor> E getDecorator(Class<E> decoratorClass)
+ {
+ if (decoratorClass.isInstance(this))
+ {
+ return decoratorClass.cast(this);
+ }
+ else
+ {
+ if (next != null && next instanceof TaskExecutionDecorator)
+ {
+ return ((TaskExecutionDecorator)next).getDecorator(decoratorClass);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ }
+}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/cache/DataCache.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/cache/DataCache.java 2009-11-11 12:40:30 UTC (rev 570)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/cache/DataCache.java 2009-11-11 17:48:34 UTC (rev 571)
@@ -21,27 +21,31 @@
import org.exoplatform.portal.pom.config.POMSession;
import org.exoplatform.portal.pom.config.POMTask;
import org.exoplatform.portal.pom.config.TaskExecutor;
+import org.exoplatform.portal.pom.config.TaskExecutionDecorator;
import org.exoplatform.services.cache.CacheService;
import org.exoplatform.services.cache.ExoCache;
import java.io.Serializable;
+import java.util.concurrent.atomic.AtomicLong;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class DataCache implements TaskExecutor
+public class DataCache extends TaskExecutionDecorator
{
/** . */
- private TaskExecutor next;
+ private final ExoCache<Serializable, Object> cache;
/** . */
- private ExoCache<Serializable, Object> cache;
+ private final AtomicLong readCount = new AtomicLong();
public DataCache(CacheService cacheService, TaskExecutor next)
{
- this.next = next;
+ super(next);
+
+ //
this.cache = cacheService.getCacheInstance(DataCache.class.getSimpleName());
}
@@ -70,31 +74,40 @@
throw new UnsupportedOperationException();
}
}
+ else
+ {
+ super.execute(session, task);
+ }
}
else
{
- next.execute(session, task);
+ super.execute(session, task);
}
}
+ public void clear()
+ {
+ cache.clearCache();
+ }
+
private <K extends Serializable, V> void remove(POMSession session, CacheableDataTask<K, V> task) throws Exception
{
K key = task.getKey();
cache.remove(key);
- next.execute(session, task);
+ super.execute(session, task);
}
private <K extends Serializable, V> void write(POMSession session, CacheableDataTask<K, V> task) throws Exception
{
K key = task.getKey();
cache.remove(key);
- next.execute(session, task);
+ super.execute(session, task);
}
private <K extends Serializable, V> void create(POMSession session, CacheableDataTask<K, V> task) throws Exception
{
// Nothing to do for now
- next.execute(session, task);
+ super.execute(session, task);
}
private <K extends Serializable, V> void read(POMSession session, CacheableDataTask<K, V> task) throws Exception
@@ -118,8 +131,10 @@
}
else
{
+ readCount.incrementAndGet();
+
//
- next.execute(session, task);
+ super.execute(session, task);
//
v = task.getValue();
@@ -129,4 +144,9 @@
}
}
}
+
+ public long getReadCount()
+ {
+ return readCount.longValue();
+ }
}
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/OwnerKey.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/OwnerKey.java 2009-11-11 12:40:30 UTC (rev 570)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/data/OwnerKey.java 2009-11-11 17:48:34 UTC (rev 571)
@@ -24,7 +24,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class OwnerKey implements Serializable
+public abstract class OwnerKey implements Serializable
{
/** . */
@@ -66,8 +66,12 @@
@Override
public boolean equals(Object obj)
{
- if (obj instanceof OwnerKey)
+ if (obj == this)
{
+ return true;
+ }
+ if (getClass().isInstance(obj))
+ {
OwnerKey that = (OwnerKey)obj;
return type.equals(that.type) && id.equals(that.id);
}
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-11-11 12:40:30 UTC (rev 570)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-11-11 17:48:34 UTC (rev 571)
@@ -31,8 +31,10 @@
import org.exoplatform.portal.config.model.PageBody;
import org.exoplatform.portal.config.model.PageNavigation;
import org.exoplatform.portal.config.model.PortalConfig;
+import org.exoplatform.portal.pom.config.POMDataStorage;
import org.exoplatform.portal.pom.config.POMSession;
import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.exoplatform.portal.pom.config.cache.DataCache;
import org.exoplatform.portal.pom.spi.portlet.Portlet;
import org.exoplatform.portal.pom.spi.portlet.PortletBuilder;
import org.exoplatform.services.listener.Event;
@@ -91,6 +93,9 @@
/** . */
private boolean registered;
+ /** . */
+ private POMDataStorage mopStorage;
+
public TestUserPortalConfigService(String name)
{
super(name);
@@ -114,8 +119,7 @@
};
PortalContainer container = PortalContainer.getInstance();
- userPortalConfigSer_ =
- (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
+ userPortalConfigSer_ = (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
orgService_ = (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
idmService = (JBossIDMService)container.getComponentInstanceOfType(JBossIDMService.class);
mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
@@ -123,6 +127,7 @@
listenerService = (ListenerService)container.getComponentInstanceOfType(ListenerService.class);
events = new LinkedList<Event>();
storage_ = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
+ mopStorage = (POMDataStorage)container.getComponentInstanceOfType(POMDataStorage.class);
// Register only once for all unit tests
if (!registered)
@@ -706,6 +711,60 @@
}.execute(null);
}
+ public void testCacheUserPortalConfig()
+ {
+ new UnitTest()
+ {
+ public void execute() throws Exception
+ {
+ DataCache cache = mopStorage.getDecorator(DataCache.class);
+ long readCount0 = cache.getReadCount();
+ userPortalConfigSer_.getUserPortalConfig("classic", null);
+ long readCount1 = cache.getReadCount();
+ assertTrue(readCount1 > readCount0);
+ userPortalConfigSer_.getUserPortalConfig("classic", null);
+ long readCount2 = cache.getReadCount();
+ assertEquals(readCount1, readCount2);
+ }
+ }.execute(null);
+ }
+
+ public void testCachePage()
+ {
+ new UnitTest()
+ {
+ public void execute() throws Exception
+ {
+ DataCache cache = mopStorage.getDecorator(DataCache.class);
+ long readCount0 = cache.getReadCount();
+ userPortalConfigSer_.getPage("portal::test::test1");
+ long readCount1 = cache.getReadCount();
+ assertTrue(readCount1 > readCount0);
+ userPortalConfigSer_.getPage("portal::test::test1");
+ long readCount2 = cache.getReadCount();
+ assertEquals(readCount1, readCount2);
+ }
+ }.execute(null);
+ }
+
+ public void testCachePageNavigation()
+ {
+ new UnitTest()
+ {
+ public void execute() throws Exception
+ {
+ DataCache cache = mopStorage.getDecorator(DataCache.class);
+ long readCount0 = cache.getReadCount();
+ userPortalConfigSer_.getPageNavigation("portal", "test");
+ long readCount1 = cache.getReadCount();
+ assertTrue(readCount1 > readCount0);
+ userPortalConfigSer_.getPageNavigation("portal", "test");
+ long readCount2 = cache.getReadCount();
+ assertEquals(readCount1, readCount2);
+ }
+ }.execute(null);
+ }
+
private abstract class UnitTest
{
@@ -744,6 +803,10 @@
failure = e;
}
+ // Clear cache
+ DataCache cache = mopStorage.getDecorator(DataCache.class);
+ cache.clear();
+
//
mopSession = mgr.openSession();
if (failure == null)
15 years, 2 months