Author: julien(a)jboss.com
Date: 2007-03-16 22:37:08 -0400 (Fri, 16 Mar 2007)
New Revision: 6720
Added:
trunk/build/ide/intellij/idea60/modules/portlet-server/
trunk/build/ide/intellij/idea60/modules/portlet-server/portlet-server.iml
trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverRegistry.java
trunk/portlet-server/
trunk/portlet-server/.cvsignore
trunk/portlet-server/build.bat
trunk/portlet-server/build.sh
trunk/portlet-server/build.xml
trunk/portlet-server/src/
trunk/portlet-server/src/main/
trunk/portlet-server/src/main/org/
trunk/portlet-server/src/main/org/jboss/
trunk/portlet-server/src/main/org/jboss/portal/
trunk/portlet-server/src/main/org/jboss/portal/portlet/
trunk/portlet-server/src/main/org/jboss/portal/portlet/aspects/
trunk/portlet-server/src/main/org/jboss/portal/portlet/aspects/portlet/
trunk/portlet-server/src/main/org/jboss/portal/portlet/aspects/portlet/ContextTrackerInterceptor.java
trunk/portlet-server/src/main/org/jboss/portal/portlet/container/
trunk/portlet-server/src/main/org/jboss/portal/portlet/container/runtime/
trunk/portlet-server/src/main/org/jboss/portal/portlet/container/runtime/PortletRuntimeContextImpl.java
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletContainerAdapter.java
trunk/portlet-server/src/main/org/jboss/portal/portlet/impl/
trunk/portlet-server/src/main/org/jboss/portal/portlet/impl/security/
trunk/portlet-server/src/main/org/jboss/portal/portlet/impl/security/JBossPortletSecurityService.java
trunk/portlet-server/src/main/org/jboss/portal/portlet/security/
trunk/portlet-server/src/main/org/jboss/portal/portlet/security/PortletPermission.java
trunk/portlet-server/src/main/org/jboss/portal/portlet/security/PortletSecurityService.java
trunk/portlet-server/src/main/org/jboss/portal/portlet/tck/
trunk/portlet-server/src/main/org/jboss/portal/portlet/tck/TCKPortletController.java
trunk/portlet-server/src/main/org/jboss/portal/portlet/test/
trunk/portlet-server/src/main/org/jboss/portal/portlet/test/PortletController.java
trunk/portlet-server/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java
trunk/portlet-server/src/resources/
trunk/portlet-server/src/resources/tck-sar/
trunk/portlet-server/src/resources/tck-sar/META-INF/
trunk/portlet-server/src/resources/tck-sar/META-INF/jboss-service.xml
trunk/portlet-server/src/resources/tck-sar/conf/
trunk/portlet-server/src/resources/tck-sar/conf/config.xml
trunk/portlet-server/src/resources/test-sar/
trunk/portlet-server/src/resources/test-sar/META-INF/
trunk/portlet-server/src/resources/test-sar/META-INF/jboss-service.xml
trunk/portlet-server/src/resources/test-sar/conf/
trunk/portlet-server/src/resources/test-sar/conf/config.xml
trunk/portlet-server/src/resources/test-war/
trunk/portlet-server/src/resources/test-war/WEB-INF/
trunk/portlet-server/src/resources/test-war/WEB-INF/classes/
trunk/portlet-server/src/resources/test-war/WEB-INF/classes/roles.properties
trunk/portlet-server/src/resources/test-war/WEB-INF/classes/users.properties
trunk/portlet-server/src/resources/test-war/WEB-INF/jboss-web.xml
trunk/portlet-server/src/resources/test-war/WEB-INF/web.xml
trunk/portlet-server/src/resources/test/
trunk/portlet-server/src/resources/test/info/
trunk/portlet-server/src/resources/test/info/test-info-sar/
trunk/portlet-server/src/resources/test/info/test-info-sar/META-INF/
trunk/portlet-server/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml
trunk/portlet/src/main/org/jboss/portal/portlet/container/runtime/
trunk/portlet/src/main/org/jboss/portal/portlet/container/runtime/PortletRuntimeContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/container/runtime/RequestDispatchCallback.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/ContentTypesTestCase.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/AbstractTestDriverServer.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestCase.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriver.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverService.java
trunk/test/src/main/org/jboss/portal/test/framework/runner/ServerTestRunner.java
Removed:
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextTrackerInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletContainerAdapter.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/security/JBossPortletSecurityService.java
trunk/portlet/src/main/org/jboss/portal/portlet/security/PortletPermission.java
trunk/portlet/src/main/org/jboss/portal/portlet/security/PortletSecurityService.java
trunk/portlet/src/main/org/jboss/portal/portlet/tck/TCKPortletController.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java
trunk/portlet/src/main/org/jboss/portal/test/server/ContentTypesTestCase.java
trunk/portlet/src/resources/samples-war/WEB-INF/classes/Portlet6_en.properties
trunk/portlet/src/resources/samples-war/WEB-INF/classes/Portlet6_fr.properties
trunk/portlet/src/resources/samples-war/WEB-INF/portlet.xml
trunk/portlet/src/resources/samples-war/WEB-INF/web.xml
trunk/portlet/src/resources/samples-war/test.jsp
trunk/portlet/src/resources/tck-sar/META-INF/jboss-service.xml
trunk/portlet/src/resources/tck-sar/conf/config.xml
trunk/portlet/src/resources/test-sar/META-INF/jboss-service.xml
trunk/portlet/src/resources/test-sar/conf/config.xml
trunk/portlet/src/resources/test-war/WEB-INF/classes/roles.properties
trunk/portlet/src/resources/test-war/WEB-INF/classes/users.properties
trunk/portlet/src/resources/test-war/WEB-INF/jboss-web.xml
trunk/portlet/src/resources/test-war/WEB-INF/web.xml
trunk/portlet/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/HttpTestDriverRegistry.java
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/HttpTestDriverRegistryService.java
trunk/server/src/main/org/jboss/portal/test/framework/server/runner/ServerTestRunner.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/AbstractHttpTestDriverServerService.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverServer.java
Modified:
trunk/build/build.xml
trunk/build/ide/intellij/idea60/modules/common/common.iml
trunk/build/ide/intellij/idea60/modules/portlet/portlet.iml
trunk/core/build.xml
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletContextFactory.java
trunk/core/src/main/org/jboss/portal/core/model/portal/portlet/PortalContextImpl.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFPortalContext.java
trunk/jems/src/main/org/jboss/portal/jems/as/system/JBossServiceModelMBean.java
trunk/portlet/build.xml
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistryImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/JBossApplicationMetaDataFactory.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortalContextImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortalContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortalContext.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/SequenceRegistry.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/AbstractInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CacheInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/ModeInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PortletInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SecurityInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SessionInfoTest.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionRequestTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionResponseTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortalContextTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletConfigTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletContextTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletModeTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletPreferencesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionUtilTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletURLTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderRequestTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderResponseTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/WindowStateTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/DispatcherTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/ExpiringCacheTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NeverExpiringCacheTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NoCacheTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletConfigTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletModeTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletRequestsTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletResponsesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PreferencesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/SessionTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/Log4jTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/DispatcherTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletConfigTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletContextTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletInterfaceTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletModeTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletRequestsTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletResponsesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletSessionTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletURLTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PreferencesTestCase.java
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/WindowStatesTestCase.java
trunk/server/src/main/org/jboss/portal/server/aspects/server/SessionInvalidatorInterceptor.java
trunk/server/src/main/org/jboss/portal/server/servlet/CommandServlet.java
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/AbstractTest.java
trunk/server/src/main/org/jboss/portal/test/server/CharsetTestCase.java
trunk/server/src/main/org/jboss/portal/test/server/ParametersTestCase.java
trunk/server/src/main/org/jboss/portal/test/server/ResponseTestCase.java
trunk/server/src/main/org/jboss/portal/test/server/ServletTestCase.java
trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java
trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml
trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml
trunk/server/src/resources/test/test-response-sar/META-INF/jboss-service.xml
trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverClient.java
trunk/tools/etc/buildfragments/modules.ent
trunk/wsrp/build.xml
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPBaseTest.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/PortletManagementTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestRunner.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
Log:
splitted portlet into independent module + module impl based on server
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2007-03-16 22:18:56 UTC (rev 6719)
+++ trunk/build/build.xml 2007-03-17 02:37:08 UTC (rev 6720)
@@ -120,6 +120,7 @@
<module name="server"/>
<module name="identity"/>
<module name="portlet"/>
+ <module name="portlet-server"/>
<module name="portlet-federation"/>
<module name="theme"/>
<module name="bridge"/>
@@ -141,7 +142,7 @@
<group name="portal">
<include
- modules="common, test, api, jems, server, security, identity, search,
format, portlet, bridge, faces, portlet-federation, theme, workflow, cms, samples,
registration, wsrp, core, core-admin, core-cms, core-management, core-samples"/>
+ modules="common, test, api, jems, server, security, identity, search,
format, portlet, portlet-server, bridge, faces, portlet-federation, theme, workflow, cms,
samples, registration, wsrp, core, core-admin, core-cms, core-management,
core-samples"/>
</group>
<group name="cms">
Modified: trunk/build/ide/intellij/idea60/modules/common/common.iml
===================================================================
--- trunk/build/ide/intellij/idea60/modules/common/common.iml 2007-03-16 22:18:56 UTC (rev
6719)
+++ trunk/build/ide/intellij/idea60/modules/common/common.iml 2007-03-17 02:37:08 UTC (rev
6720)
@@ -147,6 +147,15 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet/lib/servlet-api.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
Modified: trunk/build/ide/intellij/idea60/modules/portlet/portlet.iml
===================================================================
--- trunk/build/ide/intellij/idea60/modules/portlet/portlet.iml 2007-03-16 22:18:56 UTC
(rev 6719)
+++ trunk/build/ide/intellij/idea60/modules/portlet/portlet.iml 2007-03-17 02:37:08 UTC
(rev 6720)
@@ -10,7 +10,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="server" />
<orderEntry type="module-library">
<library>
<CLASSES>
Added: trunk/build/ide/intellij/idea60/modules/portlet-server/portlet-server.iml
===================================================================
--- trunk/build/ide/intellij/idea60/modules/portlet-server/portlet-server.iml
(rev 0)
+++ trunk/build/ide/intellij/idea60/modules/portlet-server/portlet-server.iml 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true"
type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager"
inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$/../../../../../../portlet-server">
+ <sourceFolder
url="file://$MODULE_DIR$/../../../../../../portlet-server/src/main"
isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="portlet" />
+ <orderEntry type="module" module-name="server" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet/lib/servlet-api.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module" module-name="security" />
+ <orderEntry type="module" module-name="api" />
+ <orderEntry type="module" module-name="common" />
+ <orderEntryProperties />
+ </component>
+</module>
+
Added: trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverRegistry.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverRegistry.java
(rev 0)
+++
trunk/common/src/main/org/jboss/portal/common/test/driver/TestDriverRegistry.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -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.jboss.portal.common.test.driver;
+
+/**
+ * Provides an interface for a test driver registry.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface TestDriverRegistry
+{
+ /**
+ * Register a driver.
+ *
+ * @param driver
+ * @throws IllegalArgumentException if the driver is null or already registered
+ */
+ void register(TestDriver driver) throws IllegalArgumentException;
+
+ /**
+ * Unregister a driver.
+ *
+ * @param driver
+ * @throws IllegalArgumentException if the driver is null or does not exist
+ */
+ void unregister(TestDriver driver) throws IllegalArgumentException;
+
+ /**
+ * Return a driver that is able to understand the specified id.
+ *
+ * @param itemId
+ * @return
+ * @throws IllegalArgumentException
+ */
+ TestDriver getDriver(String itemId) throws IllegalArgumentException;
+}
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2007-03-16 22:18:56 UTC (rev 6719)
+++ trunk/core/build.xml 2007-03-17 02:37:08 UTC (rev 6720)
@@ -124,6 +124,7 @@
<path refid="jboss.portal-server.classpath"/>
<path refid="jboss.portal-registration.classpath"/>
<path refid="jboss.portal-portlet.classpath"/>
+ <path refid="jboss.portal-portlet-server.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
<path refid="jboss.portal-portlet-federation.classpath"/>
<path refid="jboss.portal-identity.classpath"/>
@@ -229,6 +230,7 @@
<path refid="jboss.portal-common.classpath"/>
<path refid="jboss.portal-server.classpath"/>
<path refid="jboss.portal-portlet.classpath"/>
+ <path refid="jboss.portal-portlet-server.classpath"/>
<path refid="jboss.portal-identity.classpath"/>
<path refid="jboss.portal-security.classpath"/>
<path refid="jboss.portlet-api.classpath"/>
@@ -319,6 +321,7 @@
<fileset dir="${jboss.portal-bridge.root}/lib"
includes="portal-bridge-lib.jar"/>
<fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-lib.jar"/>
<fileset dir="${jboss.portal-portlet.root}/lib"
includes="portal-portlet-lib.jar"/>
+ <fileset dir="${jboss.portal-portlet-server.root}/lib"
includes="portal-portlet-server-lib.jar"/>
<fileset dir="${jboss.portal-jems.root}/lib"
includes="portal-jems-lib.jar"/>
<fileset dir="${jboss.portal-portlet-federation.root}/lib"
includes="portal-portlet-federation-lib.jar"/>
<fileset dir="${jboss.portlet-api.root}/lib"
includes="portlet-api-lib.jar"/>
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletContextFactory.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletContextFactory.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletContextFactory.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -35,6 +35,7 @@
import org.jboss.portal.common.util.CollectionBuilder;
import org.jboss.portal.WindowState;
import org.jboss.portal.Mode;
+import org.jboss.portal.server.PortalConstants;
import java.util.Set;
import java.util.Map;
@@ -127,6 +128,11 @@
props = Collections.EMPTY_MAP;
}
+ public String getInfo()
+ {
+ return PortalConstants.VERSION.toString();
+ }
+
public Set getWindowStates()
{
return windowStates;
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/portlet/PortalContextImpl.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/portlet/PortalContextImpl.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/portlet/PortalContextImpl.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -24,6 +24,7 @@
import org.jboss.portal.portlet.spi.PortalContext;
import org.jboss.portal.core.model.portal.Portal;
+import org.jboss.portal.server.PortalConstants;
import java.util.Map;
import java.util.Set;
@@ -47,6 +48,11 @@
this.portal = portal;
}
+ public String getInfo()
+ {
+ return PortalConstants.VERSION.toString();
+ }
+
public Set getWindowStates()
{
return portal.getSupportedWindowStates();
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-03-17
02:37:08 UTC (rev 6720)
@@ -34,6 +34,7 @@
<attribute name="ConfigLocation">conf/config.xml</attribute>
</mbean>
+ <!-- DTD repository -->
<mbean
code="org.jboss.portal.server.impl.xml.EntityResolverService"
name="portal:service=EntityResolver"
@@ -50,6 +51,15 @@
</attribute>
</mbean>
+ <!-- Runtime context for running portlet container -->
+ <mbean
+
code="org.jboss.portal.portlet.container.runtime.PortletRuntimeContextImpl"
+ name="portal:service=PortletRuntimeContext"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
<!-- Portal security services-->
<mbean
code="org.jboss.portal.security.impl.JBossAuthorizationDomainRegistryImpl"
@@ -256,6 +266,9 @@
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
+ <depends
+ optional-attribute-name="RuntimeContext"
+
proxy-type="attribute">portal:service=PortletRuntimeContext</depends>
</mbean>
<mbean
code="org.jboss.portal.portlet.aspects.portlet.PortletSessionSynchronizationInterceptor"
@@ -779,6 +792,9 @@
<depends
optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends
+ optional-attribute-name="RuntimeContext"
+
proxy-type="attribute">portal:service=PortletRuntimeContext</depends>
</mbean>
<!-- The producer portlet invoker -->
Modified:
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFPortalContext.java
===================================================================
---
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFPortalContext.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/faces/src/main/org/jboss/portal/faces/component/portlet/JSFPortalContext.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -65,6 +65,11 @@
this.portlet = portlet;
}
+ public String getInfo()
+ {
+ return "JSF/1.0";
+ }
+
public Set getWindowStates()
{
if (windowStates == null)
Modified: trunk/jems/src/main/org/jboss/portal/jems/as/system/JBossServiceModelMBean.java
===================================================================
---
trunk/jems/src/main/org/jboss/portal/jems/as/system/JBossServiceModelMBean.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/jems/src/main/org/jboss/portal/jems/as/system/JBossServiceModelMBean.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -260,7 +260,7 @@
for (Iterator i = attributeContextMap.values().iterator();i.hasNext();)
{
InvocationContext ctx = (InvocationContext)i.next();
- if ("State".equals(ctx.getName()) && !getStateExists)
+ if ("State".equals(ctx.getName()))
{
ctx.setDispatcher(new AbstractInterceptor()
{
@@ -270,7 +270,7 @@
}
});
}
- else if ("StateString".equals(ctx.getName()) &&
!getStateStringExists)
+ else if ("StateString".equals(ctx.getName()))
{
ctx.setDispatcher(new AbstractInterceptor()
{
@@ -280,7 +280,7 @@
}
});
}
- else if ("ManagedResource".equals(ctx.getName()) &&
!getManagedResourceExists)
+ else if ("ManagedResource".equals(ctx.getName()))
{
ctx.setDispatcher(new AbstractInterceptor()
{
@@ -296,7 +296,7 @@
for (Iterator i = operationContextMap.values().iterator();i.hasNext();)
{
InvocationContext ctx = (InvocationContext)i.next();
- if ("create".equals(ctx.getName()) && !createExists)
+ if ("create".equals(ctx.getName()))
{
ctx.setDispatcher(new AbstractInterceptor()
{
@@ -307,7 +307,7 @@
}
});
}
- else if ("start".equals(ctx.getName()) && !startExists)
+ else if ("start".equals(ctx.getName()))
{
ctx.setDispatcher(new AbstractInterceptor()
{
@@ -318,7 +318,7 @@
}
});
}
- else if ("stop".equals(ctx.getName()) && !stopExists)
+ else if ("stop".equals(ctx.getName()))
{
ctx.setDispatcher(new AbstractInterceptor()
{
@@ -329,7 +329,7 @@
}
});
}
- else if ("destroy".equals(ctx.getName()) && !destroyExists)
+ else if ("destroy".equals(ctx.getName()))
{
ctx.setDispatcher(new AbstractInterceptor()
{
@@ -340,7 +340,7 @@
}
});
}
- else if ("getState".equals(ctx.getName()) && !getStateExists)
+ else if ("getState".equals(ctx.getName()))
{
ctx.setDispatcher(new AbstractInterceptor()
{
@@ -350,7 +350,7 @@
}
});
}
- else if ("getStateString".equals(ctx.getName()) &&
!getStateExists)
+ else if ("getStateString".equals(ctx.getName()))
{
ctx.setDispatcher(new AbstractInterceptor()
{
@@ -360,7 +360,7 @@
}
});
}
- else if ("getManagedResource".equals(ctx.getName()) &&
!getManagedResourceExists)
+ else if ("getManagedResource".equals(ctx.getName()))
{
ctx.setDispatcher(new AbstractInterceptor()
{
Modified: trunk/portlet/build.xml
===================================================================
--- trunk/portlet/build.xml 2007-03-16 22:18:56 UTC (rev 6719)
+++ trunk/portlet/build.xml 2007-03-17 02:37:08 UTC (rev 6720)
@@ -109,9 +109,6 @@
<call target="configure-modules"/>
<path id="dependentmodule.classpath">
<path refid="jboss.portal-common.classpath"/>
- <path refid="jboss.portal-jems.classpath"/>
- <path refid="jboss.portal-security.classpath"/>
- <path refid="jboss.portal-server.classpath"/>
<path refid="jboss.portlet-api.classpath"/>
<path refid="jboss.portal-test.classpath"/>
</path>
@@ -190,7 +187,6 @@
<jar jarfile="${build.lib}/portal-portlet-lib.jar">
<fileset dir="${build.classes}">
<exclude name="org/jboss/portal/test/**"/>
- <exclude name="org/jboss/portal/portlet/tck/**"/>
</fileset>
</jar>
@@ -198,24 +194,6 @@
<jar jarfile="${build.lib}/portal-portlet-test-framework-lib.jar">
<fileset dir="${build.classes}"
includes="org/jboss/portal/test/framework/portlet/**"/>
</jar>
-
- <!-- Portlet tck lib jar -->
- <jar jarfile="${build.lib}/portal-portlet-tck-lib.jar">
- <fileset dir="${build.classes}"
includes="org/jboss/portal/portlet/tck/**"/>
- </jar>
-
- <!-- TCK sar -->
- <copy todir="${build.resources}/tck-sar">
- <fileset dir="${jboss.portal-common.root}/lib"
includes="portal-common-lib.jar"/>
- <fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-lib.jar"/>
- <fileset dir="${jboss.portlet-api.root}/lib"
includes="portlet-api-lib.jar"/>
- <fileset dir="${jboss.portlet-api.root}/lib"
includes="portal-api-lib.jar"/>
- <fileset dir="${jboss.portal-security.root}/lib"
includes="portal-security-lib.jar"/>
- <fileset dir="${build.lib}"
includes="portal-portlet-lib.jar,portal-portlet-tck-lib.jar,test.war"/>
- </copy>
- <jar jarfile="${build.lib}/tck.sar">
- <fileset dir="${build.resources}/tck-sar"/>
- </jar>
</target>
<macrodef name="package-misc-test">
@@ -281,66 +259,16 @@
<!-- create artifacts for running the portlet tests (except TCK) target output
should have already been executed -->
<target name="package-tests" depends="init">
- <!-- TCK sar -->
- <copy todir="${build.resources}/tck-sar">
- <fileset dir="${jboss.portal-common.root}/lib"
includes="portal-common-lib.jar"/>
- <fileset dir="${jboss.portal-jems.root}/lib"
includes="portal-jems-lib.jar"/>
- <fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-lib.jar"/>
- <fileset dir="${jboss.portlet-api.root}/lib"
includes="portlet-api-lib.jar"/>
- <fileset dir="${jboss.portlet-api.root}/lib"
includes="portal-api-lib.jar"/>
- <fileset dir="${jboss.portal-security.root}/lib"
includes="portal-security-lib.jar"/>
- <fileset dir="${build.lib}"
includes="portal-portlet-lib.jar,portal-portlet-tck-lib.jar,test.war"/>
- </copy>
- <jar jarfile="${build.lib}/tck.sar">
- <fileset dir="${build.resources}/tck-sar"/>
- </jar>
- <copy todir="${build.resources}/samples-war/WEB-INF/classes">
- <fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/*.class"/>
- </copy>
- <jar jarfile="${build.lib}/samples.war">
- <fileset dir="${build.resources}/samples-war"/>
+ <!-- -->
+ <jar jarfile="${build.lib}/test-info.jar">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/info/**"/>
</jar>
- <jar jarfile="${build.lib}/test.war">
- <fileset dir="${build.resources}/test-war"/>
- </jar>
- <copy todir="${build.resources}/test-sar">
- <fileset dir="${jboss.portal-common.root}/lib"
includes="portal-common-lib.jar"/>
- <fileset dir="${jboss.portal-test.lib}"
includes="portal-test-lib.jar"/>
- <fileset dir="${jboss.portal-jems.root}/lib"
includes="portal-jems-lib.jar"/>
- <fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-lib.jar"/>
- <fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-test-framework-lib.jar"/>
- <fileset dir="${jboss.portal-security.root}/lib"
includes="portal-security-lib.jar"/>
- <fileset dir="${jboss.portlet-api.root}/lib"
includes="portlet-api-lib.jar"/>
- <fileset dir="${jboss.portlet-api.root}/lib"
includes="portal-api-lib.jar"/>
- <fileset dir="${junit.junit.lib}"
includes="junit.jar"/>
- <fileset dir="${build.lib}"
includes="portal-portlet-lib.jar"/>
- <fileset dir="${build.lib}"
includes="portal-portlet-test-framework-lib.jar"/>
- <fileset dir="${build.lib}" includes="test.war"/>
- </copy>
- <jar jarfile="${build.lib}/test.sar">
- <fileset dir="${build.resources}/test-sar"/>
- </jar>
<jar jarfile="${build.lib}/test-info.war">
<fileset dir="${build.resources}/test/info/test-info-war"/>
</jar>
- <jar jarfile="${build.lib}/test-info.sar">
- <fileset dir="${junit.junit.lib}"
includes="junit.jar"/>
- <fileset dir="${jboss.portal-test.root}/lib"
includes="portal-test-lib.jar"/>
- <fileset dir="${jboss.portal-common.root}/lib"
includes="portal-common-lib.jar"/>
- <fileset dir="${jboss.portal-jems.root}/lib"
includes="portal-jems-lib.jar"/>
- <fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-lib.jar"/>
- <fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-test-lib.jar"/>
- <fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-test-framework-lib.jar"/>
- <fileset dir="${jboss.portlet-api.root}/lib"
includes="portlet-api-lib.jar"/>
- <fileset dir="${jboss.portlet-api.root}/lib"
includes="portal-api-lib.jar"/>
- <fileset dir="${jboss.portal-security.root}/lib"
includes="portal-security-lib.jar"/>
- <fileset dir="${build.lib}"
includes="portal-portlet-lib.jar"/>
- <fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/info/**"/>
- <fileset dir="${jboss.portal-server.lib}"
includes="test-agent.war"/>
- <fileset dir="${build.resources}/test/info/test-info-sar"/>
- <fileset dir="${build.lib}"
includes="test-info.war"/>
- </jar>
+
+ <!-- -->
<jar jarfile="${build.lib}/test-ha-session.war">
<fileset dir="${build.resources}/test/ha/test-session-war"/>
<fileset dir="${build.classes}"
includes="org/jboss/portal/test/portlet/ha/session/**"/>
@@ -425,124 +353,10 @@
<!-- Deployment -->
<!-- ================================================================== -->
- <target name="deploy-tck"
- description="Deploy."
- depends="output">
- <require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <copy file="${build.lib}/tck.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"/>
- </target>
-
- <target name="undeploy-tck"
- description="Undeploy."
- depends="init">
- <require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <delete file="${jboss.home}/server/${portal.deploy.dir}/tck.sar"/>
- </target>
-
<target name="tests" depends="init,
_buildmagic:configure:deployment">
- <deploy file="${build.lib}/test.sar" config="default"/>
- <antcall target="test-jsr168"/>
- <undeploy file="${build.lib}/test.sar"
config="default"/>
- <antcall target="test-info"/>
<antcall target="test-framework"/>
</target>
- <target name="test-jsr168" depends="init">
- <execute-tests>
- <x-sysproperty>
- <sysproperty key="test.root"
value="${build.lib}"/>
- <sysproperty key="test.uri"
value="/test/redirect/"/>
-<!--
- <jvmarg value="-Xdebug"/>
- <jvmarg
value="-Xrunjdwp:transport=dt_socket,address=7878,server=y,suspend=y"/>
--->
- </x-sysproperty>
- <x-test>
-
- <!--Spec TCK Assertions tests-->
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.DispatcherTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletConfigTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletContextTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletInterfaceTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletModeTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletRequestsTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletResponsesTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletSessionTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletURLTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PreferencesTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.WindowStatesTestCase"/>
-
- <!--API Tests-->
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.ActionRequestTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.ActionResponseTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortalContextTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortletConfigTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortletContextTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortletModeTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortletPreferencesTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortletSessionTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortletSessionUtilTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortletURLTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.RenderRequestTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.RenderResponseTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.WindowStateTestCase"/>
-
- <!--Ext Tests-->
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.DispatcherTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.PortletConfigTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.PortletModeTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.PortletRequestsTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.PortletResponsesTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.PreferencesTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.SessionTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.ExpiringCacheTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.NeverExpiringCacheTestCase"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.NoCacheTestCase"/>
-
- <!--Misc Tests-->
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.misc.Log4jTestCase"/>
-
- </x-test>
- <x-classpath>
- <path refid="oswego.concurrent.classpath"/>
- <path refid="jboss.remoting.classpath"/>
- <path refid="jboss.microcontainer.classpath"/>
- <path refid="jboss.jbossxb.classpath"/>
- <path refid="apache.xerces.classpath"/>
- <pathelement location="${source.java}"/>
- <pathelement location="${build.classes}"/>
- <pathelement location="${build.resources}"/>
- <path refid="library.classpath"/>
- <path refid="dependentmodule.classpath"/>
- </x-classpath>
- </execute-tests>
- </target>
-
- <target name="test-info" depends="init">
- <execute-tests>
- <x-test>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.info.InfoTestCase"/>
- </x-test>
- <x-sysproperty>
- <sysproperty key="test.root"
value="${build.lib}"/>
- <sysproperty key="test.uri"
value="/test/redirect/"/>
- </x-sysproperty>
- <x-classpath>
- <path refid="oswego.concurrent.classpath"/>
- <path refid="jboss.remoting.classpath"/>
- <path refid="jboss.microcontainer.classpath"/>
- <path refid="jboss.jbossxb.classpath"/>
- <path refid="apache.xerces.classpath"/>
- <path refid="jbossas/core.libs.classpath"/>
- <pathelement location="${source.java}"/>
- <pathelement location="${build.classes}"/>
- <pathelement location="${build.resources}"/>
- <path refid="library.classpath"/>
- <path refid="dependentmodule.classpath"/>
- </x-classpath>
- </execute-tests>
- </target>
-
<target name="test-framework" depends="init">
<execute-tests>
<x-test>
@@ -583,92 +397,4 @@
</execute-tests>
</target>
- <target name="test-ha" depends="init">
- <execute-tests>
- <x-sysproperty>
-<!--
- <jvmarg value="-Xdebug"/>
- <jvmarg
value="-Xrunjdwp:transport=dt_socket,address=7878,server=y,suspend=y"/>
--->
- <sysproperty key="test.root"
value="${build.lib}"/>
- <sysproperty key="test.uri"
value="/test/redirect/"/>
- </x-sysproperty>
- <x-test>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.ha.session.SessionTestCase"/>
- </x-test>
- <x-classpath>
- <path refid="oswego.concurrent.classpath"/>
- <path refid="jboss.remoting.classpath"/>
- <path refid="jboss.microcontainer.classpath"/>
- <path refid="jboss.jbossxb.classpath"/>
- <path refid="apache.xerces.classpath"/>
- <path refid="jbossas/core.libs.classpath"/>
- <pathelement location="${source.java}"/>
- <pathelement location="${build.classes}"/>
- <pathelement location="${build.resources}"/>
- <path refid="library.classpath"/>
- <path refid="dependentmodule.classpath"/>
- </x-classpath>
- </execute-tests>
- </target>
-
- <target name="test2" depends="init">
- <execute-tests>
- <x-sysproperty>
-<!--
- <jvmarg value="-Xdebug"/>
- <jvmarg
value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>
--->
- <sysproperty key="test.root"
value="${build.lib}"/>
- <sysproperty key="test.uri"
value="/test/redirect/"/>
- </x-sysproperty>
- <x-test>
-
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.ha.session.SessionTestSuite"/>-->
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.info.InfoTestSuite"/>-->
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.session.SessionSynchronizationTestCase"/>-->
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.PortletRequestDecoderTestCase"/>-->
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.preferences.PreferencesTestSuite"/>
- <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.preferences.PreferencesTestSuite"/>-->
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.portletrequests.PortletRequestTestSuite"/>-->
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.dispatcher.DispatcherTestSuite"/>-->
-
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.info.InfoTestSuite"/>-->
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.deployment.UnmarshallerTestCase"/>-->
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.PortletRequestDecoderTestCase"/>-->
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.state.StatefulPortletInvokerTestCase"/>-->
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.portletrequests.PortletRequestTestSuite"/>-->
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.dispatcher.DispatcherTestSuite"/>-->
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.portletrequests.PortletRequestTestSuite"/>-->
-
- <!--test todir="${test.reports}"
name="org.jboss.portal.test.portlet.ParametersTestCase"/-->
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.state.StateConverterV0TestCase"/>-->
-
- </x-test>
- <x-classpath>
- <path refid="oswego.concurrent.classpath"/>
- <path refid="jboss.remoting.classpath"/>
- <path refid="jboss.microcontainer.classpath"/>
- <path refid="jboss.jbossxb.classpath"/>
- <path refid="apache.xerces.classpath"/>
- <path refid="jbossas/core.libs.classpath"/>
- <pathelement location="${source.java}"/>
- <pathelement location="${build.classes}"/>
- <pathelement location="${build.resources}"/>
- <path refid="library.classpath"/>
- <path refid="dependentmodule.classpath"/>
- </x-classpath>
- </execute-tests>
- </target>
-
- <target name="reports" depends="init">
- <mkdir dir="${build.reports}"/>
- <junitreport todir="${build.reports}">
- <fileset dir="${test.reports}">
- <include name="TEST-*.xml"/>
- </fileset>
- <report format="frames"
todir="${build.reports}/html"/>
- </junitreport>
- </target>
-
</project>
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -23,23 +23,17 @@
package org.jboss.portal.portlet.aspects.portlet;
import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.container.PortletApplication;
import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.runtime.PortletRuntimeContext;
+import org.jboss.portal.portlet.container.runtime.RequestDispatchCallback;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.RequestContext;
-import org.jboss.portal.server.servlet.CommandServlet;
-import org.jboss.portal.server.servlet.ServletCommand;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
/**
* This interceptor dispatch the call to the target web application.
@@ -50,110 +44,47 @@
public class ContextDispatcherInterceptor extends PortletInterceptor
{
+ /** . */
public static final String REQ_ATT_COMPONENT_INVOCATION =
"org.jboss.portal.attribute.component_invocation";
- private static final ThreadLocal localResponse = new ThreadLocal();
+ /** . */
+ private PortletRuntimeContext runtimeContext;
+ public PortletRuntimeContext getRuntimeContext()
+ {
+ return runtimeContext;
+ }
+
+ public void setRuntimeContext(PortletRuntimeContext runtimeContext)
+ {
+ this.runtimeContext = runtimeContext;
+ }
+
protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
{
PortletContainer container =
((ContainerPortletInfo)invocation.getInfo()).getContainer();
PortletApplication portletApplication = container.getApplication();
- ServletContext targetCtx = portletApplication.getContext().getServletContext();
- try
- {
- // Get command servlet and dispatch
- final RequestContext requestContext = invocation.getRequestContext();
- CommandServlet.Dispatcher dispatcher = new CommandServlet.Dispatcher()
- {
- public void include(RequestDispatcher rd) throws IOException,
ServletException
- {
- requestContext.include(rd);
- }
- };
-
- //
- ServletCommand cmd = new InvokeNextCommand(invocation);
- CommandServlet.include(dispatcher, cmd, targetCtx);
-
- // Rethrow any InvocationException
- Object response = localResponse.get();
-
- //
- if (response instanceof Exception)
- {
- throw(Exception)response;
- }
- else
- {
- return response;
- }
- }
- catch (IOException e)
- {
- throw new PortletInvokerException(e);
- }
- catch (ServletException e)
- {
- // Unwrap underlying exception if any
- Throwable t = e.getRootCause();
-
- //
- if (t instanceof Error)
- {
- // Rethrow any error
- throw(Error)t;
- }
- else if (t == null)
- {
- // If no nested exception use the servlet exception
- t = e;
- }
-
- //
- throw new PortletInvokerException(t);
- }
- finally
- {
- localResponse.set(null);
- }
+ RequestContext reqCtx = invocation.getRequestContext();
+ return runtimeContext.dispatch(reqCtx.getClientRequest(),
reqCtx.getClientResponse(), portletApplication, callback, invocation);
}
- public static class InvokeNextCommand implements ServletCommand
+ private static final RequestDispatchCallback callback = new RequestDispatchCallback()
{
-
- private PortletInvocation invocation;
-
- public InvokeNextCommand(PortletInvocation invocation)
+ public Object doCallback(HttpServletRequest req, HttpServletResponse resp, Object
handback) throws Exception
{
- this.invocation = invocation;
- }
+ PortletInvocation invocation = (PortletInvocation)handback;
- public PortletInvocation getInvocation()
- {
- return invocation;
- }
-
- public void execute(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException
- {
+ //
try
{
+
// Set dispatched request and response and invocation
invocation.setDispatchedRequest(req);
invocation.setDispatchedResponse(resp);
invocation.getDispatchedRequest().setAttribute(REQ_ATT_COMPONENT_INVOCATION,
invocation);
//
- try
- {
- PortletInvocationResponse response =
(PortletInvocationResponse)invocation.invokeNext();
-
- //
- localResponse.set(response);
- }
- catch (Exception e)
- {
- localResponse.set(e);
- }
+ return invocation.invokeNext();
}
finally
{
@@ -163,5 +94,5 @@
invocation.setDispatchedResponse(null);
}
}
- }
+ };
}
Deleted:
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextTrackerInterceptor.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextTrackerInterceptor.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextTrackerInterceptor.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,48 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.portlet.aspects.portlet;
-
-import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.portlet.invocation.PortletInterceptor;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-
-/**
- * This interceptor get the current webapp context path and adds it to the set of the
collected context path.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class ContextTrackerInterceptor extends PortletInterceptor
-{
- protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
- {
- //
- String contextPath =
(String)invocation.getDispatchedRequest().getAttribute("javax.servlet.include.context_path");
-
- // Add it to the request context path set
-
org.jboss.portal.server.aspects.server.SessionInvalidatorInterceptor.getSet().add(contextPath);
-
- // Invoke next command
- return invocation.invokeNext();
- }
-}
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistryImpl.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistryImpl.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationRegistryImpl.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,8 +22,6 @@
******************************************************************************/
package org.jboss.portal.portlet.container;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -26,12 +26,12 @@
import org.jboss.portal.common.invocation.Invocation;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.common.invocation.InvocationHandler;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.container.runtime.PortletRuntimeContext;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPreferencesInfo;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPreferenceInfo;
@@ -55,7 +55,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class PortletContainerInvoker extends AbstractJBossService implements
PortletInvoker, PortletApplicationRegistryListener
+public class PortletContainerInvoker implements PortletInvoker,
PortletApplicationRegistryListener
{
/** . */
@@ -68,6 +68,9 @@
private Map portlets;
/** . */
+ private PortletRuntimeContext runtimeContext;
+
+ /** . */
private InvocationHandler handler = new InvocationHandler()
{
public Object invoke(Invocation invocation) throws Exception,
org.jboss.portal.common.invocation.InvocationException
@@ -87,6 +90,16 @@
}
};
+ public PortletRuntimeContext getRuntimeContext()
+ {
+ return runtimeContext;
+ }
+
+ public void setRuntimeContext(PortletRuntimeContext runtimeContext)
+ {
+ this.runtimeContext = runtimeContext;
+ }
+
public PortletApplicationRegistry getRegistry()
{
return registry;
@@ -127,7 +140,7 @@
this.portlets = portlets;
}
- protected synchronized void startService() throws Exception
+ public synchronized void start() throws Exception
{
Map portlets = new HashMap();
for (Iterator i = registry.getPortletApplications().iterator(); i.hasNext();)
@@ -148,7 +161,7 @@
registry.addListener(this);
}
- protected synchronized void stopService() throws Exception
+ public synchronized void stop() throws Exception
{
registry.removeListener(this);
Added:
trunk/portlet/src/main/org/jboss/portal/portlet/container/runtime/PortletRuntimeContext.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/container/runtime/PortletRuntimeContext.java
(rev 0)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/container/runtime/PortletRuntimeContext.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * 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.jboss.portal.portlet.container.runtime;
+
+import org.jboss.portal.portlet.container.PortletApplication;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface PortletRuntimeContext
+{
+ /**
+ * Generic detyped request dispatch to a portlet application.
+ *
+ * @param portletApplication
+ * @param callback the call back
+ * @return an object
+ * @throws Exception when needed
+ */
+ Object dispatch(
+ HttpServletRequest req,
+ HttpServletResponse resp,
+ PortletApplication portletApplication,
+ RequestDispatchCallback callback,
+ Object handback) throws Exception; // Callback maybe lol
+}
Added:
trunk/portlet/src/main/org/jboss/portal/portlet/container/runtime/RequestDispatchCallback.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/container/runtime/RequestDispatchCallback.java
(rev 0)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/container/runtime/RequestDispatchCallback.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * 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.jboss.portal.portlet.container.runtime;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface RequestDispatchCallback
+{
+ Object doCallback(HttpServletRequest req, HttpServletResponse resp, Object handback)
throws Exception;
+}
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/JBossApplicationMetaDataFactory.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/JBossApplicationMetaDataFactory.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/JBossApplicationMetaDataFactory.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -27,8 +27,6 @@
import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
import org.jboss.portal.portlet.metadata.PolicyPermissionMetaData;
-import org.jboss.portal.portlet.metadata.SecurityConstraintMetaData;
-import org.jboss.portal.security.SecurityConstants;
import org.jboss.xb.binding.GenericObjectModelFactory;
import org.jboss.xb.binding.UnmarshallingContext;
import org.xml.sax.Attributes;
@@ -67,20 +65,20 @@
return createJBossPortlet();
}
}
- else if (object instanceof JBossPortletMetaData)
- {
- if ("security-constraint".equals(localName))
- {
- return new SecurityConstraintMetaData();
- }
- }
- else if (object instanceof SecurityConstraintMetaData)
- {
- if ("policy-permission".equals(localName))
- {
- return new PolicyPermissionMetaData();
- }
- }
+// else if (object instanceof JBossPortletMetaData)
+// {
+// if ("security-constraint".equals(localName))
+// {
+// return new SecurityConstraintMetaData();
+// }
+// }
+// else if (object instanceof SecurityConstraintMetaData)
+// {
+// if ("policy-permission".equals(localName))
+// {
+// return new PolicyPermissionMetaData();
+// }
+// }
else if (object instanceof PolicyPermissionMetaData)
{
if ("unchecked".equals(localName))
@@ -103,39 +101,39 @@
portlet.merge(app);
}
}
- else if (parent instanceof JBossPortletMetaData)
- {
- JBossPortletMetaData portlet = (JBossPortletMetaData)parent;
- if (child instanceof SecurityConstraintMetaData)
- {
- portlet.setSecurityConstraint((SecurityConstraintMetaData)child);
- }
- }
- else if (parent instanceof SecurityConstraintMetaData)
- {
- SecurityConstraintMetaData securityConstraint =
(SecurityConstraintMetaData)parent;
- if (child instanceof PolicyPermissionMetaData)
- {
- PolicyPermissionMetaData policyPermission = (PolicyPermissionMetaData)child;
- PolicyPermissionMetaData other =
(PolicyPermissionMetaData)securityConstraint.getPolicyPermissions().get(policyPermission.getRoleName());
- if (other != null)
- {
- other.getActions().addAll(policyPermission.getActions());
- }
- else
- {
-
securityConstraint.getPolicyPermissions().put(policyPermission.getRoleName(),
policyPermission);
- }
- }
- }
- else if (parent instanceof PolicyPermissionMetaData)
- {
- PolicyPermissionMetaData policyPermission = (PolicyPermissionMetaData)parent;
- if ("unchecked".equals(child))
- {
- policyPermission.setRoleName(SecurityConstants.UNCHECKED_ROLE_NAME);
- }
- }
+// else if (parent instanceof JBossPortletMetaData)
+// {
+// JBossPortletMetaData portlet = (JBossPortletMetaData)parent;
+// if (child instanceof SecurityConstraintMetaData)
+// {
+// portlet.setSecurityConstraint((SecurityConstraintMetaData)child);
+// }
+// }
+// else if (parent instanceof SecurityConstraintMetaData)
+// {
+// SecurityConstraintMetaData securityConstraint =
(SecurityConstraintMetaData)parent;
+// if (child instanceof PolicyPermissionMetaData)
+// {
+// PolicyPermissionMetaData policyPermission =
(PolicyPermissionMetaData)child;
+// PolicyPermissionMetaData other =
(PolicyPermissionMetaData)securityConstraint.getPolicyPermissions().get(policyPermission.getRoleName());
+// if (other != null)
+// {
+// other.getActions().addAll(policyPermission.getActions());
+// }
+// else
+// {
+//
securityConstraint.getPolicyPermissions().put(policyPermission.getRoleName(),
policyPermission);
+// }
+// }
+// }
+// else if (parent instanceof PolicyPermissionMetaData)
+// {
+// PolicyPermissionMetaData policyPermission = (PolicyPermissionMetaData)parent;
+// if ("unchecked".equals(child))
+// {
+// policyPermission.setRoleName(SecurityConstants.UNCHECKED_ROLE_NAME);
+// }
+// }
}
public void setValue(Object object, UnmarshallingContext nav, String nsURI, String
localName, String value)
Deleted:
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,398 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.portlet.deployment.jboss;
-
-import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
-import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData;
-import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData;
-import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData;
-import org.jboss.beans.metadata.plugins.AbstractParameterMetaData;
-import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData;
-import org.jboss.deployment.DeploymentException;
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.common.xml.NullEntityResolver;
-import org.jboss.portal.portlet.container.PortletApplicationContextImpl;
-import org.jboss.portal.portlet.container.PortletApplicationRegistry;
-import org.jboss.portal.portlet.deployment.JBossApplicationMetaDataFactory;
-import org.jboss.portal.portlet.deployment.PortletApplicationMetaDataFactory;
-import org.jboss.portal.portlet.deployment.ValueTrimmingFilter;
-import org.jboss.portal.portlet.impl.jsr168.APIFactory;
-import org.jboss.portal.portlet.impl.jsr168.metadata.PortletApplicationMetaData;
-import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
-import org.jboss.portal.portlet.deployment.jboss.PortletContainerAdapter;
-import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
-import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
-import org.jboss.portal.portlet.metadata.PolicyPermissionMetaData;
-import org.jboss.portal.portlet.metadata.SecurityConstraintMetaData;
-import org.jboss.portal.portlet.security.PortletSecurityService;
-import org.jboss.portal.security.RoleSecurityBinding;
-import org.jboss.portal.security.SecurityConstants;
-import org.jboss.portal.security.spi.provider.AuthorizationDomain;
-import org.jboss.portal.security.spi.provider.DomainConfigurator;
-import org.jboss.portal.security.spi.provider.SecurityConfigurationException;
-import org.jboss.portal.server.deployment.PortalWebApp;
-import org.jboss.portal.server.deployment.jboss.Deployment;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.xml.sax.EntityResolver;
-
-import javax.management.MBeanServer;
-import javax.servlet.ServletContext;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class PortletAppDeployment extends Deployment
-{
-
- /** The existing configurations. */
- protected Map configurations;
-
- /** . */
- protected PortletApplicationMetaData portletAppMD;
-
- /** . */
- protected JBossApplicationMetaData jbossAppMD;
-
- /** . */
- protected PortletAppDeploymentFactory factory;
-
- /** . */
- protected Kernel kernel;
-
- /** . */
- protected List beans;
-
- public PortletAppDeployment(URL url, PortalWebApp pwa, MBeanServer mbeanServer,
PortletAppDeploymentFactory factory)
- {
- super(url, pwa, mbeanServer);
- this.factory = factory;
- }
-
- public void create() throws DeploymentException
- {
- importTLD();
-
- //
- beans = new ArrayList();
-
- //
- try
- {
- BasicBootstrap bootstrap = new BasicBootstrap();
- bootstrap.run();
- kernel = bootstrap.getKernel();
- }
- catch (Exception e)
- {
- throw new DeploymentException(e);
- }
-
- //
- try
- {
- portletAppMD = buildPortletApplicationMetaData();
- jbossAppMD = buildJBossApplicationMetaData();
-
- // Merge or provide defaults
- JBossApplicationMetaData standardJBossAppMD =
factory.getStandardJBossApplicationMetaData();
- log.debug("Found standard jboss app meta data");
-
- if (standardJBossAppMD != null)
- {
- JBossPortletMetaData defaultJBossPortletMD =
(JBossPortletMetaData)standardJBossAppMD.getPortlets().get("DefaultPortlet");
- log.debug("Found default jboss portlet meta data");
- if (defaultJBossPortletMD != null)
- {
- for (Iterator i = portletAppMD.getPortlets().iterator(); i.hasNext();)
- {
- PortletMetaData portletMD = (PortletMetaData)i.next();
- String name = portletMD.getName();
- JBossPortletMetaData jbossPortletMD =
(JBossPortletMetaData)jbossAppMD.getPortlets().get(name);
- if (jbossPortletMD != null)
- {
- log.debug("Merging default jboss portlet meta data for " +
name);
-
- // Merge with app settings
- jbossPortletMD.merge(jbossAppMD); // todo: remove since it
shouldn't be needed anymore with the adding of merge in factory...
-
- // Merge with default portlet
- jbossPortletMD.merge(defaultJBossPortletMD);
- }
- else
- {
- log.debug("Using default jboss portlet meta data for " +
name);
- jbossAppMD.getPortlets().put(name, defaultJBossPortletMD.clone());
- }
- }
- }
- }
- }
- catch (Throwable e)
- {
- throw new DeploymentException("Cannot deploy portlet application",
e);
- }
- }
-
- public void start() throws DeploymentException
- {
- try
- {
- // Controller meta data
- AbstractBeanMetaData webAppBMD = new AbstractBeanMetaData(
- "portal:container=WebApp,id=" + portletAppMD.getId(),
- PortletApplicationContextImpl.class.getName());
-
- // Constructor
- AbstractConstructorMetaData webAppCMD = new AbstractConstructorMetaData();
- List webAppParamsCMD = new ArrayList();
- webAppParamsCMD.add(new
AbstractParameterMetaData(PortletApplicationRegistry.class.getName(),
factory.getWebAppRegistry()));
- webAppParamsCMD.add(new AbstractParameterMetaData(APIFactory.class.getName(),
factory.getAPIFactory()));
- webAppParamsCMD.add(new AbstractParameterMetaData(portletAppMD));
- webAppParamsCMD.add(new
AbstractParameterMetaData(JBossApplicationMetaData.class.getName(), jbossAppMD));
- webAppParamsCMD.add(new
AbstractParameterMetaData(ServletContext.class.getName(), pwa.getServletContext()));
- webAppParamsCMD.add(new AbstractParameterMetaData(ClassLoader.class.getName(),
pwa.getClassLoader()));
- webAppCMD.setParameters(webAppParamsCMD);
- webAppBMD.setConstructor(webAppCMD);
-
- // Installation
- beans.add(webAppBMD);
- kernel.getController().install(webAppBMD);
-
- // Install portlet containers
- for (Iterator i = portletAppMD.getPortlets().iterator(); i.hasNext();)
- {
- PortletMetaData portletMD = (PortletMetaData)i.next();
-
- // Get specific dd meta data
- JBossPortletMetaData jbossPortletMD =
(JBossPortletMetaData)jbossAppMD.getPortlets().get(portletMD.getName());
-
- // Controller meta data
- AbstractBeanMetaData containerBMD = new AbstractBeanMetaData(
- "portal:container=Portlet,id=" + portletAppMD.getId() +
"." + portletMD.getName(),
- PortletContainerAdapter.class.getName());
-
- // Constructor
- AbstractConstructorMetaData containerCMD = new
AbstractConstructorMetaData();
- List containerParamsCMD = new ArrayList();
- containerParamsCMD.add(new AbstractParameterMetaData(portletMD));
- containerParamsCMD.add(new
AbstractParameterMetaData(JBossPortletMetaData.class.getName(), jbossPortletMD));
- containerCMD.setParameters(containerParamsCMD);
- containerBMD.setConstructor(containerCMD);
-
- // Properties
- HashSet containerProps = new HashSet();
- containerProps.add(new
AbstractPropertyMetaData("portletWebAppAdapter", new
AbstractDependencyValueMetaData(webAppBMD.getName())));
- containerBMD.setProperties(containerProps);
-
- // Dependencies
- HashSet portletContainerDmds = new HashSet();
- portletContainerDmds.add(new
AbstractDependencyMetaData(webAppBMD.getName()));
- containerBMD.setDemands(portletContainerDmds);
-
- // Installation
- beans.add(containerBMD);
- kernel.getController().install(containerBMD);
- }
- }
- catch (Throwable e)
- {
- throw new DeploymentException("Cannot deploy portlet application",
e);
- }
-
- // Configure security
- PortletSecurityService portletSecurityService =
factory.getPortletSecurityService();
- if (portletSecurityService != null)
- {
- AuthorizationDomain authDomain =
portletSecurityService.getAuthorizationDomain();
- DomainConfigurator domainConfigurator = authDomain.getConfigurator();
-
- //
- for (Iterator i = jbossAppMD.getPortlets().values().iterator(); i.hasNext();)
- {
- JBossPortletMetaData portletMD = (JBossPortletMetaData)i.next();
- SecurityConstraintMetaData securityConstraintMD =
portletMD.getSecurityConstraint();
-
- //
- if (securityConstraintMD == null)
- {
- securityConstraintMD = new SecurityConstraintMetaData();
- PolicyPermissionMetaData policyPermission = new
PolicyPermissionMetaData();
- policyPermission.setRoleName(SecurityConstants.UNCHECKED_ROLE_NAME);
- policyPermission.getActions().add("view");
-
securityConstraintMD.getPolicyPermissions().put(SecurityConstants.UNCHECKED_ROLE_NAME,
policyPermission);
- }
-
- //
- Set bindings = new HashSet();
- for (Iterator j =
securityConstraintMD.getPolicyPermissions().values().iterator(); j.hasNext();)
- {
- PolicyPermissionMetaData policyPermissionMD =
(PolicyPermissionMetaData)j.next();
- RoleSecurityBinding binding = new
RoleSecurityBinding(policyPermissionMD.getActions(), policyPermissionMD.getRoleName());
- bindings.add(binding);
- }
-
- //
- try
- {
- String portletId = pwa.getId() + "." + portletMD.getName();
- domainConfigurator.setSecurityBindings(portletId, bindings);
- }
- catch (SecurityConfigurationException e)
- {
- log.error("Error in configuration", e);
- }
- }
- }
-
- //
- super.start();
- }
-
- public void stop() throws DeploymentException
- {
- PortletSecurityService portletSecurityService =
factory.getPortletSecurityService();
- if (portletSecurityService != null)
- {
- AuthorizationDomain authDomain =
portletSecurityService.getAuthorizationDomain();
- DomainConfigurator domainConfigurator = authDomain.getConfigurator();
- for (Iterator i = portletAppMD.getPortlets().iterator(); i.hasNext();)
- {
- PortletMetaData portletMD = (PortletMetaData)i.next();
-
- //
- try
- {
- String portletId = pwa.getId() + "." + portletMD.getName();
- domainConfigurator.removeSecurityBindings(portletId);
- }
- catch (SecurityConfigurationException e)
- {
- log.error("Error in configuration", e);
- }
- }
- }
-
- //
- super.stop();
- }
-
- public void destroy() throws DeploymentException
- {
- for (int i = beans.size() - 1; i >= 0; i--)
- {
- AbstractBeanMetaData bmd = (AbstractBeanMetaData)beans.get(i);
- kernel.getController().uninstall(bmd.getName());
- }
- }
-
- /** Import the portlet jsp tag TLD in the deployed application. */
- protected void importTLD()
- {
- InputStream sourceTLD = null;
- try
- {
- sourceTLD =
Tools.safeBufferedWrapper(Thread.currentThread().getContextClassLoader().getResourceAsStream("org/jboss/portal/portlet/portlet.tld"));
- pwa.importFile("/WEB-INF", "portlet.tld", sourceTLD,
false);
- }
- catch (IOException e)
- {
- log.warn("Cannot copy TLD file to the portlet application", e);
- }
- finally
- {
- Tools.safeClose(sourceTLD);
- }
- }
-
- protected PortletApplicationMetaData buildPortletApplicationMetaData() throws
Exception
- {
- InputStream in = null;
- try
- {
- in = Tools.safeBufferedWrapper(url.openStream());
- PortletApplicationMetaDataFactory factory = new
PortletApplicationMetaDataFactory();
- Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
- PortletApplicationMetaData portletAppMD =
(PortletApplicationMetaData)unmarshaller.unmarshal(in, new ValueTrimmingFilter(factory),
null);
- portletAppMD.setId(pwa.getId());
- return portletAppMD;
- }
- finally
- {
- Tools.safeClose(in);
- }
- }
-
- protected JBossApplicationMetaData buildJBossApplicationMetaData()
- {
- JBossApplicationMetaData jbossAppMD = new JBossApplicationMetaData();
- ServletContext servletContext = pwa.getServletContext();
- String contextPath = pwa.getContextPath();
- InputStream in = null;
- try
- {
- in =
Tools.safeBufferedWrapper(servletContext.getResourceAsStream("/WEB-INF/jboss-portlet.xml"));
- if (in != null)
- {
- log.debug("Parsing jboss-portlet.xml" + contextPath);
-
- //
- JBossApplicationMetaDataFactory factory =
this.factory.createJBossApplicationMetaDataFactory();
- Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
- EntityResolver entityResolver =
this.factory.getJBossPortletEntityResolver();
- if (entityResolver == null)
- {
- log.debug("Coult not obtain entity resolver for
jboss-portlet.xml");
- entityResolver = new NullEntityResolver();
- }
- else
- {
- log.debug("Obtained entity resolver " + entityResolver + "
for jboss-portlet.xml");
- }
- unmarshaller.setEntityResolver(entityResolver);
- jbossAppMD = (JBossApplicationMetaData)unmarshaller.unmarshal(in, new
ValueTrimmingFilter(factory), null);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- Tools.safeClose(in);
- }
- return jbossAppMD;
- }
-}
Deleted:
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,231 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.portlet.deployment.jboss;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.portlet.container.PortletApplicationRegistry;
-import org.jboss.portal.portlet.deployment.JBossApplicationMetaDataFactory;
-import org.jboss.portal.portlet.deployment.ValueTrimmingFilter;
-import org.jboss.portal.portlet.impl.jsr168.APIFactory;
-import org.jboss.portal.portlet.impl.jsr168.APIFactoryImpl;
-import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
-import org.jboss.portal.portlet.security.PortletSecurityService;
-import org.jboss.portal.server.config.ServerConfig;
-import org.jboss.portal.server.deployment.PortalWebApp;
-import org.jboss.portal.server.deployment.jboss.AbstractDeploymentFactory;
-import org.jboss.portal.server.deployment.jboss.Deployment;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-import org.xml.sax.EntityResolver;
-
-import javax.management.MBeanServer;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * todo : remove unused ConfigService
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class PortletAppDeploymentFactory extends AbstractDeploymentFactory
-{
-
- /** . */
- protected static final Pattern urlPattern =
Pattern.compile(".*/portlet\\.xml");
-
- /** . */
- protected PortletApplicationRegistry portletApplicationRegistry;
-
- /** . */
- protected ServerConfig config;
-
- /** . */
- protected String apiFactoryClassName;
-
- /** . */
- protected APIFactory apiFactory;
-
- /** . */
- protected PortletSecurityService portletSecurityService;
-
- /** . */
- protected String standardJBossApplicationMetaDataLocation;
-
- /** . */
- protected JBossApplicationMetaData standardJBossApplicationMetaData;
-
- /** . */
- protected EntityResolver jbossPortletEntityResolver;
-
- public EntityResolver getJBossPortletEntityResolver()
- {
- return jbossPortletEntityResolver;
- }
-
- public void setJBossPortletEntityResolver(EntityResolver jbossPortletEntityResolver)
- {
- this.jbossPortletEntityResolver = jbossPortletEntityResolver;
- }
-
- public ServerConfig getConfig()
- {
- return config;
- }
-
- public void setConfig(ServerConfig config)
- {
- this.config = config;
- }
-
- public String getAPIFactoryClassName()
- {
- return apiFactoryClassName;
- }
-
- public void setAPIFactoryClassName(String apiFactoryClassName)
- {
- this.apiFactoryClassName = apiFactoryClassName;
- }
-
- public PortletApplicationRegistry getWebAppRegistry()
- {
- return portletApplicationRegistry;
- }
-
- public void setWebAppRegistry(PortletApplicationRegistry portletApplicationRegistry)
- {
- this.portletApplicationRegistry = portletApplicationRegistry;
- }
-
- public String getStandardJBossApplicationMetaDataLocation()
- {
- return standardJBossApplicationMetaDataLocation;
- }
-
- public void setStandardJBossApplicationMetaDataLocation(String
standardJBossApplicationMetaDataLocation)
- {
- this.standardJBossApplicationMetaDataLocation =
standardJBossApplicationMetaDataLocation;
- }
-
- public JBossApplicationMetaData getStandardJBossApplicationMetaData()
- {
- return standardJBossApplicationMetaData;
- }
-
- public APIFactory getAPIFactory()
- {
- return apiFactory;
- }
-
- public boolean acceptFile(URL url)
- {
- String urlAsFile = url.getFile();
- Matcher matcher = urlPattern.matcher(urlAsFile);
- return matcher.matches();
- }
-
- public Deployment newInstance(URL url, PortalWebApp pwa, MBeanServer mbeanServer)
throws DeploymentException
- {
- return new PortletAppDeployment(url, pwa, mbeanServer, this);
- }
-
- public void start() throws Exception
- {
- //
- try
- {
- apiFactory = new APIFactoryImpl();
-
- // Try to load
- if (apiFactoryClassName != null)
- {
- Class apiFactoryClass =
Thread.currentThread().getContextClassLoader().loadClass(apiFactoryClassName);
- apiFactory = (APIFactory)apiFactoryClass.newInstance();
- }
- }
- catch (Exception e)
- {
- log.error("Cannot create portlet APIFactory=" + apiFactoryClassName +
" will use default one instead", e);
- }
-
- //
- loadStandardJBossApplicationMetaData();
-
- //
- super.start();
- }
-
- public void loadStandardJBossApplicationMetaData()
- {
- if (standardJBossApplicationMetaDataLocation != null)
- {
- InputStream in = null;
- try
- {
- in =
Tools.safeBufferedWrapper(Thread.currentThread().getContextClassLoader().getResourceAsStream(standardJBossApplicationMetaDataLocation));
- if (in != null)
- {
- JBossApplicationMetaDataFactory factory =
createJBossApplicationMetaDataFactory();
- Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
- standardJBossApplicationMetaData =
(JBossApplicationMetaData)unmarshaller.unmarshal(in, new ValueTrimmingFilter(factory),
null);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- Tools.safeClose(in);
- }
- }
- }
-
- public void stop()
- {
- super.stop();
-
- //
- apiFactory = null;
- }
-
- public PortletSecurityService getPortletSecurityService()
- {
- return portletSecurityService;
- }
-
- public void setPortletSecurityService(PortletSecurityService portletSecurityService)
- {
- this.portletSecurityService = portletSecurityService;
- }
-
- /** Subclasses can provide a subclass of JBossApplicationMetaDataFactory. */
- public JBossApplicationMetaDataFactory createJBossApplicationMetaDataFactory()
- {
- return new JBossApplicationMetaDataFactory();
- }
-}
Deleted:
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletContainerAdapter.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletContainerAdapter.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/deployment/jboss/PortletContainerAdapter.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,89 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.portlet.deployment.jboss;
-
-import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
-import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
-import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
-import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
-import org.jboss.portal.portlet.container.PortletApplicationContextImpl;
-import org.jboss.portal.portlet.container.PortletContainer;
-
-/**
- * Adapt the life cycle of micro container to the portlet container impl.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class PortletContainerAdapter
-{
-
- /** . */
- private PortletMetaData portletMD;
-
- /** . */
- private JBossPortletMetaData jbossPortletMD;
-
- /** . */
- private PortletApplicationContextImpl portletApplicationContext;
-
- /** . */
- private PortletContainerImpl portletContainer;
-
- public PortletContainerAdapter(PortletMetaData portletMD, JBossPortletMetaData
jbossPortletMD)
- {
- this.portletMD = portletMD;
- this.jbossPortletMD = jbossPortletMD;
- }
-
- public PortletApplicationContextImpl getPortletApplicationContext()
- {
- return portletApplicationContext;
- }
-
- public void setPortletWebAppAdapter(PortletApplicationContextImpl
portletApplicationContext)
- {
- this.portletApplicationContext = portletApplicationContext;
- }
-
- public PortletContainer getPortletContainer()
- {
- return portletContainer;
- }
-
- public void start() throws Exception
- {
- PortletApplicationImpl portletApp =
portletApplicationContext.getPortletApplication();
- portletContainer = new PortletContainerImpl(portletApp, portletMD,
jbossPortletMD);
- portletContainer.start();
- portletApp.addContainer(portletContainer);
- }
-
- public void stop()
- {
- PortletApplicationImpl portletApp =
portletApplicationContext.getPortletApplication();
- portletApp.removeContainer(portletContainer);
- portletContainer.stop();
- portletContainer = null;
- }
-}
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,8 +22,6 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
-import org.jboss.portal.portlet.impl.jsr168.APIFactory;
import org.jboss.portal.portlet.impl.jsr168.api.PortletContextImpl;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletApplicationMetaData;
import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
@@ -42,7 +40,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public class PortletApplicationImpl extends AbstractJBossService implements
PortletApplication
+public class PortletApplicationImpl implements PortletApplication
{
/** . */
@@ -135,27 +133,28 @@
//
- public void startService() throws Exception
+ public void create() throws Exception
{
- super.startService();
+ }
- //
+ public void start() throws Exception
+ {
version = metaData.getVersion();
portletModes = metaData.getPortletModes();
windowStates = metaData.getWindowStates();
portletContext = new PortletContextImpl(context.getServletContext());
}
- public void stopService() throws Exception
+ public void stop()
{
- //
version = null;
portletModes = null;
windowStates = null;
portletContext = null;
+ }
- //
- super.stopService();
+ public void destroy()
+ {
}
public String getVersion()
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortalContextImpl.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortalContextImpl.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortalContextImpl.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -26,7 +26,6 @@
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.portlet.spi.PortalContext;
import org.jboss.portal.portlet.impl.jsr168.PortletUtils;
-import org.jboss.portal.server.PortalConstants;
import java.util.Enumeration;
import java.util.HashSet;
@@ -60,7 +59,7 @@
public String getPortalInfo()
{
- return PortalConstants.VERSION.toString();
+ return portal.getInfo();
}
public String getProperty(String name)
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestDispatcherImpl.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -27,7 +27,6 @@
import org.jboss.portal.portlet.impl.jsr168.APIConstants;
import org.jboss.portal.portlet.impl.jsr168.DispatchedHttpServletRequest;
import org.jboss.portal.portlet.impl.jsr168.DispatchedHttpServletResponse;
-import org.jboss.portal.server.servlet.FilterCommand;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
Deleted:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/security/JBossPortletSecurityService.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/security/JBossPortletSecurityService.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/security/JBossPortletSecurityService.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,182 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.portlet.impl.security;
-
-import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
-import org.jboss.portal.portlet.security.PortletPermission;
-import org.jboss.portal.portlet.security.PortletSecurityService;
-import org.jboss.portal.security.PortalPermission;
-import org.jboss.portal.security.PortalPermissionCollection;
-import org.jboss.portal.security.PortalSecurityException;
-import org.jboss.portal.security.RoleSecurityBinding;
-import org.jboss.portal.security.SecurityConstants;
-import org.jboss.portal.security.impl.JBossAuthorizationDomainRegistry;
-import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
-import org.jboss.portal.security.spi.provider.AuthorizationDomain;
-import org.jboss.portal.security.spi.provider.DomainConfigurator;
-import org.jboss.portal.security.spi.provider.PermissionFactory;
-import org.jboss.portal.security.spi.provider.PermissionRepository;
-import org.jboss.portal.security.spi.provider.SecurityConfigurationException;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * Service that configures security for portlets.
- *
- * @author <a href="mailto:Anil.Saldhana@jboss.org">Anil
Saldhana</a>
- * @version $Revision$
- * @since Mar 17, 2006
- */
-public class JBossPortletSecurityService implements PortletSecurityService,
- AuthorizationDomain, DomainConfigurator, PermissionRepository, PermissionFactory
-{
-
- /** . */
- protected ConcurrentReaderHashMap securityConstraintsMap;
-
- /** . */
- protected PortalAuthorizationManagerFactory portalAuthorizationManagerFactory;
-
- /** . */
- protected JBossAuthorizationDomainRegistry authorizationDomainRegistry;
-
- public AuthorizationDomain getAuthorizationDomain()
- {
- return this;
- }
-
- //*************************************************************
- // AuthorizationDomain Interface Methods
- //*************************************************************
- public String getType()
- {
- return PortletPermission.PERMISSION_TYPE;
- }
-
- public DomainConfigurator getConfigurator()
- {
- return this;
- }
-
- public PermissionRepository getPermissionRepository()
- {
- return this;
- }
-
- public PermissionFactory getPermissionFactory()
- {
- return this;
- }
-
- public Set getSecurityBindings(String uri)
- {
- return (Set)securityConstraintsMap.get(uri);
- }
-
- public void setSecurityBindings(String uri, Set securityBindings) throws
SecurityConfigurationException
- {
- this.securityConstraintsMap.put(uri, securityBindings);
- }
-
- public void removeSecurityBindings(String uri) throws SecurityConfigurationException
- {
- this.securityConstraintsMap.remove(uri);
- }
-
- public PortalPermission getPermission(String roleName, String uri) throws
PortalSecurityException
- {
- Set set = getSecurityBindings(uri);
- if (set != null && !set.isEmpty())
- {
- for (Iterator i = set.iterator(); i.hasNext();)
- {
- RoleSecurityBinding sc = (RoleSecurityBinding)i.next();
- String constraintRoleName = sc.getRoleName();
- if (constraintRoleName.equals(roleName) ||
- SecurityConstants.UNCHECKED_ROLE_NAME.equals(constraintRoleName))
- {
- return createPermission(uri, sc.getActions());
- }
- }
- }
- return null;
- }
-
- public PortalPermission createPermissionContainer(PortalPermissionCollection
collection) throws PortalSecurityException
- {
- return new PortletPermission(collection);
- }
-
- public PortalPermission createPermission(String uri, String action) throws
PortalSecurityException
- {
- return new PortletPermission(uri, action);
- }
-
- public PortalPermission createPermission(String uri, Collection actions) throws
PortalSecurityException
- {
- return new PortletPermission(uri, actions);
- }
-
- public void create() throws Exception
- {
- this.securityConstraintsMap = new ConcurrentReaderHashMap();
- }
-
- public void start() throws Exception
- {
- // Add ourself as the authorization domain
- authorizationDomainRegistry.addDomain(this);
- }
-
- public void stop() throws Exception
- {
- authorizationDomainRegistry.removeDomain(this);
- }
-
- public void destroy()
- {
- securityConstraintsMap = null;
- }
-
- public JBossAuthorizationDomainRegistry getAuthorizationDomainRegistry()
- {
- return authorizationDomainRegistry;
- }
-
- public void setAuthorizationDomainRegistry(JBossAuthorizationDomainRegistry
authorizationDomainRegistry)
- {
- this.authorizationDomainRegistry = authorizationDomainRegistry;
- }
-
- public PortalAuthorizationManagerFactory getPortalAuthorizationManagerFactory()
- {
- return portalAuthorizationManagerFactory;
- }
-
- public void setPortalAuthorizationManagerFactory(PortalAuthorizationManagerFactory
portalAuthorizationManagerFactory)
- {
- this.portalAuthorizationManagerFactory = portalAuthorizationManagerFactory;
- }
-}
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -89,9 +89,4 @@
{
return getClientRequest().getServerPort();
}
-
- public void include(RequestDispatcher rd) throws IOException, ServletException
- {
- rd.include(getClientRequest(), getClientResponse());
- }
}
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/security/PortletPermission.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/security/PortletPermission.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/security/PortletPermission.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,242 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.portlet.security;
-
-import org.jboss.portal.security.PortalPermission;
-import org.jboss.portal.security.PortalPermissionCollection;
-import org.jboss.portal.security.PortalSecurityException;
-import org.jboss.portal.security.spi.provider.PermissionRepository;
-
-import javax.security.auth.Subject;
-import java.security.Permission;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-
-/**
- * The permission for instance.
- *
- * @author <a href="mailto:anil.saldhana@jboss.org">Anil
Saldhana</a>
- * @version $Revision$
- */
-public final class PortletPermission extends PortalPermission
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = 8445291296726152562L;
-
- /** The view action name. */
- public static final String VIEW_ACTION = "view";
-
- /** The view action name. */
-// public static final String INSTANTIATE_ACTION = "instantiate";
-
- /** The view action name. */
-// public static final String PERSONALIZE_ACTION = "personalize";
-
- /** . */
- public static final int VIEW_MASK = 0x01;
-
- /** . */
-// public static final int INSTANTIATE_MASK = 0x02;
-
- /** . */
-// public static final int PERSONALIZE_MASK = 0x04;
-
- /** The imply mask. */
- private int mask;
-
- /** The actions string. */
- private String actions;
-
- /** . */
- public static final String PERMISSION_TYPE = "portlet";
-
- /** The action names. */
- private static final String[] ACTION_NAMES = {VIEW_ACTION};
-
- public PortletPermission(PortalPermissionCollection collection)
- {
- super("portletpermission", collection);
- }
-
- public PortletPermission(String uri, int mask)
- {
- super("portletpermission", uri);
- this.mask = mask;
- }
-
- public PortletPermission(String uri, Collection actions)
- {
- super("portletpermission", uri);
- if (actions == null)
- {
- throw new IllegalArgumentException("Actions agurment cannot be
null");
- }
-
- //
- for (Iterator i = actions.iterator(); i.hasNext();)
- {
- String action = (String)i.next();
- addAction(action);
- }
- }
-
- public PortletPermission(String uri, String actions)
- {
- super("portletpermission", uri);
- if (actions == null)
- {
- throw new IllegalArgumentException("Actions agurment cannot be
null");
- }
-
- // Parse the actions into the mask
- StringTokenizer tokenizer = new StringTokenizer(actions, ",");
- while (tokenizer.hasMoreTokens())
- {
- String action = tokenizer.nextToken();
- addAction(action);
- }
- }
-
- private void addAction(String action) throws IllegalArgumentException
- {
- if (VIEW_ACTION.equals(action))
- {
- mask |= VIEW_MASK;
- }
-// else if (INSTANTIATE_ACTION.equals(action))
-// {
-// mask |= INSTANTIATE_MASK;
-// }
-// else if (PERSONALIZE_ACTION.equals(action))
-// {
-// mask |= PERSONALIZE_MASK;
-// }
- else
- {
- throw new IllegalArgumentException("Illegal action " + action);
- }
- }
-
- public boolean implies(PermissionRepository repository, Subject caller, String
roleName, PortalPermission permission) throws PortalSecurityException
- {
- if (permission instanceof PortletPermission)
- {
- PortletPermission pp = (PortletPermission)permission;
-
- // If no uri then the permission is a container
- if (pp.isContainer())
- {
- return false;
- }
- else
- {
- String uri = pp.getURI();
- PortalPermission loaded = repository.getPermission(roleName, uri);
- if (loaded != null && loaded.implies(pp))
- {
- return true;
- }
- }
- }
- return false;
- }
-
- public boolean implies(Permission permission)
- {
- if (permission instanceof PortletPermission && isContainer() == false)
- {
- PortletPermission that = (PortletPermission)permission;
-
- //
- if (that.isContainer() == false && that.uri.equals(this.uri))
- {
- return (this.mask & that.mask) == that.mask;
- }
- }
- return false;
- }
-
- public boolean equals(Object obj)
- {
- if (obj == this)
- {
- return true;
- }
- if (obj instanceof PortletPermission)
- {
- PortletPermission that = (PortletPermission)obj;
- if (this.isContainer())
- {
- return that.isContainer();
- }
- return this.mask == that.mask && this.uri.equals(that.uri);
- }
- return false;
- }
-
- public int hashCode()
- {
- if (isContainer())
- {
- return 0;
- }
- else
- {
- return uri.hashCode() * 43 + mask;
- }
- }
-
- public String getActions()
- {
- if (actions == null)
- {
- StringBuffer tmp = new StringBuffer();
-
- //
- for (int i = 0; i < ACTION_NAMES.length; i++)
- {
- int mask = 2 >> i;
- if ((this.mask & mask) == mask)
- {
- tmp.append(ACTION_NAMES[i]).append(',');
- }
- }
-
- //
- int length = tmp.length();
- if (length > 0)
- {
- tmp.setLength(length - 1);
- }
- actions = tmp.toString();
- }
- return actions;
- }
-
- public String getType()
- {
- return PERMISSION_TYPE;
- }
-}
Deleted:
trunk/portlet/src/main/org/jboss/portal/portlet/security/PortletSecurityService.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/security/PortletSecurityService.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/security/PortletSecurityService.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,44 +0,0 @@
-/******************************************************************************
- * 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. *
- ******************************************************************************/
-
-/*
- * JBoss, the OpenSource J2EE webOS
- *
- * Distributable under LGPL license.
- * See terms of license at
gnu.org.
- */
-package org.jboss.portal.portlet.security;
-
-import org.jboss.portal.security.spi.provider.AuthorizationDomain;
-
-/**
- * Interface that defines a service that is used to configure security for portlets
- *
- * @author <a href="mailto:Anil.Saldhana@jboss.org">Anil
Saldhana</a>
- * @version $Revision$
- * @since Mar 17, 2006
- */
-public interface PortletSecurityService
-{
- AuthorizationDomain getAuthorizationDomain();
-}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortalContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortalContext.java 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/spi/PortalContext.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -33,6 +33,13 @@
*/
public interface PortalContext
{
+ /**
+ * Return info about the portal.
+ *
+ * @return portal infos
+ */
+ String getInfo();
+
/** Return the window states accepted by this portal context. */
Set getWindowStates();
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,11 +22,9 @@
******************************************************************************/
package org.jboss.portal.portlet.spi;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import java.io.IOException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import java.util.Enumeration;
-import java.util.Set;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -62,5 +60,10 @@
/**
*
*/
- void include(RequestDispatcher rd) throws IOException, ServletException;
+ HttpServletRequest getClientRequest();
+
+ /**
+ *
+ */
+ HttpServletResponse getClientResponse();
}
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -24,7 +24,6 @@
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.common.value.Value;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.portlet.InvalidPortletIdException;
import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.Portlet;
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/tck/TCKPortletController.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/tck/TCKPortletController.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/tck/TCKPortletController.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,73 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.portlet.tck;
-
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.test.PortletController;
-import org.jboss.portal.server.ServerInvocation;
-
-import javax.servlet.http.HttpSession;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class TCKPortletController extends PortletController
-{
- protected Collection getRenderList(ServerInvocation invocation) throws
PortletInvokerException
- {
- HttpSession session =
invocation.getServerContext().getClientRequest().getSession();
- List portletIds = null;
- String[] values =
(String[])invocation.getServerContext().getQueryParameterMap().get("portletName");
- if (values == null)
- {
- portletIds = (List)session.getAttribute("portlets");
- }
- else
- {
- portletIds = new ArrayList();
- for (int i = 0; i < values.length; i++)
- {
- String value = values[i];
- String portletId = '/' + value.replace('/', '.');
- portletIds.add(portletId);
- }
- session.setAttribute("portlets", portletIds);
- }
- List portlets = new ArrayList();
- for (Iterator i = portletIds.iterator(); i.hasNext();)
- {
- String portletId = (String)i.next();
- Portlet portlet =
portletInvoker.getPortlet(PortletContext.createPortletContext(portletId));
- portlets.add(portlet);
-
- }
- return portlets;
- }
-}
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,682 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.portlet.test;
-
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.common.NotYetImplemented;
-import org.jboss.portal.common.invocation.EmptyAttributeResolver;
-import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.common.util.URLTools;
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.portlet.ActionURL;
-import org.jboss.portal.portlet.PortletParameters;
-import org.jboss.portal.portlet.PortletParametersStateString;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.PortletURL;
-import org.jboss.portal.portlet.RenderURL;
-import org.jboss.portal.portlet.StateEvent;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.impl.PortletRequestDecoder;
-import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext;
-import org.jboss.portal.portlet.impl.spi.AbstractRequestContext;
-import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext;
-import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
-import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.RenderResponse;
-import org.jboss.portal.portlet.spi.ActionContext;
-import org.jboss.portal.portlet.spi.InstanceContext;
-import org.jboss.portal.portlet.spi.PortalContext;
-import org.jboss.portal.portlet.spi.PortletInvocationContext;
-import org.jboss.portal.portlet.spi.RenderContext;
-import org.jboss.portal.portlet.spi.RequestContext;
-import org.jboss.portal.portlet.spi.SecurityContext;
-import org.jboss.portal.portlet.spi.UserContext;
-import org.jboss.portal.portlet.spi.WindowContext;
-import org.jboss.portal.portlet.state.AccessMode;
-import org.jboss.portal.server.AbstractServerURL;
-import org.jboss.portal.server.RequestController;
-import org.jboss.portal.server.ServerException;
-import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.server.request.URLFormat;
-import org.jboss.logging.Logger;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class PortletController implements RequestController
-{
-
- /** . */
- protected boolean redirectAfterAction;
-
- /** . */
- protected PortletInvoker portletInvoker;
-
- /** . */
- protected Logger log = Logger.getLogger(getClass());
-
- public PortletInvoker getPortletInvoker()
- {
- return portletInvoker;
- }
-
- public void setPortletInvoker(PortletInvoker portletInvoker)
- {
- this.portletInvoker = portletInvoker;
- }
-
- public boolean getRedirectAfterAction()
- {
- return redirectAfterAction;
- }
-
- public void setRedirectAfterAction(boolean redirectAfterAction)
- {
- this.redirectAfterAction = redirectAfterAction;
- }
-
- public void handle(ServerInvocation invocation) throws ServerException
- {
- //
-// if (HttpTestContext.isCurrentRequestCount(0))
-// {
-// invocation.getServerContext().getClientRequest().getSession().invalidate();
-// }
-
- try
- {
- String requestPath = invocation.getServerContext().getPortalRequestPath();
-
- if (requestPath != null &&
requestPath.startsWith("/portlet/"))
- {
- // Get the portlet
- String portletId = requestPath.substring("/portlet/".length());
- Portlet portlet =
portletInvoker.getPortlet(PortletContext.createPortletContext(portletId));
-
- PortletRequestDecoder decoder = new PortletRequestDecoder();
- decoder.decode(invocation.getServerContext().getQueryParameterMap(),
invocation.getServerContext().getBodyParameterMap());
-
- if (decoder.getType() == PortletRequestDecoder.ACTION_TYPE)
- {
- // Get the navigational state if it exist
- PortletParametersStateString navigationalState =
(PortletParametersStateString)invocation.getAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext().getId());
-
- //
- ActionContextImpl actionContext = new ActionContextImpl(
- portlet, invocation, navigationalState,
- decoder.getWindowState() != null ? decoder.getWindowState() :
WindowState.NORMAL,
- decoder.getMode() != null ? decoder.getMode() : Mode.VIEW,
- decoder.getInteractionState(),
- decoder.getForm());
-
- ActionInvocation action = createAction(invocation, actionContext);
-
action.setTarget(((InstanceContextImpl)action.getInstanceContext()).getPortletContext());
- PortletInvocationResponse response = portletInvoker.invoke(action);
- if (response instanceof RenderResponse)
- {
- RenderResponse renderResult = (RenderResponse)response;
-
- // Perform the redirection or chain rendering as part of the same http
request
- if (redirectAfterAction)
- {
- try
- {
- final StateString _portletNavState =
renderResult.getNavigationalState();
- final Mode _mode = renderResult.getMode();
- final WindowState _windowState = renderResult.getWindowState();
- PortletURL portletURL = new RenderURL()
- {
- public StateString getNavigationalState()
- {
- return _portletNavState;
- }
-
- public Mode getMode()
- {
- return _mode;
- }
-
- public WindowState getWindowState()
- {
- return _windowState;
- }
- };
- String url = actionContext.renderURL(portletURL, null, null,
false);
-
invocation.getServerContext().getClientResponse().sendRedirect(url);
- return;
- }
- catch (IOException e)
- {
- throw new ServerException(e);
- }
- }
- else
- {
- invocation.setAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext().getId(), renderResult.getNavigationalState());
- }
- }
- if (response instanceof HTTPRedirectionResponse)
- {
- try
- {
- HTTPRedirectionResponse redirection =
(HTTPRedirectionResponse)response;
-
invocation.getServerContext().getClientResponse().sendRedirect(redirection.getLocation());
- return;
- }
- catch (IOException e)
- {
- throw new ServerException(e);
- }
- }
- else if (response instanceof ErrorResponse)
- {
- ErrorResponse error = (ErrorResponse)response;
- error.logErrorTo(log, "An error occured during portlet
invocation");
- try
- {
-
invocation.getServerContext().getClientResponse().sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- return;
- }
- catch (IOException e)
- {
- throw new ServerException(e);
- }
- }
- }
- else
- {
- //
- invocation.setAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext().getId(), decoder.getNavigationalState());
-
- //
- Mode mode = decoder.getMode();
- if (mode == null)
- {
- mode = Mode.VIEW;
- }
- invocation.setAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext() + "_mode", mode);
-
- //
- WindowState windowState = decoder.getWindowState();
- if (windowState == null)
- {
- windowState = WindowState.NORMAL;
- }
- invocation.setAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext() + "_windowstate", windowState);
- }
-
- }
-
- // Render everything
- startRender(invocation);
-
- //
- for (Iterator i = getRenderList(invocation).iterator(); i.hasNext();)
- {
- Portlet portlet = (Portlet)i.next();
-
- // Get the navigational state
- StateString ns =
(StateString)invocation.getAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext().getId());
-
- // Get the mode
- Mode mode =
(Mode)invocation.getAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext() + "_mode");
- if (mode == null)
- {
- mode = Mode.VIEW;
- }
-
- // Get the window state
- WindowState windowState =
(WindowState)invocation.getAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext() + "_windowstate");
- if (windowState == null)
- {
- windowState = WindowState.NORMAL;
- }
-
- //
- RenderContextImpl renderContext = new RenderContextImpl(portlet, invocation,
ns, windowState, mode);
-
- //
- PrintWriter writer =
invocation.getServerContext().getClientResponse().getWriter();
-
- //
-
invocation.getServerContext().getClientRequest().getSession().getAttribute("CLONE_ON");
-
- //
- writer.write("<div>");
- RenderInvocation render = createRender(invocation, renderContext);
-
render.setTarget(((InstanceContextImpl)render.getInstanceContext()).getPortletContext());
- PortletInvocationResponse response = portletInvoker.invoke(render);
-
- //
- if (response instanceof FragmentResponse)
- {
- FragmentResponse fragment = (FragmentResponse)response;
- String s = "";
- switch (fragment.getType())
- {
- case FragmentResponse.TYPE_EMPTY:
- // Keep the empty string
- break;
- case FragmentResponse.TYPE_CHARS:
- s = ((FragmentResponse)response).getChars().toString();
- break;
- case FragmentResponse.TYPE_BYTES:
- s = ((FragmentResponse)response).getBytes().toString();
- break;
- }
- writer.write(s);
- }
- else if (response instanceof ErrorResponse)
- {
- writer.write("<div style=\"color: red;\">");
- writer.write(((ErrorResponse)response).toHTML());
- writer.write("</div>");
- }
- else if (response instanceof InsufficientPrivilegesResponse)
- {
- throw new NotYetImplemented();
-// // Redirect to authed servlet
-//
-// // Compute the new url context
-// URLContext uctx = invocation.getServerContext().getURLContext();
-// uctx = URLContext.newInstance(uctx.getSecure(), true);
-//
-// //
-// AbstractServerURL url = new AbstractServerURL();
-// url.setPortalRequestPath("/index.html");
-//
-// //
-// for (Iterator j =
invocation.getServerContext().getParameterMap().values().iterator(); j.hasNext();)
-// {
-// RequestParameter param = (RequestParameter)j.next();
-// url.setParameterValues(param.getName(), param.getValues());
-// }
-//
-// //
-// String s = invocation.getResponse().encodeURL(url, uctx);
-//
-// //
-// HttpServletResponse resp =
invocation.getServerContext().getClientResponse();
-// resp.sendRedirect(s);
-// return;
- }
- else
- {
- writer.write("");
- }
- writer.write("</div>");
- }
-
- //
- endRender(invocation);
- }
- catch (PortletInvokerException e)
- {
- throw new ServerException(e);
- }
- catch (ServletException e)
- {
- throw new ServerException(e);
- }
- catch (IOException e)
- {
- throw new ServerException(e);
- }
- }
-
- protected Collection getRenderList(ServerInvocation invocation) throws
PortletInvokerException
- {
- return portletInvoker.getPortlets();
- }
-
- protected void startRender(ServerInvocation invocation) throws ServletException,
IOException
- {
-
- HttpServletResponse cresp = invocation.getServerContext().getClientResponse();
- cresp.setContentType("text/html;charset=UTF-8");
- cresp.setCharacterEncoding("UTF-8");
- PrintWriter writer =
invocation.getServerContext().getClientResponse().getWriter();
- writer.print("<html><body>");
- }
-
- protected void endRender(ServerInvocation invocation) throws ServletException,
IOException
- {
- PrintWriter writer =
invocation.getServerContext().getClientResponse().getWriter();
- writer.print("</body></html>");
- writer.close();
- }
-
- /** An instance context implementation that stores */
- protected class InstanceContextImpl implements InstanceContext
- {
-
- private HttpServletRequest req;
- private AccessMode accessMode;
- private PortletContext portletContext;
- private PortletContext cloneContext;
- private static final String CLONE_OF = "clone_of_";
-
- public InstanceContextImpl(Portlet portlet, HttpServletRequest req)
- {
- this.portletContext = portlet.getContext();
- this.req = req;
- this.cloneContext = (PortletContext)req.getSession().getAttribute(CLONE_OF +
portlet.getContext().getId());
- this.accessMode = cloneContext == null ? AccessMode.CLONE_BEFORE_WRITE :
AccessMode.READ_WRITE;
- }
-
- public String getId()
- {
- return portletContext.getId();
- }
-
- public void onStateEvent(StateEvent event)
- {
- req.getSession().setAttribute(CLONE_OF + this.portletContext.getId(),
event.getPortletContext());
- }
-
- public void portletCloned(String cloneId)
- {
- throw new UnsupportedOperationException();
- }
-
- public AccessMode getAccessMode()
- {
- return accessMode;
- }
-
- public PortletContext getPortletContext()
- {
- return cloneContext != null ? cloneContext : portletContext;
- }
- }
-
- protected class RenderContextImpl extends PortletInvocationContextImpl implements
RenderContext
- {
- public RenderContextImpl(
- Portlet portlet,
- ServerInvocation invocation,
- StateString navigationalState,
- WindowState windowState,
- Mode mode)
- {
- super(portlet, invocation, navigationalState, windowState, mode);
- }
- }
-
- protected class ActionContextImpl extends PortletInvocationContextImpl implements
ActionContext
- {
-
- private HttpServletRequest req;
- private StateString interactionState;
- private PortletParameters form;
-
- public ActionContextImpl(
- Portlet portlet,
- ServerInvocation invocation,
- StateString navigationalState,
- WindowState windowState,
- Mode mode,
- StateString interactionState,
- PortletParameters form)
- {
- super(portlet, invocation, navigationalState, windowState, mode);
- req = invocation.getServerContext().getClientRequest();
- this.interactionState = interactionState;
- this.form = form;
- }
-
- public String getCharacterEncoding()
- {
- return req.getCharacterEncoding();
- }
-
- public BufferedReader getReader() throws IOException
- {
- return req.getReader();
- }
-
- public InputStream getInputStream() throws IOException
- {
- return req.getInputStream();
- }
-
- public int getContentLength()
- {
- return req.getContentLength();
- }
-
- public String getContentType()
- {
- return req.getContentType();
- }
-
- public StateString getInteractionState()
- {
- return interactionState;
- }
-
- public PortletParameters getForm()
- {
- return form;
- }
- }
-
- public ActionInvocation createAction(ServerInvocation serverInvocation, ActionContext
actionContext)
- {
- ActionInvocation invocation = new ActionInvocation(actionContext);
- update(serverInvocation, invocation);
- return invocation;
- }
-
- public RenderInvocation createRender(ServerInvocation serverInvocation, RenderContext
renderContext)
- {
- RenderInvocation invocation = new RenderInvocation(renderContext);
- update(serverInvocation, invocation);
- return invocation;
- }
-
- public void update(final ServerInvocation serverInvocation, PortletInvocation
invocation)
- {
- final PortletInvocationContextImpl invocationContext =
(PortletInvocationContextImpl)invocation.getPortletContext();
- PortalContext portalContext = new TestPortalContext();
- SecurityContext securityContext = new
AbstractSecurityContext(invocationContext.getClientRequest());
- RequestContext requestContext = new
AbstractRequestContext(invocationContext.getClientRequest(),
invocationContext.getClientResponse());
- InstanceContext instanceContext = new
InstanceContextImpl(invocationContext.portlet, invocationContext.getClientRequest());
-
- //
- WindowContext windowContext = new WindowContext()
- {
- public String getId()
- {
- return invocationContext.portlet.getContext().getId();
- }
-
- };
- UserContext userContext = new UserContext()
- {
- public String getId()
- {
- return null;
- }
-
- public Map getInformations()
- {
- return new HashMap();
- }
-
- public Locale getLocale()
- {
- return serverInvocation.getRequest().getLocale();
- }
-
- public List getLocales()
- {
- return Tools.toList(serverInvocation.getRequest().getLocales());
- }
- };
-
- //
- invocation.setPortalContext(portalContext);
- invocation.setSecurityContext(securityContext);
- invocation.setRequestContext(requestContext);
- invocation.setInstanceContext(instanceContext);
- invocation.setWindowContext(windowContext);
- invocation.setUserContext(userContext);
- }
-
- protected class PortletInvocationContextImpl extends AbstractPortletInvocationContext
implements PortletInvocationContext
- {
-
- protected Portlet portlet;
- protected ServerInvocation invocation;
-
- public PortletInvocationContextImpl(
- Portlet portlet,
- ServerInvocation invocation,
- StateString navigationalState,
- WindowState windowState,
- Mode mode)
- {
- super(mode, windowState, navigationalState,
(MarkupInfo)invocation.getResponse().getContentInfo());
-
- //
- this.portlet = portlet;
- this.invocation = invocation;
-
- //
- addResolver(ServerInvocation.REQUEST_SCOPE, invocation.getContext());
- addResolver(ServerInvocation.PRINCIPAL_SCOPE, invocation.getContext());
- addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE,
EmptyAttributeResolver.getInstance());
- addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new
MapAttributeResolver());
- }
-
- public HttpServletResponse getClientResponse()
- {
- return invocation.getServerContext().getClientResponse();
- }
-
- public HttpServletRequest getClientRequest()
- {
- return invocation.getServerContext().getClientRequest();
- }
-
- public String encodeResourceURL(String url)
- {
- URLTools.enforceAbsoluteURL(url);
- return invocation.getServerContext().getClientResponse().encodeURL(url);
- }
-
- public String renderURL(PortletURL portletURL, Boolean wantSecure, Boolean
wantAuthenticated, boolean relative)
- {
- AbstractServerURL serverURL = new AbstractServerURL();
-
- //
- String id = portlet.getContext().getId();
- serverURL.setPortalRequestPath("/portlet/" + id);
-
- //
- int meta = PortletRequestDecoder.RENDER_MASK;
- if (portletURL instanceof ActionURL)
- {
- meta = PortletRequestDecoder.ACTION_MASK;
- }
-
- //
- if (portletURL.getMode() != null)
- {
- meta |= PortletRequestDecoder.MODE_MASK;
- serverURL.setParameterValue(PortletRequestDecoder.MODE_PARAMETER,
portletURL.getMode().toString());
- }
-
- //
- if (portletURL.getWindowState() != null)
- {
- meta |= PortletRequestDecoder.WINDOW_STATE_MASK;
- serverURL.setParameterValue(PortletRequestDecoder.WINDOW_STATE_PARAMETER,
portletURL.getWindowState().toString());
- }
-
- //
- serverURL.setParameterValue(PortletRequestDecoder.META_PARAMETER,
Integer.toHexString(meta));
-
- // Unwrap in a specific jboss portlet navigational state
- PortletParameters parameters = null;
- if (portletURL instanceof ActionURL)
- {
- PortletParametersStateString interactionState =
(PortletParametersStateString)((ActionURL)portletURL).getInteractionState();
- if (interactionState != null)
- {
- parameters = interactionState.getParameters();
- }
- }
- else
- {
- PortletParametersStateString navState =
(PortletParametersStateString)((RenderURL)portletURL).getNavigationalState();
- if (navState != null)
- {
- parameters = navState.getParameters();
- }
- }
-
- //
- if (parameters != null)
- {
- for (Iterator i = parameters.entrySet().iterator(); i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- String name = (String)entry.getKey();
- String[] values = (String[])entry.getValue();
- serverURL.setParameterValues(name, values);
- }
- }
-
- //
- return invocation.getResponse().renderURL(serverURL,
URLFormat.newInstance(relative, true));
- }
- }
-}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortalContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortalContext.java 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/TestPortalContext.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -54,6 +54,11 @@
props = Collections.EMPTY_MAP;
}
+ public String getInfo()
+ {
+ return "Dummy/1.0";
+ }
+
public Set getWindowStates()
{
return windowStates;
Deleted:
trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,79 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.portlet.test;
-
-import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.invocation.PortletInterceptor;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
-import org.jboss.portal.portlet.security.PortletPermission;
-import org.jboss.portal.security.PortalSecurityException;
-import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
-import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class TestSecurityInterceptor extends PortletInterceptor
-{
-
- /** The auth manager factory. */
- private PortalAuthorizationManagerFactory pamf;
-
- public PortalAuthorizationManagerFactory getPortalAuthorizationManagerFactory()
- {
- return pamf;
- }
-
- public void setPortalAuthorizationManagerFactory(PortalAuthorizationManagerFactory
portalAuthorizationManagerFactory)
- {
- this.pamf = portalAuthorizationManagerFactory;
- }
-
- protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
- {
- try
- {
- PortalAuthorizationManager authMgr = pamf.getManager();
- PortletContext portletContext = invocation.getTarget();
- String portletId = portletContext.getId();
- PortletPermission perm = new PortletPermission(portletId,
PortletPermission.VIEW_MASK);
- boolean authorized = authMgr.checkPermission(perm);
- if (authorized == false)
- {
- return new InsufficientPrivilegesResponse();
- }
- else
- {
- return invocation.invokeNext();
- }
- }
- catch (PortalSecurityException e)
- {
- throw new PortletInvokerException(e);
- }
- }
-}
Modified:
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/PortletTestDriver.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,18 +22,17 @@
******************************************************************************/
package org.jboss.portal.test.framework.portlet;
-import org.jboss.portal.test.framework.server.driver.HttpTestDriverRegistry;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.common.test.driver.TestDriverRegistry;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class PortletTestDriver extends AbstractJBossService
+public class PortletTestDriver
{
/** . */
- private HttpTestDriverRegistry testDriverRegistry;
+ private TestDriverRegistry testDriverRegistry;
/** . */
public static PortletTestContext context;
@@ -41,17 +40,17 @@
/** . */
private static PortletTestDriver instance;
- public HttpTestDriverRegistry getTestDriverRegistry()
+ public TestDriverRegistry getTestDriverRegistry()
{
return testDriverRegistry;
}
- public void setTestDriverRegistry(HttpTestDriverRegistry testDriverRegistry)
+ public void setTestDriverRegistry(TestDriverRegistry testDriverRegistry)
{
this.testDriverRegistry = testDriverRegistry;
}
- protected void startService() throws Exception
+ public void start() throws Exception
{
if (instance != null)
{
@@ -60,7 +59,7 @@
instance = this;
}
- protected void stopService() throws Exception
+ public void stop() throws Exception
{
instance = null;
}
Modified:
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/SequenceRegistry.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/SequenceRegistry.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/SequenceRegistry.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -29,7 +29,7 @@
import org.jboss.portal.common.test.driver.DriverCommand;
import org.jboss.portal.common.test.driver.TestDriverException;
import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
-import org.jboss.portal.test.framework.driver.http.HttpTestDriverServer;
+import org.jboss.portal.test.framework.driver.http.HttpTestDriver;
import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import java.util.HashMap;
@@ -42,7 +42,7 @@
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
* @version $Revision$
*/
-public class SequenceRegistry implements HttpTestDriverServer
+public class SequenceRegistry implements HttpTestDriver
{
/** . */
Copied: trunk/portlet/src/main/org/jboss/portal/test/portlet/ContentTypesTestCase.java
(from rev 6712,
trunk/portlet/src/main/org/jboss/portal/test/server/ContentTypesTestCase.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/ContentTypesTestCase.java
(rev 0)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/ContentTypesTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,95 @@
+/******************************************************************************
+ * 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.jboss.portal.test.portlet;
+
+import junit.framework.TestCase;
+import org.jboss.portal.Mode;
+import org.jboss.portal.portlet.impl.jsr168.info.ContentTypes;
+import org.jboss.portal.portlet.impl.jsr168.metadata.ContentTypeMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.ContentTypesMetaData;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ * @since 2.4
+ */
+public class ContentTypesTestCase extends TestCase
+{
+ private ContentTypes contentTypes;
+
+ public ContentTypesTestCase()
+ {
+ contentTypes = new ContentTypes();
+ ContentTypesMetaData md = new ContentTypesMetaData();
+ md.addContentType(new ContentTypeMetaData("text/html", new
Mode[]{Mode.EDIT, Mode.HELP, Mode.VIEW}));
+ md.addContentType(new ContentTypeMetaData("text/xml", new
Mode[]{Mode.VIEW}));
+ md.addContentType(new ContentTypeMetaData("*", new Mode[]{Mode.VIEW}));
+ md.addContentType(new ContentTypeMetaData("*/*", new Mode[]{}));
+ md.addContentType(new ContentTypeMetaData("text/*", new Mode[]{}));
+
+ // should this be allowed?
+ md.addContentType(new ContentTypeMetaData("pipo/pipo", new Mode[]{}));
+
+ contentTypes.setMetadata(md);
+ }
+
+ public void testGetAllModes()
+ {
+ Collection modes = contentTypes.getAllModes();
+ assertEquals(3, modes.size());
+ assertTrue(modes.contains(Mode.EDIT));
+ assertTrue(modes.contains(Mode.HELP));
+ assertTrue(modes.contains(Mode.VIEW));
+ }
+
+ public void testGetAllContentTypes()
+ {
+ Collection types = contentTypes.getAllContentTypes();
+ assertEquals(5, types.size());
+ assertTrue(types.contains("text/html"));
+ assertTrue(types.contains("text/xml"));
+ assertTrue(types.contains("pipo/pipo"));
+ assertTrue(types.contains("*"));
+ assertTrue(types.contains("text"));
+ }
+
+ public void testIsModeSupported()
+ {
+ }
+
+ public void testGetSupportedModes()
+ {
+ }
+
+ public void testIsContentTypeSupported()
+ {
+ }
+
+
+ public void testIsModeSupportedFor()
+ {
+ }
+}
Property changes on:
trunk/portlet/src/main/org/jboss/portal/test/portlet/ContentTypesTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.ha.session;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
import org.jboss.portal.test.framework.server.NodeId;
/**
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/AbstractInfoTest.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/AbstractInfoTest.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/AbstractInfoTest.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,22 +22,48 @@
******************************************************************************/
package org.jboss.portal.test.portlet.info;
-import org.jboss.portal.test.framework.server.driver.AbstractTest;
+import org.jboss.portal.test.framework.driver.http.HttpTestCase;
import org.jboss.portal.portlet.container.PortletApplicationRegistry;
+import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.TestDriverRegistry;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.common.test.info.TestInfo;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public abstract class AbstractInfoTest extends AbstractTest
+public abstract class AbstractInfoTest implements TestDriver
{
+ /** The test id. */
+ protected final String testCaseId;
+
+ /** The test info. */
+ protected final TestInfo testInfo;
+
/** . */
protected PortletApplicationRegistry registry;
- public AbstractInfoTest(String testCaseId, String path)
+ /** The controller. */
+ protected TestDriverRegistry testDriverRegistry;
+
+ public AbstractInfoTest(String testCaseId)
{
- super(testCaseId, path);
+ if (testCaseId == null)
+ {
+ throw new IllegalArgumentException("No null test case id accepted");
+ }
+
+ //
+ this.testCaseId = testCaseId;
+ this.testInfo = new TestInfo(testCaseId);
}
public PortletApplicationRegistry getRegistry()
@@ -49,4 +75,54 @@
{
this.registry = registry;
}
+
+ public TestDriverRegistry getTestDriverRegistry()
+ {
+ return testDriverRegistry;
+ }
+
+ public void setTestDriverRegistry(TestDriverRegistry testDriverRegistry)
+ {
+ this.testDriverRegistry = testDriverRegistry;
+ }
+
+ public void create()
+ {
+ testDriverRegistry.register(this);
+ }
+
+ public void destroy()
+ {
+ testDriverRegistry.unregister(this);
+ }
+
+ public TestItemInfo getInfo()
+ {
+ return testInfo;
+ }
+
+ public DriverResponse invoke(String testId, DriverCommand cmd) throws
TestDriverException
+ {
+ if (cmd instanceof StartTestCommand)
+ {
+ try
+ {
+ execute();
+
+ //
+ return new EndTestResponse();
+ }
+ catch (Exception e)
+ {
+ return new ErrorResponse(e);
+ }
+ }
+ else
+ {
+ return new ErrorResponse();
+ }
+ }
+
+ protected abstract void execute();
+
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CacheInfoTest.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CacheInfoTest.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CacheInfoTest.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -25,11 +25,8 @@
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.info.CacheInfo;
import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.common.test.driver.response.EndTestResponse;
-import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
@@ -40,16 +37,15 @@
public CacheInfoTest()
{
- super("CacheInfoTest", "/test");
+ super("CacheInfoTest");
}
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext)
+ public void execute()
{
PortletContainer container =
registry.getPortletApplication("/test-info").getPortletContainer("CachePortlet");
PortletInfo info = container.getInfo();
CacheInfo cacheInfo = info.getCache();
ExtendedAssert.assertEquals(65, cacheInfo.getExpirationSecs());
//TODO:implement getReferenceType();
- return new EndTestResponse();
}
}
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/CapabilitiesInfoTest.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -30,11 +30,7 @@
import org.jboss.portal.portlet.info.ModeInfo;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.WindowStateInfo;
-import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.common.test.driver.response.EndTestResponse;
-import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import java.util.HashSet;
import java.util.Iterator;
@@ -50,10 +46,10 @@
public CapabilitiesInfoTest()
{
- super("CapabilitiesInfoTest", "/test");
+ super("CapabilitiesInfoTest");
}
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext)
+ public void execute()
{
PortletContainer container =
registry.getPortletApplication("/test-info").getPortletContainer("CapabilitiesPortlet");
PortletInfo info = container.getInfo();
@@ -131,7 +127,6 @@
//fail();
//throw new UnsupportedOperationException("CapabilitiesInfoTest: Finish
implementation!");
- return new EndTestResponse();
}
public Set extractWindowStates(Set infos)
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/InfoTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.info;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/MetaInfoTest.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -26,11 +26,7 @@
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.info.MetaInfo;
import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.common.test.driver.response.EndTestResponse;
-import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import java.util.Locale;
@@ -43,10 +39,10 @@
public MetaInfoTest()
{
- super("MetaInfoTest", "/test");
+ super("MetaInfoTest");
}
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext)
+ public void execute()
{
PortletContainer container =
registry.getPortletApplication("/test-info").getPortletContainer("NoBundlePortlet");
PortletInfo info = container.getInfo();
@@ -66,7 +62,5 @@
LocalizedString keywords = metaInfo.getMetaValue(MetaInfo.KEYWORDS);
String keywordsEn = keywords.getString(Locale.ENGLISH, false);
ExtendedAssert.assertEquals("keywords", keywordsEn);
-
- return new EndTestResponse();
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/ModeInfoTest.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/info/ModeInfoTest.java 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/info/ModeInfoTest.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -26,11 +26,8 @@
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
import org.jboss.portal.portlet.info.ModeInfo;
-import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.common.test.driver.response.EndTestResponse;
-import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import java.util.HashSet;
import java.util.Iterator;
@@ -45,10 +42,10 @@
public ModeInfoTest()
{
- super("ModeInfoTest", "/test");
+ super("ModeInfoTest");
}
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext)
+ public void execute()
{
PortletContainer container1 =
registry.getPortletApplication("/test-info").getPortletContainer("ModePortlet1");
PortletContainer container2 =
registry.getPortletApplication("/test-info").getPortletContainer("ModePortlet2");
@@ -92,7 +89,5 @@
ExtendedAssert.assertTrue(portletModes.contains(Mode.VIEW));
ExtendedAssert.assertTrue(!portletModes.contains(Mode.HELP));
ExtendedAssert.assertTrue(!portletModes.contains(Mode.EDIT));
-
- return new EndTestResponse();
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PortletInfoTest.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PortletInfoTest.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PortletInfoTest.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -24,11 +24,7 @@
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.common.test.driver.response.EndTestResponse;
-import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
@@ -39,10 +35,10 @@
public PortletInfoTest()
{
- super("PortletInfoTest", "/test");
+ super("PortletInfoTest");
}
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext)
+ public void execute()
{
//This asserts only .isRemotable() as rest is checked in other tests
PortletContainer container =
registry.getPortletApplication("/test-info").getPortletContainer("RemotablePortlet1");
@@ -64,7 +60,5 @@
container =
registry.getPortletApplication("/test-info").getPortletContainer("RemotablePortlet3");
info = container.getInfo();
ExtendedAssert.assertEquals(Boolean.TRUE, info.isRemotable());
-
- return new EndTestResponse();
}
}
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/PreferenceInfoTest.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -26,11 +26,7 @@
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPreferencesInfo;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPreferenceInfo;
import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.common.test.driver.response.EndTestResponse;
-import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
import java.util.Locale;
import java.util.Set;
@@ -44,10 +40,10 @@
public PreferenceInfoTest()
{
- super("PreferenceInfoTest", "/test");
+ super("PreferenceInfoTest");
}
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext)
+ public void execute()
{
PortletContainer container =
registry.getPortletApplication("/test-info").getPortletContainer("PreferenceInfoPortlet");
@@ -98,6 +94,5 @@
values = prefInfo.getDefaultValue().asStringArray();
ExtendedAssert.assertEquals(new String[]{"multi_pref_value_1",
"multi_pref_value_2"}, values);
ExtendedAssert.assertTrue(prefInfo.isReadOnly().booleanValue());
- return new EndTestResponse();
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SecurityInfoTest.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SecurityInfoTest.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SecurityInfoTest.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -26,9 +26,6 @@
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.SecurityInfo;
-import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.common.test.driver.response.EndTestResponse;
-import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.test.framework.driver.http.HttpTestContext;
@@ -41,10 +38,10 @@
public SecurityInfoTest()
{
- super("SecurityInfoTest", "/test");
+ super("SecurityInfoTest");
}
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext)
+ public void execute()
{
//This asserts only .isRemotable() as rest is checked in other tests
@@ -75,7 +72,5 @@
ExtendedAssert.assertEquals(2, secInfo.getTransportGuarantees().size());
ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.INTEGRAL));
ExtendedAssert.assertTrue(secInfo.containsTransportGuarantee(TransportGuarantee.NONE));
-
- return new EndTestResponse();
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SessionInfoTest.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SessionInfoTest.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/info/SessionInfoTest.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -25,11 +25,7 @@
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.SessionInfo;
-import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.common.test.driver.response.EndTestResponse;
-import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.junit.ExtendedAssert;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
/**
* @author <a href="mailto:boleslaw.dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
@@ -40,10 +36,10 @@
public SessionInfoTest()
{
- super("SessionInfoTest", "/test");
+ super("SessionInfoTest");
}
- public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext)
+ public void execute()
{
PortletContainer container =
registry.getPortletApplication("/test-info").getPortletContainer("DistributedPortlet1");
PortletInfo info = container.getInfo();
@@ -59,7 +55,5 @@
ExtendedAssert.assertNotNull(sessionInfo);
distributed = sessionInfo.getDistributed();
ExtendedAssert.assertEquals(Boolean.FALSE, distributed);
-
- return new EndTestResponse();
}
}
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionRequestTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionRequestTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionRequestTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionResponseTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionResponseTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/ActionResponseTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortalContextTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortalContextTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortalContextTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletConfigTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletConfigTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletConfigTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletContextTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletContextTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletContextTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletModeTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletModeTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletModeTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletPreferencesTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletPreferencesTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletPreferencesTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionUtilTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionUtilTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletSessionUtilTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletURLTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletURLTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/PortletURLTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderRequestTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderRequestTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderRequestTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderResponseTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderResponseTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/RenderResponseTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/WindowStateTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/WindowStateTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/WindowStateTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.api;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/DispatcherTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/DispatcherTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/DispatcherTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/ExpiringCacheTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/ExpiringCacheTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/ExpiringCacheTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NeverExpiringCacheTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NeverExpiringCacheTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NeverExpiringCacheTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NoCacheTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NoCacheTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NoCacheTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletConfigTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletConfigTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletConfigTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletModeTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletModeTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletModeTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletRequestsTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletRequestsTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletRequestsTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletResponsesTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletResponsesTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PortletResponsesTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PreferencesTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PreferencesTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/PreferencesTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/SessionTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/SessionTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/SessionTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.ext;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/Log4jTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/Log4jTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/Log4jTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.misc;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/DispatcherTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/DispatcherTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/DispatcherTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletConfigTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletConfigTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletConfigTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletContextTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletContextTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletContextTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletInterfaceTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletInterfaceTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletInterfaceTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletModeTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletModeTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletModeTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletRequestsTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletRequestsTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletRequestsTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletResponsesTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletResponsesTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletResponsesTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletSessionTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletSessionTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletSessionTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletURLTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletURLTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PortletURLTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PreferencesTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PreferencesTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/PreferencesTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/WindowStatesTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/WindowStatesTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/WindowStatesTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.portlet.jsr168.tck;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Deleted: trunk/portlet/src/main/org/jboss/portal/test/server/ContentTypesTestCase.java
===================================================================
---
trunk/portlet/src/main/org/jboss/portal/test/server/ContentTypesTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/main/org/jboss/portal/test/server/ContentTypesTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,95 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.test.server;
-
-import junit.framework.TestCase;
-import org.jboss.portal.Mode;
-import org.jboss.portal.portlet.impl.jsr168.info.ContentTypes;
-import org.jboss.portal.portlet.impl.jsr168.metadata.ContentTypeMetaData;
-import org.jboss.portal.portlet.impl.jsr168.metadata.ContentTypesMetaData;
-
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- * @since 2.4
- */
-public class ContentTypesTestCase extends TestCase
-{
- private ContentTypes contentTypes;
-
- public ContentTypesTestCase()
- {
- contentTypes = new ContentTypes();
- ContentTypesMetaData md = new ContentTypesMetaData();
- md.addContentType(new ContentTypeMetaData("text/html", new
Mode[]{Mode.EDIT, Mode.HELP, Mode.VIEW}));
- md.addContentType(new ContentTypeMetaData("text/xml", new
Mode[]{Mode.VIEW}));
- md.addContentType(new ContentTypeMetaData("*", new Mode[]{Mode.VIEW}));
- md.addContentType(new ContentTypeMetaData("*/*", new Mode[]{}));
- md.addContentType(new ContentTypeMetaData("text/*", new Mode[]{}));
-
- // should this be allowed?
- md.addContentType(new ContentTypeMetaData("pipo/pipo", new Mode[]{}));
-
- contentTypes.setMetadata(md);
- }
-
- public void testGetAllModes()
- {
- Collection modes = contentTypes.getAllModes();
- assertEquals(3, modes.size());
- assertTrue(modes.contains(Mode.EDIT));
- assertTrue(modes.contains(Mode.HELP));
- assertTrue(modes.contains(Mode.VIEW));
- }
-
- public void testGetAllContentTypes()
- {
- Collection types = contentTypes.getAllContentTypes();
- assertEquals(5, types.size());
- assertTrue(types.contains("text/html"));
- assertTrue(types.contains("text/xml"));
- assertTrue(types.contains("pipo/pipo"));
- assertTrue(types.contains("*"));
- assertTrue(types.contains("text"));
- }
-
- public void testIsModeSupported()
- {
- }
-
- public void testGetSupportedModes()
- {
- }
-
- public void testIsContentTypeSupported()
- {
- }
-
-
- public void testIsModeSupportedFor()
- {
- }
-}
Deleted: trunk/portlet/src/resources/samples-war/WEB-INF/classes/Portlet6_en.properties
===================================================================
---
trunk/portlet/src/resources/samples-war/WEB-INF/classes/Portlet6_en.properties 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/resources/samples-war/WEB-INF/classes/Portlet6_en.properties 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1 +0,0 @@
-en.specific=specific for locale en
Deleted: trunk/portlet/src/resources/samples-war/WEB-INF/classes/Portlet6_fr.properties
===================================================================
---
trunk/portlet/src/resources/samples-war/WEB-INF/classes/Portlet6_fr.properties 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/resources/samples-war/WEB-INF/classes/Portlet6_fr.properties 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,4 +0,0 @@
-javax.portlet.title=Titre long
-javax.portlet.short-title=Titre court
-javax.portlet.keywords=a,b,c
-fr.specific=specifique pour fr
\ No newline at end of file
Deleted: trunk/portlet/src/resources/samples-war/WEB-INF/portlet.xml
===================================================================
--- trunk/portlet/src/resources/samples-war/WEB-INF/portlet.xml 2007-03-16 22:18:56 UTC
(rev 6719)
+++ trunk/portlet/src/resources/samples-war/WEB-INF/portlet.xml 2007-03-17 02:37:08 UTC
(rev 6720)
@@ -1,291 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
- version="1.0">
- <portlet>
- <description>default</description>
- <description xml:lang="fr">defaut</description>
- <portlet-name>Portlet1</portlet-name>
-
<portlet-class>org.jboss.portal.test.portlet.TestPortlet</portlet-class>
- <init-param>
- <description>first parameter</description>
- <description xml:lang="fr">premier
parametre</description>
- <name>one</name>
- <value>1</value>
- </init-param>
- <init-param>
- <description>second parameter</description>
- <description xml:lang="fr">deuxieme
parametre</description>
- <name>two</name>
- <value>2</value>
- </init-param>
- <expiration-cache>0</expiration-cache>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>EDIT</portlet-mode>
- <portlet-mode>HELP</portlet-mode>
- </supports>
- <supports>
- <mime-type>text/wml</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>HELP</portlet-mode>
- </supports>
- <supported-locale>en</supported-locale>
- <supported-locale>fr</supported-locale>
- <portlet-info>
- <title>very long portlet title</title>
- <short-title>short portlet title</short-title>
- <keywords>a,b,c,d,e,f</keywords>
- </portlet-info>
- <portlet-preferences>
- <preference>
- <name>one</name>
- <value>1</value>
- </preference>
- <preference>
- <name>two</name>
- <value>2</value>
- <read-only>false</read-only>
- </preference>
- <preference>
- <name>three</name>
- <value>3</value>
- <read-only>true</read-only>
- </preference>
- <preference>
- <name>all</name>
- <value>1</value>
- <value>2</value>
- <value>3</value>
- </preference>
- </portlet-preferences>
- <security-role-ref>
- <description>role with no link</description>
- <description xml:lang="fr">role sans link</description>
- <role-name>ROLE_NAME_WITHOUT_LINK</role-name>
- </security-role-ref>
- <security-role-ref>
- <description>role with link</description>
- <description xml:lang="fr">role avec link</description>
- <role-name>ROLE_NAME_WITH_LINK</role-name>
- <role-link>ROLE_LINK</role-link>
- </security-role-ref>
- </portlet>
-
- <!--
- <portlet>
- <portlet-name>Portlet2</portlet-name>
-
<portlet-class>org.jboss.portal.test.portlet.TestSessionPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- </supports>
- <portlet-info>
- <title>test the portlet session</title>
- </portlet-info>
- </portlet>
-
- <portlet>
- <portlet-name>Portlet3</portlet-name>
-
<portlet-class>org.jboss.portal.test.portlet.TestDispatcherPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- </supports>
- <portlet-info>
- <title>test the portlet request dispatcher</title>
- </portlet-info>
- </portlet>
- -->
-
- <portlet>
- <portlet-name>Portlet4</portlet-name>
-
<portlet-class>org.jboss.portal.test.portlet.TestRedirectPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- </supports>
- <portlet-info>
- <title>test the portlet redirection</title>
- </portlet-info>
- </portlet>
-
- <!--
- <portlet>
- <portlet-name>Portlet5</portlet-name>
-
<portlet-class>org.jboss.portal.test.portlet.TestPortletPreferencesPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- </supports>
- <portlet-info>
- <title>test the portlet preferences</title>
- </portlet-info>
- <portlet-preferences>
- <preference>
- <name>one</name>
- <value>1</value>
- </preference>
- <preference>
- <name>two</name>
- <value>2</value>
- <read-only>false</read-only>
- </preference>
- <preference>
- <name>three</name>
- <value>3</value>
- <read-only>true</read-only>
- </preference>
- <preference>
- <name>all</name>
- <value>1</value>
- <value>2</value>
- <value>3</value>
- </preference>
- </portlet-preferences>
- </portlet>
-
- <portlet>
- <portlet-name>Portlet6</portlet-name>
-
<portlet-class>org.jboss.portal.test.portlet.TestResourceBundlePortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- </supports>
- <supported-locale>en</supported-locale>
- <supported-locale>fr</supported-locale>
- <resource-bundle>Portlet6</resource-bundle>
- <portlet-info>
- <title>Very long portlet title</title>
- <short-title>Short portlet title</short-title>
- <keywords>a,b,c,d,e,f</keywords>
- </portlet-info>
- </portlet>
-
- <portlet>
- <portlet-name>Portlet7</portlet-name>
-
<portlet-class>org.jboss.portal.test.portlet.TestExceptionDuringActionPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- </supports>
- <portlet-info>
- <title>Test exception during the action request</title>
- </portlet-info>
- </portlet>
-
- <portlet>
- <portlet-name>Portlet8</portlet-name>
-
<portlet-class>org.jboss.portal.test.portlet.TestSecurityPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- </supports>
- <portlet-info>
- <title>Test portlet security</title>
- </portlet-info>
- </portlet>
-
- <portlet>
- <portlet-name>Portlet9</portlet-name>
-
<portlet-class>org.jboss.portal.test.portlet.TestUserInformationPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- </supports>
- <portlet-info>
- <title>Test user information</title>
- </portlet-info>
- </portlet>
-
- <portlet>
- <portlet-name>Portlet10</portlet-name>
-
<portlet-class>org.jboss.portal.test.portlet.TestPortletModePortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- </supports>
- <portlet-info>
- <title>Test portlet modes</title>
- </portlet-info>
- </portlet>
-
- <portlet>
- <portlet-name>Portlet11</portlet-name>
-
<portlet-class>org.jboss.portal.test.portlet.TestSecuredProtocolPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- </supports>
- <portlet-info>
- <title>Test https URL</title>
- </portlet-info>
- </portlet>
-
- <portlet>
- <portlet-name>Portlet12</portlet-name>
-
<portlet-class>org.jboss.portal.test.portlet.TestCachedContentPortlet</portlet-class>
- <expiration-cache>60</expiration-cache>
- <supports>
- <mime-type>text/html</mime-type>
- </supports>
- <portlet-info>
- <title>Test cached content</title>
- </portlet-info>
- </portlet>
-
- <portlet>
- <portlet-name>Portlet13</portlet-name>
-
<portlet-class>org.jboss.portal.test.portlet.CrossContextSessionPortlet</portlet-class>
- <supports>
- <mime-type>text/html</mime-type>
- </supports>
- <portlet-info>
- <title>Test cross session context</title>
- </portlet-info>
- </portlet>
- -->
-
- <custom-portlet-mode>
- <description>first mode</description>
- <description xml:lang="fr">premier mode</description>
- <portlet-mode>configure</portlet-mode>
- </custom-portlet-mode>
- <custom-portlet-mode>
- <description>second mode</description>
- <portlet-mode>inactive</portlet-mode>
- </custom-portlet-mode>
- <custom-window-state>
- <description>first state</description>
- <description xml:lang="fr">premier etat</description>
- <window-state>blur</window-state>
- </custom-window-state>
- <custom-window-state>
- <description>second state</description>
- <window-state>black and white</window-state>
- </custom-window-state>
- <user-attribute>
- <description>first attribute</description>
- <description xml:lang="fr">premier attribut</description>
- <name>att1</name>
- </user-attribute>
- <user-attribute>
- <description>second attribute</description>
- <name>att2</name>
- </user-attribute>
-</portlet-app>
Deleted: trunk/portlet/src/resources/samples-war/WEB-INF/web.xml
===================================================================
--- trunk/portlet/src/resources/samples-war/WEB-INF/web.xml 2007-03-16 22:18:56 UTC (rev
6719)
+++ trunk/portlet/src/resources/samples-war/WEB-INF/web.xml 2007-03-17 02:37:08 UTC (rev
6720)
@@ -1,25 +0,0 @@
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<web-app>
-</web-app>
\ No newline at end of file
Deleted: trunk/portlet/src/resources/samples-war/test.jsp
===================================================================
--- trunk/portlet/src/resources/samples-war/test.jsp 2007-03-16 22:18:56 UTC (rev 6719)
+++ trunk/portlet/src/resources/samples-war/test.jsp 2007-03-17 02:37:08 UTC (rev 6720)
@@ -1,133 +0,0 @@
-<%@ taglib
uri="http://java.sun.com/portlet" prefix="portlet"
%>
-<%@ page import="java.util.Enumeration"%>
-<%@ page import="java.io.PrintWriter"%>
-<%@ page import="javax.portlet.*"%>
-
-<% try { %>
-<portlet:defineObjects/>
-
-<table border="1">
- <tr>
- <td colspan="2">Request parameters</td>
- </tr>
- <tr>
- <td>name</td><td>value</td>
- </tr>
-<%
- for (Enumeration e = request.getParameterNames();e.hasMoreElements();)
- {
- String name = (String)e.nextElement();
- String value = request.getParameter(name);
-
- %><tr>
- <td><%= name %></td><td><%= value %></td>
- </tr><%
- } %>
- <tr>
- <td colspan="2">RenderRequest parameters</td>
- </tr>
- <tr>
- <td>name</td><td>value</td>
- </tr>
-<%
- for (Enumeration e = renderRequest.getParameterNames();e.hasMoreElements();)
- {
- String name = (String)e.nextElement();
- String value = renderRequest.getParameter(name);
- String[] values = renderRequest.getParameterValues(name);
-
- %><tr>
- <td><%= name %></td>
- <td><% if (values != null) {
- for (int i = 0; i < values.length; i++ ) { %>
- <%= values[i] %><br/>
- <% }
- } else { %>
- <%= value %>
- <% } %>
- </td>
- </tr><%
- } %>
-</table>
-
-<%
-
-String secure = "true";
-String badSecure = "blah";
-
-String windowState = "normal";
-String badWindowState = "blah";
-
-String portletMode = "edit";
-String badPortletMode = "blah";
-
-if (renderRequest.getParameter("badSecure") != null) {
- secure = badSecure;
-}
-
-if (renderRequest.getParameter("badWindowState") != null) {
- windowState = badWindowState;
-}
-
-if (renderRequest.getParameter("badPortletMode") != null) {
- portletMode = badPortletMode;
-}
-
-%>
-
-RenderRequest object from JSP: <%= renderRequest %> <br/>
-RenderResponse object from JSP: <%= renderResponse %> <br/>
-PortletConfig object from JSP: <%= portletConfig %> <br/>
-
-<br/>
-
-actionURL:<br/>
-<br/>
-<portlet:actionURL windowState="maximized" portletMode="edit">
- <portlet:param name="action" value="editStocks" />
-</portlet:actionURL><br/>
-
-<br/>
-
-renderURL, has parameters with the same name:<br/>
-<br/> <%-- parametrized for testing --%>
-<portlet:renderURL secure="<%= secure %>" windowState="<%=
windowState %>" portletMode="<%= portletMode %>">
- <portlet:param name="showQuote" value="myCompany" />
- <portlet:param name="showQuote" value="anotherCompany" />
-</portlet:renderURL><br/>
-<br/>
-<a href="<portlet:renderURL>
- <portlet:param name="badSecure" value="true" />
-</portlet:renderURL>">Test renderURL with bad secure
parameter</a><br/>
-<a href="<portlet:renderURL>
- <portlet:param name="badWindowState" value="true" />
-</portlet:renderURL>">Test renderURL with bad windowState
parameter</a><br/>
-<a href="<portlet:renderURL>
- <portlet:param name="badPortletMode" value="true" />
-</portlet:renderURL>">Test renderURL with bad portletMode
parameter</a><br/>
-
-
-<portlet:renderURL var="savedRenderURL" portletMode="view">
- <portlet:param name="showQuote" value="render" />
- <portlet:param name="showQuote" value="IBM" />
-</portlet:renderURL><br/>
-
-renderURL via variable "savedRenderURL":<br/>
-<a href="<%= savedRenderURL %>"><%= savedRenderURL
%></a><br/>
-
-<portlet:actionURL var="savedActionURL" portletMode="edit">
- <portlet:param name="showQuote" value="action" />
- <portlet:param name="showQuote" value="ORCL" />
-</portlet:actionURL><br/>
-
-actionURL via variable "savedActionURL":<br/>
-<a href="<%= savedActionURL %>"><%= savedActionURL
%></a><br/>
-<br/>
-<br/>
-
-Namespace for portlet start with letter or _, then _s, digits, upper and lowercase :
<portlet:namespace/><br/>
-<% } catch (Throwable t) {
- out.print("Error: : " + t.getMessage());
- t.printStackTrace();
-}
-%>
\ No newline at end of file
Deleted: trunk/portlet/src/resources/tck-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/portlet/src/resources/tck-sar/META-INF/jboss-service.xml 2007-03-16 22:18:56 UTC
(rev 6719)
+++ trunk/portlet/src/resources/tck-sar/META-INF/jboss-service.xml 2007-03-17 02:37:08 UTC
(rev 6720)
@@ -1,320 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<server>
-
- <!-- Server stack -->
- <mbean
- code="org.jboss.portal.server.aspects.server.LocaleInterceptor"
- name="portal:service=Interceptor,type=Server,name=Locale"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.server.aspects.server.ContentTypeInterceptor"
- name="portal:service=Interceptor,type=Server,name=ContentType"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.server.aspects.server.NavigationInterceptor"
- name="portal:service=Interceptor,type=Server,name=Navigation"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.server.impl.invocation.JBossInterceptorStack"
- name="portal:service=InterceptorStack,type=Server"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends-list optional-attribute-name="InterceptorNames">
-
<depends-list-element>portal:service=Interceptor,type=Server,name=User</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Server,name=Locale</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Server,name=ContentType</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Server,name=Navigation</depends-list-element>
- </depends-list>
- </mbean>
-
- <!-- Consumer stack -->
- <mbean
- code="org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor"
- name="portal:service=Interceptor,type=Portlet,name=ConsumerCache"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.server.impl.invocation.JBossInterceptorStack"
- name="portal:service=InterceptorStack,type=Consumer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends-list optional-attribute-name="InterceptorNames">
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ConsumerCache</depends-list-element>
- </depends-list>
- </mbean>
-
- <!-- Container stack-->
- <mbean
- code="org.jboss.portal.portlet.aspects.portlet.ValveInterceptor"
- name="portal:service=Interceptor,type=Portlet,name=Valve"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
-
code="org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor"
- name="portal:service=Interceptor,type=Portlet,name=SecureTransport"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
-
code="org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor"
- name="portal:service=Interceptor,type=Portlet,name=ContextDispatcher"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.portlet.aspects.portlet.WindowStatesInterceptor"
- name="portal:service=Interceptor,type=Portlet,name=WindowStates"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.portlet.aspects.portlet.ModesInterceptor"
- name="portal:service=Interceptor,type=Portlet,name=Modes"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor"
- name="portal:service=Interceptor,type=Portlet,name=ProducerCache"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.server.impl.invocation.JBossInterceptorStack"
- name="portal:service=InterceptorStack,type=Container"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends-list optional-attribute-name="InterceptorNames">
-
<!--<depends-list-element>portal:service=Interceptor,type=Portlet,name=Security</depends-list-element>-->
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=Valve</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=SecureTransport</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=SessionPreDispatch</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ContextDispatcher</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=SessionPostDispatch</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=WindowStates</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=Modes</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ProducerCache</depends-list-element>
- </depends-list>
- </mbean>
-
- <!-- Webapp registry -->
- <mbean
- code="org.jboss.portal.portlet.container.PortletApplicationRegistryImpl"
- name="portal:service=WebAppRegistry"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
-
- <!-- The consumer portlet invoker -->
- <mbean
- code="org.jboss.portal.portlet.test.TestPortletInvoker"
- name="portal:service=PortletInvoker,type=Consumer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Producer"
-
proxy-type="attribute">portal:service=PortletInvoker,type=Producer</depends>
- <depends optional-attribute-name="Stack"
-
proxy-type="attribute">portal:service=InterceptorStack,type=Consumer</depends>
- </mbean>
-
- <!-- The producer portlet invoker -->
- <mbean
- code="org.jboss.portal.portlet.state.producer.ProducerPortletInvoker"
- name="portal:service=PortletInvoker,type=Producer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="PortletInvoker"
proxy-type="attribute">portal:service=PortletInvoker,type=Container</depends>
- <depends optional-attribute-name="StateStore"
-
proxy-type="attribute">portal:service=StateStore,type=Producer</depends>
- </mbean>
-
- <!-- The container portlet invoker -->
- <mbean
- code="org.jboss.portal.portlet.container.PortletContainerInvoker"
- name="portal:service=PortletInvoker,type=Container"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Stack"
-
proxy-type="attribute">portal:service=InterceptorStack,type=Container</depends>
- <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
- </mbean>
-
- <!-- The portlet controller -->
- <mbean
- code="org.jboss.portal.portlet.tck.TCKPortletController"
- name="portal:controller=Request,redirect=true"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="PortletInvoker"
proxy-type="attribute">portal:service=PortletInvoker,type=Consumer</depends>
- <attribute name="RedirectAfterAction">true</attribute>
- </mbean>
- <mbean
- code="org.jboss.portal.portlet.test.PortletController"
- name="portal:controller=Request,redirect=false"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="PortletInvoker"
proxy-type="attribute">portal:service=PortletInvoker,type=Consumer</depends>
- <attribute name="RedirectAfterAction">false</attribute>
- </mbean>
-
- <!-- Portlet deployment factory -->
- <mbean
-
code="org.jboss.portal.portlet.deployment.jboss.PortletAppDeploymentFactory"
- name="portal:deploymentFactory=PortletApp"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
- <depends optional-attribute-name="WebAppRegistry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
- <depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
- <depends optional-attribute-name="PortletSecurityService"
proxy-type="attribute">portal:service=PortletSecurityService</depends>
- </mbean>
-
- <!-- Preferences -->
- <mbean
-
code="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"
- name="portal:service=StateStore,type=Producer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <!--
- <mbean
- code="org.jboss.portal.portlet.test.TestConsumerStateStore"
- name="portal:service=StateStore,type=Consumer"
- xmbean-dd=""
-
xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- -->
-
- <!-- Portal security services-->
- <mbean
-
code="org.jboss.portal.security.impl.JBossAuthorizationDomainRegistryImpl"
- name="portal:service=AuthorizationDomainRegistry"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
-
code="org.jboss.portal.security.impl.jacc.JACCPortalAuthorizationManagerFactory"
- name="portal:service=PortalAuthorizationManagerFactory"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="AuthorizationDomainRegistry"
proxy-type="attribute">portal:service=AuthorizationDomainRegistry</depends>
- </mbean>
- <mbean
-
code="org.jboss.portal.portlet.impl.security.JBossPortletSecurityService"
- name="portal:service=PortletSecurityService"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="PortalAuthorizationManagerFactory"
proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
- <depends optional-attribute-name="AuthorizationDomainRegistry"
proxy-type="attribute">portal:service=AuthorizationDomainRegistry</depends>
- </mbean>
-
-
- <!--Things from portal-server.sar - jboss-service.xml-->
-
- <!-- Server configuration service -->
- <mbean
- code="org.jboss.portal.server.config.ServerConfigService"
- name="portal:service=ServerConfig"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute name="ConfigLocation">conf/config.xml</attribute>
- </mbean>
-
-
- <!-- Server -->
- <mbean
- code="org.jboss.portal.server.impl.ServerImpl"
- name="portal:service=Server"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
- </mbean>
-
- <!-- Server deployer -->
- <mbean
- code="org.jboss.portal.server.deployment.jboss.ServerDeployer"
- name="portal:deployer=PortalWebApp">
- <depends>jboss.system:service=MainDeployer</depends>
- <depends optional-attribute-name="PortalServer"
proxy-type="attribute">portal:service=Server</depends>
- </mbean>
-
- <!-- Adapt the web app to the server deployer -->
- <mbean
- code="org.jboss.portal.server.deployment.WebAppAdapter"
- name="portal:deployer=Adapter"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
- <depends
optional-attribute-name="InterceptedDeployer">jboss.web:service=WebServer</depends>
- </mbean>
-
- <!-- Web app enhancer -->
- <mbean
- code="org.jboss.portal.server.deployment.WebAppEnhancer"
- name="portal:service=Deployer,type=Enhancer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends
optional-attribute-name="InterceptedDeployer">jboss.web:service=WebServer</depends>
- </mbean>
-
-</server>
Deleted: trunk/portlet/src/resources/tck-sar/conf/config.xml
===================================================================
--- trunk/portlet/src/resources/tck-sar/conf/config.xml 2007-03-16 22:18:56 UTC (rev
6719)
+++ trunk/portlet/src/resources/tck-sar/conf/config.xml 2007-03-17 02:37:08 UTC (rev
6720)
@@ -1,26 +0,0 @@
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<properties>
- <entry key="blah">bluh</entry>
-</properties>
Deleted: trunk/portlet/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/portlet/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/portlet/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,188 +0,0 @@
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<server>
-
- <!-- -->
- <mbean
-
code="org.jboss.portal.test.framework.server.driver.HttpTestDriverRegistryService"
- name="portal.test:service=HttpTestDriverServer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends
- optional-attribute-name="Agent"
- proxy-type="attribute">portal.test:service=Agent</depends>
- </mbean>
- <mbean
- code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.test:service=Invoker,name=HttpTestDriverServer">
- <depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
- <depends
optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
- <attribute name="JndiName">HttpTestDriverServer</attribute>
- <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
- </mbean>
-
- <!-- Server -->
- <mbean
- code="org.jboss.portal.server.impl.ServerImpl"
- name="portal:service=Server"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
-
- <!-- Server stack -->
- <mbean
-
code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
- name="portal:service=InterceptorStackFactory,type=Server"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends-list optional-attribute-name="InterceptorNames">
- </depends-list>
- </mbean>
-
- <!-- Server deployer -->
- <mbean
- code="org.jboss.portal.server.deployment.jboss.ServerDeployer"
- name="portal:deployer=PortalWebApp">
- <depends>jboss.system:service=MainDeployer</depends>
- <depends optional-attribute-name="PortalServer"
proxy-type="attribute">portal:service=Server</depends>
- </mbean>
-
- <!-- Adapt the web app to the server deployer -->
- <mbean
- code="org.jboss.portal.server.deployment.WebAppAdapter"
- name="portal:deployer=Adapter"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
- <depends
optional-attribute-name="InterceptedDeployer">jboss.web:service=WebServer</depends>
- </mbean>
-
- <!-- Webapp registry -->
- <mbean
- code="org.jboss.portal.portlet.container.PortletApplicationRegistryImpl"
- name="portal:service=WebAppRegistry"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
-
- <!-- Portlet deployment factory -->
- <mbean
-
code="org.jboss.portal.portlet.deployment.jboss.PortletAppDeploymentFactory"
- name="portal:deploymentFactory=PortletApp"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
- <depends optional-attribute-name="WebAppRegistry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
- </mbean>
-
- <!-- -->
- <mbean
- code="org.jboss.portal.test.server.TestRequestController"
- name="portal:controller=Request"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
- </mbean>
-
- <!-- -->
- <mbean
- code="org.jboss.portal.test.portlet.info.MetaInfoTest"
- name="portal:test=MetaInfo"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
- </mbean>
- <mbean
- code="org.jboss.portal.test.portlet.info.PreferenceInfoTest"
- name="portal:test=PreferenceInfo"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
- </mbean>
- <mbean
- code="org.jboss.portal.test.portlet.info.CapabilitiesInfoTest"
- name="portal:test=CapabilitiesInfo"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
- </mbean>
- <mbean
- code="org.jboss.portal.test.portlet.info.CacheInfoTest"
- name="portal:test=CacheInfo"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
- </mbean>
- <mbean
- code="org.jboss.portal.test.portlet.info.ModeInfoTest"
- name="portal:test=ModeInfo"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
- </mbean>
- <mbean
- code="org.jboss.portal.test.portlet.info.PortletInfoTest"
- name="portal:test=PortletInfo"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
- </mbean>
- <mbean
- code="org.jboss.portal.test.portlet.info.SessionInfoTest"
- name="portal:test=SessionInfo"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
- </mbean>
- <mbean
- code="org.jboss.portal.test.portlet.info.SecurityInfoTest"
- name="portal:test=SecurityInfo"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
- </mbean>
-</server>
\ No newline at end of file
Deleted: trunk/portlet/src/resources/test-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/portlet/src/resources/test-sar/META-INF/jboss-service.xml 2007-03-16 22:18:56
UTC (rev 6719)
+++ trunk/portlet/src/resources/test-sar/META-INF/jboss-service.xml 2007-03-17 02:37:08
UTC (rev 6720)
@@ -1,356 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<server>
-
- <!-- -->
- <mbean
-
code="org.jboss.portal.test.framework.server.driver.HttpTestDriverRegistryService"
- name="portal.test:service=HttpTestDriverServer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends
- optional-attribute-name="Agent"
- proxy-type="attribute">portal.test:service=Agent</depends>
- </mbean>
- <mbean
- code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
- name="portal.test:service=Invoker,name=HttpTestDriverServer">
- <depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
- <depends
optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
- <attribute name="JndiName">HttpTestDriverServer</attribute>
- <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
- </mbean>
-
- <!-- -->
- <mbean
- code="org.jboss.portal.test.framework.portlet.PortletTestDriver"
- name="portal:service=PortletTestDriver"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
- </mbean>
-
- <!-- Server stack -->
- <mbean
- code="org.jboss.portal.server.aspects.server.LocaleInterceptor"
- name="portal:service=Interceptor,type=Server,name=Locale"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.server.aspects.server.ContentTypeInterceptor"
- name="portal:service=Interceptor,type=Server,name=ContentType"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
-
code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
- name="portal:service=InterceptorStackFactory,type=Server"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends-list optional-attribute-name="InterceptorNames">
-
<depends-list-element>portal:service=Interceptor,type=Server,name=Locale</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Server,name=ContentType</depends-list-element>
- </depends-list>
- </mbean>
-
- <!-- Consumer stack -->
- <mbean
-
code="org.jboss.portal.portlet.aspects.portlet.PortalSessionSynchronizationInterceptor"
-
name="portal:service=Interceptor,type=Portlet,name=PortalSessionSynchronization"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
-
code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
- name="portal:service=InterceptorStackFactory,type=Consumer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends-list optional-attribute-name="InterceptorNames">
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=PortalSessionSynchronization</depends-list-element>
- </depends-list>
- </mbean>
-
- <!-- Producer stack-->
- <mbean
- code="org.jboss.portal.portlet.aspects.portlet.ValveInterceptor"
- name="portal:service=Interceptor,type=Portlet,name=Valve"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor"
- name="portal:service=Interceptor,type=Portlet,name=ConsumerCache"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
-
code="org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor"
- name="portal:service=Interceptor,type=Portlet,name=SecureTransport"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
-
code="org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor"
- name="portal:service=Interceptor,type=Portlet,name=ContextDispatcher"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
-
code="org.jboss.portal.portlet.aspects.portlet.PortletSessionSynchronizationInterceptor"
-
name="portal:service=Interceptor,type=Portlet,name=PortletSessionSynchronization"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.portlet.aspects.portlet.WindowStatesInterceptor"
- name="portal:service=Interceptor,type=Portlet,name=WindowStates"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.portlet.aspects.portlet.ModesInterceptor"
- name="portal:service=Interceptor,type=Portlet,name=Modes"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor"
- name="portal:service=Interceptor,type=Portlet,name=ProducerCache"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
-
code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
- name="portal:service=InterceptorStackFactory,type=Container"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends-list optional-attribute-name="InterceptorNames">
-
<!--<depends-list-element>portal:service=Interceptor,type=Portlet,name=Security</depends-list-element>-->
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=Valve</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ConsumerCache</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=SecureTransport</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ContextDispatcher</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=PortletSessionSynchronization</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=WindowStates</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=Modes</depends-list-element>
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ProducerCache</depends-list-element>
- </depends-list>
- </mbean>
-
- <!-- Webapp registry -->
- <mbean
- code="org.jboss.portal.portlet.container.PortletApplicationRegistryImpl"
- name="portal:service=WebAppRegistry"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
-
- <!-- The consumer portlet invoker -->
- <mbean
- code="org.jboss.portal.portlet.test.TestPortletInvoker"
- name="portal:service=PortletInvoker,type=Consumer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Producer"
-
proxy-type="attribute">portal:service=PortletInvoker,type=Producer</depends>
- <depends optional-attribute-name="StackFactory"
proxy-type="attribute">portal:service=InterceptorStackFactory,type=Consumer</depends>
- </mbean>
-
- <!-- The producer portlet invoker -->
- <mbean
-
code="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"
- name="portal:service=PersistenceManager,type=Producer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.portlet.impl.state.StateManagementPolicyService"
- name="portal:service=StateManagementPolicy,type=Producer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute name="PersistLocally">true</attribute>
- </mbean>
- <mbean
- code="org.jboss.portal.portlet.impl.state.StateConverterV0"
- name="portal:service=StateConverterService,type=Producer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
- code="org.jboss.portal.portlet.state.producer.ProducerPortletInvoker"
- name="portal:service=PortletInvoker,type=Producer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="PortletInvoker"
proxy-type="attribute">portal:service=PortletInvoker,type=Container</depends>
- <depends optional-attribute-name="PersistenceManager"
proxy-type="attribute">portal:service=PersistenceManager,type=Producer</depends>
- <depends optional-attribute-name="StateManagementPolicy"
proxy-type="attribute">portal:service=StateManagementPolicy,type=Producer</depends>
- <depends optional-attribute-name="StateConverter"
proxy-type="attribute">portal:service=StateConverterService,type=Producer</depends>
- </mbean>
-
- <!-- The container portlet invoker -->
- <mbean
- code="org.jboss.portal.portlet.container.PortletContainerInvoker"
- name="portal:service=PortletInvoker,type=Container"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="StackFactory"
proxy-type="attribute">portal:service=InterceptorStackFactory,type=Container</depends>
- <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
- </mbean>
-
- <!-- The portlet controller -->
- <mbean
- code="org.jboss.portal.portlet.test.PortletController"
- name="portal:controller=Request,redirect=true"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="PortletInvoker"
proxy-type="attribute">portal:service=PortletInvoker,type=Consumer</depends>
- <attribute name="RedirectAfterAction">true</attribute>
- </mbean>
- <mbean
- code="org.jboss.portal.portlet.test.PortletController"
- name="portal:controller=Request,redirect=false"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="PortletInvoker"
proxy-type="attribute">portal:service=PortletInvoker,type=Consumer</depends>
- <attribute name="RedirectAfterAction">false</attribute>
- </mbean>
-
- <!-- Portlet deployment factory -->
- <mbean
-
code="org.jboss.portal.portlet.deployment.jboss.PortletAppDeploymentFactory"
- name="portal:deploymentFactory=PortletApp"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
- <depends optional-attribute-name="WebAppRegistry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
- <depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
- <depends optional-attribute-name="PortletSecurityService"
proxy-type="attribute">portal:service=PortletSecurityService</depends>
- </mbean>
-
- <!-- Portal security services-->
- <mbean
-
code="org.jboss.portal.security.impl.JBossAuthorizationDomainRegistryImpl"
- name="portal:service=AuthorizationDomainRegistry"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
-
code="org.jboss.portal.security.impl.jacc.JACCPortalAuthorizationManagerFactory"
- name="portal:service=PortalAuthorizationManagerFactory"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="AuthorizationDomainRegistry"
proxy-type="attribute">portal:service=AuthorizationDomainRegistry</depends>
- </mbean>
- <mbean
-
code="org.jboss.portal.portlet.impl.security.JBossPortletSecurityService"
- name="portal:service=PortletSecurityService"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="PortalAuthorizationManagerFactory"
proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
- <depends optional-attribute-name="AuthorizationDomainRegistry"
proxy-type="attribute">portal:service=AuthorizationDomainRegistry</depends>
- </mbean>
-
-
- <!-- Things from portal-server.sar - jboss-service.xml-->
-
- <!-- Server configuration service -->
- <mbean
- code="org.jboss.portal.server.config.ServerConfigService"
- name="portal:service=ServerConfig"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <attribute name="ConfigLocation">conf/config.xml</attribute>
- </mbean>
-
- <!-- Server -->
- <mbean
- code="org.jboss.portal.server.impl.ServerImpl"
- name="portal:service=Server"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
- </mbean>
-
- <!-- Server deployer -->
- <mbean
- code="org.jboss.portal.server.deployment.jboss.ServerDeployer"
- name="portal:deployer=PortalWebApp">
- <depends>jboss.system:service=MainDeployer</depends>
- <depends optional-attribute-name="PortalServer"
proxy-type="attribute">portal:service=Server</depends>
- </mbean>
-
- <!-- Adapt the web app to the server deployer -->
- <mbean
- code="org.jboss.portal.server.deployment.WebAppAdapter"
- name="portal:deployer=Adapter"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
- <depends
optional-attribute-name="InterceptedDeployer">jboss.web:service=WebServer</depends>
- </mbean>
-
- <!-- Web app enhancer -->
- <mbean
- code="org.jboss.portal.server.deployment.WebAppEnhancer"
- name="portal:service=Deployer,type=Enhancer"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends
optional-attribute-name="InterceptedDeployer">jboss.web:service=WebServer</depends>
- </mbean>
-</server>
Deleted: trunk/portlet/src/resources/test-sar/conf/config.xml
===================================================================
--- trunk/portlet/src/resources/test-sar/conf/config.xml 2007-03-16 22:18:56 UTC (rev
6719)
+++ trunk/portlet/src/resources/test-sar/conf/config.xml 2007-03-17 02:37:08 UTC (rev
6720)
@@ -1,26 +0,0 @@
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<properties>
- <entry key="blah">bluh</entry>
-</properties>
Deleted: trunk/portlet/src/resources/test-war/WEB-INF/classes/roles.properties
===================================================================
--- trunk/portlet/src/resources/test-war/WEB-INF/classes/roles.properties 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/portlet/src/resources/test-war/WEB-INF/classes/roles.properties 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1 +0,0 @@
-test=Test
Deleted: trunk/portlet/src/resources/test-war/WEB-INF/classes/users.properties
===================================================================
--- trunk/portlet/src/resources/test-war/WEB-INF/classes/users.properties 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/portlet/src/resources/test-war/WEB-INF/classes/users.properties 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1 +0,0 @@
-test=test
Deleted: trunk/portlet/src/resources/test-war/WEB-INF/jboss-web.xml
===================================================================
--- trunk/portlet/src/resources/test-war/WEB-INF/jboss-web.xml 2007-03-16 22:18:56 UTC
(rev 6719)
+++ trunk/portlet/src/resources/test-war/WEB-INF/jboss-web.xml 2007-03-17 02:37:08 UTC
(rev 6720)
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<jboss-web>
- <context-root>/test</context-root>
- <security-domain>java:/jaas/other</security-domain>
- <replication-config>
- <replication-trigger>SET</replication-trigger>
- </replication-config>
-</jboss-web>
Deleted: trunk/portlet/src/resources/test-war/WEB-INF/web.xml
===================================================================
--- trunk/portlet/src/resources/test-war/WEB-INF/web.xml 2007-03-16 22:18:56 UTC (rev
6719)
+++ trunk/portlet/src/resources/test-war/WEB-INF/web.xml 2007-03-17 02:37:08 UTC (rev
6720)
@@ -1,138 +0,0 @@
-<?xml version="1.0"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!DOCTYPE web-app PUBLIC
- "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/dtd/web-app_2_3.dtd">
-<web-app>
- <description>Portlet war</description>
-
- <distributable/>
-
- <servlet>
- <servlet-name>PortalServletRedirect</servlet-name>
-
<servlet-class>org.jboss.portal.server.servlet.PortalServlet</servlet-class>
- <init-param>
- <param-name>asDefaultServlet</param-name>
- <param-value>false</param-value>
- <description>The servlet needs to know wether it is set as a default
servlet or not</description>
- </init-param>
- <init-param>
- <param-name>controllerName</param-name>
- <param-value>portal:controller=Request,redirect=true</param-value>
- <description>The request controller for the portal
servlet</description>
- </init-param>
- <load-on-startup>0</load-on-startup>
- <security-role-ref>
- <role-name>Test</role-name>
- <role-link>Test</role-link>
- </security-role-ref>
- </servlet>
-
- <!--
- <servlet>
- <servlet-name>PortalServletNoRedirect</servlet-name>
-
<servlet-class>org.jboss.portal.server.servlet.PortalServlet</servlet-class>
- <init-param>
- <param-name>asDefaultServlet</param-name>
- <param-value>false</param-value>
- <description>The servlet needs to know wether it is set as a default
servlet or not</description>
- </init-param>
- <init-param>
- <param-name>controllerName</param-name>
-
<param-value>portal:controller=Request,redirect=false</param-value>
- <description>The request controller for the portal
servlet</description>
- </init-param>
- <load-on-startup>0</load-on-startup>
- <security-role-ref>
- <role-name>Test</role-name>
- <role-link>Test</role-link>
- </security-role-ref>
- </servlet>
- <servlet-mapping>
- <servlet-name>PortalServletNoRedirect</servlet-name>
- <url-pattern>/noredirect/*</url-pattern>
- </servlet-mapping>
- -->
-
- <!-- Provide access to unauthenticated users -->
- <servlet-mapping>
- <servlet-name>PortalServletRedirect</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>PortalServletRedirect</servlet-name>
- <url-pattern>/sec/*</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>PortalServletRedirect</servlet-name>
- <url-pattern>/auth/*</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>PortalServletRedirect</servlet-name>
- <url-pattern>/authsec/*</url-pattern>
- </servlet-mapping>
-
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>Authenticated</web-resource-name>
- <description></description>
- <url-pattern>/auth/*</url-pattern>
- </web-resource-collection>
- <auth-constraint>
- <role-name>Test</role-name>
- </auth-constraint>
- </security-constraint>
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>Secure</web-resource-name>
- <url-pattern>/sec/*</url-pattern>
- </web-resource-collection>
- <user-data-constraint>
- <transport-guarantee>CONFIDENTIAL</transport-guarantee>
- </user-data-constraint>
- </security-constraint>
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>Secure+Authenticated</web-resource-name>
- <url-pattern>/authsec/*</url-pattern>
- </web-resource-collection>
- <auth-constraint>
- <role-name>Test</role-name>
- </auth-constraint>
- <user-data-constraint>
- <transport-guarantee>CONFIDENTIAL</transport-guarantee>
- </user-data-constraint>
- </security-constraint>
-
- <login-config>
- <auth-method>BASIC</auth-method>
- <realm-name>Test</realm-name>
- </login-config>
-
- <security-role>
- <role-name>Test</role-name>
- </security-role>
-
-</web-app>
Added: trunk/portlet-server/.cvsignore
===================================================================
--- trunk/portlet-server/.cvsignore (rev 0)
+++ trunk/portlet-server/.cvsignore 2007-03-17 02:37:08 UTC (rev 6720)
@@ -0,0 +1,2 @@
+bin
+output
Property changes on: trunk/portlet-server/.cvsignore
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portlet-server/build.bat
===================================================================
--- trunk/portlet-server/build.bat (rev 0)
+++ trunk/portlet-server/build.bat 2007-03-17 02:37:08 UTC (rev 6720)
@@ -0,0 +1,54 @@
+@echo off
+rem
+rem Invokes a script of the same name in the 'tools' module.
+rem
+rem The 'tools' module is expected to be a peer directory of the directory
+rem in which this script lives.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: build.bat 21 2005-01-14 23:14:21Z vietj $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF
Property changes on: trunk/portlet-server/build.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portlet-server/build.sh
===================================================================
--- trunk/portlet-server/build.sh (rev 0)
+++ trunk/portlet-server/build.sh 2007-03-17 02:37:08 UTC (rev 6720)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+## Invokes a script of the same name in the 'tools' module.
+##
+## The 'tools' module is expected to be a peer directory of the directory
+## in which this script lives.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 21 2005-01-14 23:14:21Z vietj $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+ if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+ fi
+
+ MODULE_ROOT=`cd $DIRNAME; pwd`
+ export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+ # Where is the target script?
+ target="$TOOLS_ROOT/bin/$PROGNAME"
+ if [ ! -f "$target" ]; then
+ echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: $target"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: Please make sure you have checked out the 'tools'
module"
+ echo "${PROGNAME}: and make sure it is up to date."
+ exit 2
+ fi
+
+ # Get busy yo!
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: Executing: /bin/sh $target $@"
+ fi
+ if [ "x$TRACE" = "x" ]; then
+ exec /bin/sh $target "$@"
+ else
+ exec /bin/sh -x $target "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: trunk/portlet-server/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portlet-server/build.xml
===================================================================
--- trunk/portlet-server/build.xml (rev 0)
+++ trunk/portlet-server/build.xml 2007-03-17 02:37:08 UTC (rev 6720)
@@ -0,0 +1,467 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE project [
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY buildmagic SYSTEM
"../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM
"../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
+ ]>
+
+<!-- $Id: build.xml 6606 2007-03-09 01:12:42Z julien(a)jboss.com $ -->
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at
http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and
|-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+ &modules;
+ &defaults;
+ &tools;
+ &targets;
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable"
depends="_buildmagic:init">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+
+ <!-- Configure some properties -->
+ <property name="jboss-junit-configuration" value=""/>
+ <property name="junit.formatter.usefile" value="true"/>
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+ <path id="library.classpath">
+ <path refid="dom4j.dom4j.classpath"/>
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss.serialization.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="apache.httpclient.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="apache.codec.classpath"/>
+ <path refid="apache.collections.classpath"/>
+ <path refid="apache.logging.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ <path refid="jboss.test.classpath"/>
+ <path refid="sun.servlet.classpath"/>
+ <path refid="sun.jaf.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-jems.classpath"/>
+ <path refid="jboss.portal-security.classpath"/>
+ <path refid="jboss.portal-server.classpath"/>
+ <path refid="jboss.portal-portlet.classpath"/>
+ <path refid="jboss.portlet-api.classpath"/>
+ <path refid="jboss.portal-test.classpath"/>
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+ <property name="javadoc.private" value="true"/>
+ <property name="javadoc.protected" value="false"/>
+
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-classes,
+ _default:compile-etc,
+ _default:compile-resources">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="output"
+ description="Generate all target output."
+ depends="compile">
+ <mkdir dir="${build.lib}"/>
+
+ <!-- Portlet server lib jar -->
+ <jar jarfile="${build.lib}/portal-portlet-server-lib.jar">
+ <fileset dir="${build.classes}">
+ <exclude name="org/jboss/portal/test/**"/>
+ <exclude name="org/jboss/portal/portlet/tck/**"/>
+ </fileset>
+ </jar>
+
+ <!-- Portlet tck lib jar -->
+ <jar jarfile="${build.lib}/portal-portlet-tck-lib.jar">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/portlet/tck/**"/>
+ </jar>
+
+ <!-- TCK sar -->
+<!--
+ <copy todir="${build.resources}/tck-sar">
+ <fileset dir="${jboss.portal-common.root}/lib"
includes="portal-common-lib.jar"/>
+ <fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-lib.jar"/>
+ <fileset dir="${jboss.portlet-api.root}/lib"
includes="portlet-api-lib.jar"/>
+ <fileset dir="${jboss.portlet-api.root}/lib"
includes="portal-api-lib.jar"/>
+ <fileset dir="${jboss.portal-security.root}/lib"
includes="portal-security-lib.jar"/>
+ <fileset dir="${build.lib}"
includes="portal-portlet-lib.jar,portal-portlet-tck-lib.jar,test.war"/>
+ </copy>
+ <jar jarfile="${build.lib}/tck.sar">
+ <fileset dir="${build.resources}/tck-sar"/>
+ </jar>
+-->
+ </target>
+
+ <!-- create artifacts for running the portlet tests (except TCK) target output
should have already been executed -->
+ <target name="package-tests" depends="init">
+
+ <jar jarfile="${build.lib}/test.war">
+ <fileset dir="${build.resources}/test-war"/>
+ </jar>
+ <copy todir="${build.resources}/test-sar">
+ <fileset dir="${jboss.portal-common.root}/lib"
includes="portal-common-lib.jar"/>
+ <fileset dir="${jboss.portal-test.lib}"
includes="portal-test-lib.jar"/>
+ <fileset dir="${jboss.portal-jems.root}/lib"
includes="portal-jems-lib.jar"/>
+ <fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-lib.jar"/>
+ <fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-test-framework-lib.jar"/>
+ <fileset dir="${jboss.portal-security.root}/lib"
includes="portal-security-lib.jar"/>
+ <fileset dir="${jboss.portal-portlet.root}/lib"
includes="portal-portlet-lib.jar"/>
+ <fileset dir="${jboss.portal-portlet.root}/lib"
includes="portal-portlet-test-framework-lib.jar"/>
+ <fileset dir="${jboss.portlet-api.root}/lib"
includes="portlet-api-lib.jar"/>
+ <fileset dir="${jboss.portlet-api.root}/lib"
includes="portal-api-lib.jar"/>
+ <fileset dir="${junit.junit.lib}"
includes="junit.jar"/>
+ <fileset dir="${build.lib}"
includes="portal-portlet-server-lib.jar"/>
+ <fileset dir="${build.lib}" includes="test.war"/>
+ </copy>
+ <jar jarfile="${build.lib}/test.sar">
+ <fileset dir="${build.resources}/test-sar"/>
+ </jar>
+
+ <jar jarfile="${build.lib}/test-info.sar">
+ <fileset dir="${junit.junit.lib}"
includes="junit.jar"/>
+ <fileset dir="${jboss.portal-test.root}/lib"
includes="portal-test-lib.jar"/>
+ <fileset dir="${jboss.portal-common.root}/lib"
includes="portal-common-lib.jar"/>
+ <fileset dir="${jboss.portal-jems.root}/lib"
includes="portal-jems-lib.jar"/>
+ <fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-lib.jar"/>
+ <fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-test-lib.jar"/>
+ <fileset dir="${jboss.portal-server.root}/lib"
includes="portal-server-test-framework-lib.jar"/>
+ <fileset dir="${jboss.portlet-api.root}/lib"
includes="portlet-api-lib.jar"/>
+ <fileset dir="${jboss.portlet-api.root}/lib"
includes="portal-api-lib.jar"/>
+ <fileset dir="${jboss.portal-security.root}/lib"
includes="portal-security-lib.jar"/>
+ <fileset dir="${jboss.portal-portlet.root}/lib"
includes="portal-portlet-lib.jar"/>
+ <fileset dir="${jboss.portal-portlet.root}/lib"
includes="portal-portlet-test-framework-lib.jar"/>
+ <fileset dir="${jboss.portal-portlet.root}/lib"
includes="test-info.jar"/>
+ <fileset dir="${jboss.portal-portlet.root}/lib"
includes="test-info.war"/>
+ <fileset dir="${jboss.portal-server.lib}"
includes="test-agent.war"/>
+ <fileset dir="${build.lib}"
includes="portal-portlet-server-lib.jar"/>
+ <fileset dir="${build.resources}/test/info/test-info-sar"/>
+ </jar>
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean" depends="_default:clean">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs" depends="_default:docs">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main" depends="most"/>
+ <target name="all" depends="_default:all"/>
+ <target name="most" depends="_default:most"/>
+ <target name="help" depends="_default:help"/>
+
+ <!-- ================================================================== -->
+ <!-- Deployment -->
+ <!-- ================================================================== -->
+
+ <target name="deploy-tck"
+ description="Deploy."
+ depends="output">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <copy file="${build.lib}/tck.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"/>
+ </target>
+
+ <target name="undeploy-tck"
+ description="Undeploy."
+ depends="init">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/tck.sar"/>
+ </target>
+
+ <target name="tests" depends="init,
_buildmagic:configure:deployment">
+ <deploy file="${build.lib}/test.sar" config="default"/>
+ <antcall target="test-jsr168"/>
+ <undeploy file="${build.lib}/test.sar"
config="default"/>
+ <antcall target="test-info"/>
+ </target>
+
+ <target name="test-jsr168" depends="init">
+ <execute-tests>
+ <x-sysproperty>
+ <sysproperty key="test.root"
value="${jboss.portal-portlet.root}/lib"/>
+ <sysproperty key="test.uri"
value="/test/redirect/"/>
+<!--
+ <jvmarg value="-Xdebug"/>
+ <jvmarg
value="-Xrunjdwp:transport=dt_socket,address=7878,server=y,suspend=y"/>
+-->
+ </x-sysproperty>
+ <x-test>
+
+ <!--Spec TCK Assertions tests-->
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.DispatcherTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletConfigTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletContextTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletInterfaceTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletModeTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletRequestsTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletResponsesTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletSessionTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PortletURLTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.PreferencesTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.WindowStatesTestCase"/>
+
+ <!--API Tests-->
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.ActionRequestTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.ActionResponseTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortalContextTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortletConfigTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortletContextTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortletModeTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortletPreferencesTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortletSessionTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortletSessionUtilTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.PortletURLTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.RenderRequestTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.RenderResponseTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.api.WindowStateTestCase"/>
+
+ <!--Ext Tests-->
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.DispatcherTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.PortletConfigTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.PortletModeTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.PortletRequestsTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.PortletResponsesTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.PreferencesTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.SessionTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.ExpiringCacheTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.NeverExpiringCacheTestCase"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.NoCacheTestCase"/>
+
+ <!--Misc Tests-->
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.misc.Log4jTestCase"/>
+
+ </x-test>
+ <x-classpath>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="jboss.remoting.classpath"/>
+ <path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="apache.xerces.classpath"/>
+ <pathelement location="${source.java}"/>
+ <pathelement location="${build.classes}"/>
+ <pathelement location="${build.resources}"/>
+ <pathelement
location="${jboss.portal-portlet.root}/classes"/>
+ <path refid="library.classpath"/>
+ <path refid="dependentmodule.classpath"/>
+ </x-classpath>
+ </execute-tests>
+ </target>
+
+ <target name="test-info" depends="init">
+ <execute-tests>
+ <x-test>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.info.InfoTestCase"/>
+ </x-test>
+ <x-sysproperty>
+ <sysproperty key="test.root"
value="${jboss.portal-portlet.root}/lib"/>
+ <sysproperty key="test.uri"
value="/test/redirect/"/>
+ </x-sysproperty>
+ <x-classpath>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="jboss.remoting.classpath"/>
+ <path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="apache.xerces.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <pathelement location="${source.java}"/>
+ <pathelement location="${build.classes}"/>
+ <pathelement location="${build.resources}"/>
+ <pathelement
location="${jboss.portal-portlet.root}/classes"/>
+ <path refid="library.classpath"/>
+ <path refid="dependentmodule.classpath"/>
+ </x-classpath>
+ </execute-tests>
+ </target>
+
+ <target name="test-ha" depends="init">
+ <execute-tests>
+ <x-sysproperty>
+<!--
+ <jvmarg value="-Xdebug"/>
+ <jvmarg
value="-Xrunjdwp:transport=dt_socket,address=7878,server=y,suspend=y"/>
+-->
+ <sysproperty key="test.root"
value="${build.lib}"/>
+ <sysproperty key="test.uri"
value="/test/redirect/"/>
+ </x-sysproperty>
+ <x-test>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.ha.session.SessionTestCase"/>
+ </x-test>
+ <x-classpath>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="jboss.remoting.classpath"/>
+ <path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="apache.xerces.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <pathelement location="${source.java}"/>
+ <pathelement location="${build.classes}"/>
+ <pathelement location="${build.resources}"/>
+ <path refid="library.classpath"/>
+ <path refid="dependentmodule.classpath"/>
+ </x-classpath>
+ </execute-tests>
+ </target>
+
+ <target name="test2" depends="init">
+ <execute-tests>
+ <x-sysproperty>
+<!--
+ <jvmarg value="-Xdebug"/>
+ <jvmarg
value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"/>
+-->
+ <sysproperty key="test.root"
value="${build.lib}"/>
+ <sysproperty key="test.uri"
value="/test/redirect/"/>
+ </x-sysproperty>
+ <x-test>
+
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.ha.session.SessionTestSuite"/>-->
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.info.InfoTestSuite"/>-->
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.session.SessionSynchronizationTestCase"/>-->
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.PortletRequestDecoderTestCase"/>-->
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.preferences.PreferencesTestSuite"/>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.tck.preferences.PreferencesTestSuite"/>-->
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.portletrequests.PortletRequestTestSuite"/>-->
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.dispatcher.DispatcherTestSuite"/>-->
+
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.info.InfoTestSuite"/>-->
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.deployment.UnmarshallerTestCase"/>-->
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.PortletRequestDecoderTestCase"/>-->
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.state.StatefulPortletInvokerTestCase"/>-->
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.portletrequests.PortletRequestTestSuite"/>-->
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.dispatcher.DispatcherTestSuite"/>-->
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.jsr168.ext.portletrequests.PortletRequestTestSuite"/>-->
+
+ <!--test todir="${test.reports}"
name="org.jboss.portal.test.portlet.ParametersTestCase"/-->
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.portlet.state.StateConverterV0TestCase"/>-->
+
+ </x-test>
+ <x-classpath>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="jboss.remoting.classpath"/>
+ <path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="apache.xerces.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <pathelement location="${source.java}"/>
+ <pathelement location="${build.classes}"/>
+ <pathelement location="${build.resources}"/>
+ <path refid="library.classpath"/>
+ <path refid="dependentmodule.classpath"/>
+ </x-classpath>
+ </execute-tests>
+ </target>
+
+</project>
Property changes on: trunk/portlet-server/build.xml
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/portlet-server/src/main/org/jboss/portal/portlet/aspects/portlet/ContextTrackerInterceptor.java
===================================================================
---
trunk/portlet-server/src/main/org/jboss/portal/portlet/aspects/portlet/ContextTrackerInterceptor.java
(rev 0)
+++
trunk/portlet-server/src/main/org/jboss/portal/portlet/aspects/portlet/ContextTrackerInterceptor.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * 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.jboss.portal.portlet.aspects.portlet;
+
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.portlet.invocation.PortletInterceptor;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+
+/**
+ * This interceptor get the current webapp context path and adds it to the set of the
collected context path.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class ContextTrackerInterceptor extends PortletInterceptor
+{
+ protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
+ {
+ //
+ String contextPath =
(String)invocation.getDispatchedRequest().getAttribute("javax.servlet.include.context_path");
+
+ // Add it to the request context path set
+
org.jboss.portal.server.aspects.server.SessionInvalidatorInterceptor.getSet().add(contextPath);
+
+ // Invoke next command
+ return invocation.invokeNext();
+ }
+}
Property changes on:
trunk/portlet-server/src/main/org/jboss/portal/portlet/aspects/portlet/ContextTrackerInterceptor.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/portlet-server/src/main/org/jboss/portal/portlet/container/runtime/PortletRuntimeContextImpl.java
===================================================================
---
trunk/portlet-server/src/main/org/jboss/portal/portlet/container/runtime/PortletRuntimeContextImpl.java
(rev 0)
+++
trunk/portlet-server/src/main/org/jboss/portal/portlet/container/runtime/PortletRuntimeContextImpl.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,138 @@
+/******************************************************************************
+ * 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.jboss.portal.portlet.container.runtime;
+
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.spi.RequestContext;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.container.runtime.PortletRuntimeContext;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.PortletApplication;
+import org.jboss.portal.server.servlet.CommandServlet;
+import org.jboss.portal.server.servlet.ServletCommand;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletRuntimeContextImpl implements PortletRuntimeContext
+{
+
+ /** . */
+ private static final ThreadLocal localResponse = new ThreadLocal();
+
+ public Object dispatch(HttpServletRequest req, HttpServletResponse resp,
PortletApplication portletApplication, RequestDispatchCallback callback, Object handback)
throws Exception // Callback maybe lol
+ {
+ try
+ {
+ // Target servlet context
+ ServletContext targetCtx = portletApplication.getContext().getServletContext();
+
+ //
+ ServletCommand cmd = new InvokeNextCommand(callback, handback);
+
+ //
+ CommandServlet.include(req, resp, cmd, targetCtx);
+
+ // Rethrow any InvocationException
+ Object response = localResponse.get();
+
+ //
+ if (response instanceof Exception)
+ {
+ throw (Exception)response;
+ }
+ else
+ {
+ return response;
+ }
+ }
+ catch (IOException e)
+ {
+ throw new PortletInvokerException(e);
+ }
+ catch (ServletException e)
+ {
+ // Unwrap underlying exception if any
+ Throwable t = e.getRootCause();
+
+ //
+ if (t instanceof Error)
+ {
+ // Rethrow any error
+ throw(Error)t;
+ }
+ else if (t == null)
+ {
+ // If no nested exception use the servlet exception
+ t = e;
+ }
+
+ //
+ throw new PortletInvokerException(t);
+ }
+ finally
+ {
+ localResponse.set(null);
+ }
+ }
+
+ public static class InvokeNextCommand implements ServletCommand
+ {
+
+ /** . */
+ private final RequestDispatchCallback invocation;
+
+ /** . */
+ private final Object handback;
+
+ public InvokeNextCommand(RequestDispatchCallback invocation, Object handback)
+ {
+ this.invocation = invocation;
+ this.handback = handback;
+ }
+
+ public void execute(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException
+ {
+ try
+ {
+ Object response = invocation.doCallback(req, resp, handback);
+
+ //
+ localResponse.set(response);
+ }
+ catch (Exception e)
+ {
+ localResponse.set(e);
+ }
+ }
+ }
+}
Added:
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
===================================================================
---
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
(rev 0)
+++
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,398 @@
+/******************************************************************************
+ * 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.jboss.portal.portlet.deployment.jboss;
+
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData;
+import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData;
+import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData;
+import org.jboss.beans.metadata.plugins.AbstractParameterMetaData;
+import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData;
+import org.jboss.deployment.DeploymentException;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.common.xml.NullEntityResolver;
+import org.jboss.portal.portlet.container.PortletApplicationContextImpl;
+import org.jboss.portal.portlet.container.PortletApplicationRegistry;
+import org.jboss.portal.portlet.deployment.JBossApplicationMetaDataFactory;
+import org.jboss.portal.portlet.deployment.PortletApplicationMetaDataFactory;
+import org.jboss.portal.portlet.deployment.ValueTrimmingFilter;
+import org.jboss.portal.portlet.impl.jsr168.APIFactory;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletApplicationMetaData;
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.deployment.jboss.PortletContainerAdapter;
+import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+import org.jboss.portal.portlet.metadata.PolicyPermissionMetaData;
+import org.jboss.portal.portlet.metadata.SecurityConstraintMetaData;
+import org.jboss.portal.portlet.security.PortletSecurityService;
+import org.jboss.portal.security.RoleSecurityBinding;
+import org.jboss.portal.security.SecurityConstants;
+import org.jboss.portal.security.spi.provider.AuthorizationDomain;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+import org.jboss.portal.security.spi.provider.SecurityConfigurationException;
+import org.jboss.portal.server.deployment.PortalWebApp;
+import org.jboss.portal.server.deployment.jboss.Deployment;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.xml.sax.EntityResolver;
+
+import javax.management.MBeanServer;
+import javax.servlet.ServletContext;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6713 $
+ */
+public class PortletAppDeployment extends Deployment
+{
+
+ /** The existing configurations. */
+ protected Map configurations;
+
+ /** . */
+ protected PortletApplicationMetaData portletAppMD;
+
+ /** . */
+ protected JBossApplicationMetaData jbossAppMD;
+
+ /** . */
+ protected PortletAppDeploymentFactory factory;
+
+ /** . */
+ protected Kernel kernel;
+
+ /** . */
+ protected List beans;
+
+ public PortletAppDeployment(URL url, PortalWebApp pwa, MBeanServer mbeanServer,
PortletAppDeploymentFactory factory)
+ {
+ super(url, pwa, mbeanServer);
+ this.factory = factory;
+ }
+
+ public void create() throws DeploymentException
+ {
+ importTLD();
+
+ //
+ beans = new ArrayList();
+
+ //
+ try
+ {
+ BasicBootstrap bootstrap = new BasicBootstrap();
+ bootstrap.run();
+ kernel = bootstrap.getKernel();
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException(e);
+ }
+
+ //
+ try
+ {
+ portletAppMD = buildPortletApplicationMetaData();
+ jbossAppMD = buildJBossApplicationMetaData();
+
+ // Merge or provide defaults
+ JBossApplicationMetaData standardJBossAppMD =
factory.getStandardJBossApplicationMetaData();
+ log.debug("Found standard jboss app meta data");
+
+ if (standardJBossAppMD != null)
+ {
+ JBossPortletMetaData defaultJBossPortletMD =
(JBossPortletMetaData)standardJBossAppMD.getPortlets().get("DefaultPortlet");
+ log.debug("Found default jboss portlet meta data");
+ if (defaultJBossPortletMD != null)
+ {
+ for (Iterator i = portletAppMD.getPortlets().iterator(); i.hasNext();)
+ {
+ PortletMetaData portletMD = (PortletMetaData)i.next();
+ String name = portletMD.getName();
+ JBossPortletMetaData jbossPortletMD =
(JBossPortletMetaData)jbossAppMD.getPortlets().get(name);
+ if (jbossPortletMD != null)
+ {
+ log.debug("Merging default jboss portlet meta data for " +
name);
+
+ // Merge with app settings
+ jbossPortletMD.merge(jbossAppMD); // todo: remove since it
shouldn't be needed anymore with the adding of merge in factory...
+
+ // Merge with default portlet
+ jbossPortletMD.merge(defaultJBossPortletMD);
+ }
+ else
+ {
+ log.debug("Using default jboss portlet meta data for " +
name);
+ jbossAppMD.getPortlets().put(name, defaultJBossPortletMD.clone());
+ }
+ }
+ }
+ }
+ }
+ catch (Throwable e)
+ {
+ throw new DeploymentException("Cannot deploy portlet application",
e);
+ }
+ }
+
+ public void start() throws DeploymentException
+ {
+ try
+ {
+ // Controller meta data
+ AbstractBeanMetaData webAppBMD = new AbstractBeanMetaData(
+ "portal:container=WebApp,id=" + portletAppMD.getId(),
+ PortletApplicationContextImpl.class.getName());
+
+ // Constructor
+ AbstractConstructorMetaData webAppCMD = new AbstractConstructorMetaData();
+ List webAppParamsCMD = new ArrayList();
+ webAppParamsCMD.add(new
AbstractParameterMetaData(PortletApplicationRegistry.class.getName(),
factory.getWebAppRegistry()));
+ webAppParamsCMD.add(new AbstractParameterMetaData(APIFactory.class.getName(),
factory.getAPIFactory()));
+ webAppParamsCMD.add(new AbstractParameterMetaData(portletAppMD));
+ webAppParamsCMD.add(new
AbstractParameterMetaData(JBossApplicationMetaData.class.getName(), jbossAppMD));
+ webAppParamsCMD.add(new
AbstractParameterMetaData(ServletContext.class.getName(), pwa.getServletContext()));
+ webAppParamsCMD.add(new AbstractParameterMetaData(ClassLoader.class.getName(),
pwa.getClassLoader()));
+ webAppCMD.setParameters(webAppParamsCMD);
+ webAppBMD.setConstructor(webAppCMD);
+
+ // Installation
+ beans.add(webAppBMD);
+ kernel.getController().install(webAppBMD);
+
+ // Install portlet containers
+ for (Iterator i = portletAppMD.getPortlets().iterator(); i.hasNext();)
+ {
+ PortletMetaData portletMD = (PortletMetaData)i.next();
+
+ // Get specific dd meta data
+ JBossPortletMetaData jbossPortletMD =
(JBossPortletMetaData)jbossAppMD.getPortlets().get(portletMD.getName());
+
+ // Controller meta data
+ AbstractBeanMetaData containerBMD = new AbstractBeanMetaData(
+ "portal:container=Portlet,id=" + portletAppMD.getId() +
"." + portletMD.getName(),
+ PortletContainerAdapter.class.getName());
+
+ // Constructor
+ AbstractConstructorMetaData containerCMD = new
AbstractConstructorMetaData();
+ List containerParamsCMD = new ArrayList();
+ containerParamsCMD.add(new AbstractParameterMetaData(portletMD));
+ containerParamsCMD.add(new
AbstractParameterMetaData(JBossPortletMetaData.class.getName(), jbossPortletMD));
+ containerCMD.setParameters(containerParamsCMD);
+ containerBMD.setConstructor(containerCMD);
+
+ // Properties
+ HashSet containerProps = new HashSet();
+ containerProps.add(new
AbstractPropertyMetaData("portletWebAppAdapter", new
AbstractDependencyValueMetaData(webAppBMD.getName())));
+ containerBMD.setProperties(containerProps);
+
+ // Dependencies
+ HashSet portletContainerDmds = new HashSet();
+ portletContainerDmds.add(new
AbstractDependencyMetaData(webAppBMD.getName()));
+ containerBMD.setDemands(portletContainerDmds);
+
+ // Installation
+ beans.add(containerBMD);
+ kernel.getController().install(containerBMD);
+ }
+ }
+ catch (Throwable e)
+ {
+ throw new DeploymentException("Cannot deploy portlet application",
e);
+ }
+
+ // Configure security
+ PortletSecurityService portletSecurityService =
factory.getPortletSecurityService();
+ if (portletSecurityService != null)
+ {
+ AuthorizationDomain authDomain =
portletSecurityService.getAuthorizationDomain();
+ DomainConfigurator domainConfigurator = authDomain.getConfigurator();
+
+ //
+ for (Iterator i = jbossAppMD.getPortlets().values().iterator(); i.hasNext();)
+ {
+ JBossPortletMetaData portletMD = (JBossPortletMetaData)i.next();
+ SecurityConstraintMetaData securityConstraintMD =
portletMD.getSecurityConstraint();
+
+ //
+ if (securityConstraintMD == null)
+ {
+ securityConstraintMD = new SecurityConstraintMetaData();
+ PolicyPermissionMetaData policyPermission = new
PolicyPermissionMetaData();
+ policyPermission.setRoleName(SecurityConstants.UNCHECKED_ROLE_NAME);
+ policyPermission.getActions().add("view");
+
securityConstraintMD.getPolicyPermissions().put(SecurityConstants.UNCHECKED_ROLE_NAME,
policyPermission);
+ }
+
+ //
+ Set bindings = new HashSet();
+ for (Iterator j =
securityConstraintMD.getPolicyPermissions().values().iterator(); j.hasNext();)
+ {
+ PolicyPermissionMetaData policyPermissionMD =
(PolicyPermissionMetaData)j.next();
+ RoleSecurityBinding binding = new
RoleSecurityBinding(policyPermissionMD.getActions(), policyPermissionMD.getRoleName());
+ bindings.add(binding);
+ }
+
+ //
+ try
+ {
+ String portletId = pwa.getId() + "." + portletMD.getName();
+ domainConfigurator.setSecurityBindings(portletId, bindings);
+ }
+ catch (SecurityConfigurationException e)
+ {
+ log.error("Error in configuration", e);
+ }
+ }
+ }
+
+ //
+ super.start();
+ }
+
+ public void stop() throws DeploymentException
+ {
+ PortletSecurityService portletSecurityService =
factory.getPortletSecurityService();
+ if (portletSecurityService != null)
+ {
+ AuthorizationDomain authDomain =
portletSecurityService.getAuthorizationDomain();
+ DomainConfigurator domainConfigurator = authDomain.getConfigurator();
+ for (Iterator i = portletAppMD.getPortlets().iterator(); i.hasNext();)
+ {
+ PortletMetaData portletMD = (PortletMetaData)i.next();
+
+ //
+ try
+ {
+ String portletId = pwa.getId() + "." + portletMD.getName();
+ domainConfigurator.removeSecurityBindings(portletId);
+ }
+ catch (SecurityConfigurationException e)
+ {
+ log.error("Error in configuration", e);
+ }
+ }
+ }
+
+ //
+ super.stop();
+ }
+
+ public void destroy() throws DeploymentException
+ {
+ for (int i = beans.size() - 1; i >= 0; i--)
+ {
+ AbstractBeanMetaData bmd = (AbstractBeanMetaData)beans.get(i);
+ kernel.getController().uninstall(bmd.getName());
+ }
+ }
+
+ /** Import the portlet jsp tag TLD in the deployed application. */
+ protected void importTLD()
+ {
+ InputStream sourceTLD = null;
+ try
+ {
+ sourceTLD =
Tools.safeBufferedWrapper(Thread.currentThread().getContextClassLoader().getResourceAsStream("org/jboss/portal/portlet/portlet.tld"));
+ pwa.importFile("/WEB-INF", "portlet.tld", sourceTLD,
false);
+ }
+ catch (IOException e)
+ {
+ log.warn("Cannot copy TLD file to the portlet application", e);
+ }
+ finally
+ {
+ Tools.safeClose(sourceTLD);
+ }
+ }
+
+ protected PortletApplicationMetaData buildPortletApplicationMetaData() throws
Exception
+ {
+ InputStream in = null;
+ try
+ {
+ in = Tools.safeBufferedWrapper(url.openStream());
+ PortletApplicationMetaDataFactory factory = new
PortletApplicationMetaDataFactory();
+ Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
+ PortletApplicationMetaData portletAppMD =
(PortletApplicationMetaData)unmarshaller.unmarshal(in, new ValueTrimmingFilter(factory),
null);
+ portletAppMD.setId(pwa.getId());
+ return portletAppMD;
+ }
+ finally
+ {
+ Tools.safeClose(in);
+ }
+ }
+
+ protected JBossApplicationMetaData buildJBossApplicationMetaData()
+ {
+ JBossApplicationMetaData jbossAppMD = new JBossApplicationMetaData();
+ ServletContext servletContext = pwa.getServletContext();
+ String contextPath = pwa.getContextPath();
+ InputStream in = null;
+ try
+ {
+ in =
Tools.safeBufferedWrapper(servletContext.getResourceAsStream("/WEB-INF/jboss-portlet.xml"));
+ if (in != null)
+ {
+ log.debug("Parsing jboss-portlet.xml" + contextPath);
+
+ //
+ JBossApplicationMetaDataFactory factory =
this.factory.createJBossApplicationMetaDataFactory();
+ Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
+ EntityResolver entityResolver =
this.factory.getJBossPortletEntityResolver();
+ if (entityResolver == null)
+ {
+ log.debug("Coult not obtain entity resolver for
jboss-portlet.xml");
+ entityResolver = new NullEntityResolver();
+ }
+ else
+ {
+ log.debug("Obtained entity resolver " + entityResolver + "
for jboss-portlet.xml");
+ }
+ unmarshaller.setEntityResolver(entityResolver);
+ jbossAppMD = (JBossApplicationMetaData)unmarshaller.unmarshal(in, new
ValueTrimmingFilter(factory), null);
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ Tools.safeClose(in);
+ }
+ return jbossAppMD;
+ }
+}
Property changes on:
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeployment.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java
===================================================================
---
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java
(rev 0)
+++
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,231 @@
+/******************************************************************************
+ * 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.jboss.portal.portlet.deployment.jboss;
+
+import org.jboss.deployment.DeploymentException;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.portlet.container.PortletApplicationRegistry;
+import org.jboss.portal.portlet.deployment.JBossApplicationMetaDataFactory;
+import org.jboss.portal.portlet.deployment.ValueTrimmingFilter;
+import org.jboss.portal.portlet.impl.jsr168.APIFactory;
+import org.jboss.portal.portlet.impl.jsr168.APIFactoryImpl;
+import org.jboss.portal.portlet.metadata.JBossApplicationMetaData;
+import org.jboss.portal.portlet.security.PortletSecurityService;
+import org.jboss.portal.server.config.ServerConfig;
+import org.jboss.portal.server.deployment.PortalWebApp;
+import org.jboss.portal.server.deployment.jboss.AbstractDeploymentFactory;
+import org.jboss.portal.server.deployment.jboss.Deployment;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.xml.sax.EntityResolver;
+
+import javax.management.MBeanServer;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * todo : remove unused ConfigService
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6713 $
+ */
+public class PortletAppDeploymentFactory extends AbstractDeploymentFactory
+{
+
+ /** . */
+ protected static final Pattern urlPattern =
Pattern.compile(".*/portlet\\.xml");
+
+ /** . */
+ protected PortletApplicationRegistry portletApplicationRegistry;
+
+ /** . */
+ protected ServerConfig config;
+
+ /** . */
+ protected String apiFactoryClassName;
+
+ /** . */
+ protected APIFactory apiFactory;
+
+ /** . */
+ protected PortletSecurityService portletSecurityService;
+
+ /** . */
+ protected String standardJBossApplicationMetaDataLocation;
+
+ /** . */
+ protected JBossApplicationMetaData standardJBossApplicationMetaData;
+
+ /** . */
+ protected EntityResolver jbossPortletEntityResolver;
+
+ public EntityResolver getJBossPortletEntityResolver()
+ {
+ return jbossPortletEntityResolver;
+ }
+
+ public void setJBossPortletEntityResolver(EntityResolver jbossPortletEntityResolver)
+ {
+ this.jbossPortletEntityResolver = jbossPortletEntityResolver;
+ }
+
+ public ServerConfig getConfig()
+ {
+ return config;
+ }
+
+ public void setConfig(ServerConfig config)
+ {
+ this.config = config;
+ }
+
+ public String getAPIFactoryClassName()
+ {
+ return apiFactoryClassName;
+ }
+
+ public void setAPIFactoryClassName(String apiFactoryClassName)
+ {
+ this.apiFactoryClassName = apiFactoryClassName;
+ }
+
+ public PortletApplicationRegistry getWebAppRegistry()
+ {
+ return portletApplicationRegistry;
+ }
+
+ public void setWebAppRegistry(PortletApplicationRegistry portletApplicationRegistry)
+ {
+ this.portletApplicationRegistry = portletApplicationRegistry;
+ }
+
+ public String getStandardJBossApplicationMetaDataLocation()
+ {
+ return standardJBossApplicationMetaDataLocation;
+ }
+
+ public void setStandardJBossApplicationMetaDataLocation(String
standardJBossApplicationMetaDataLocation)
+ {
+ this.standardJBossApplicationMetaDataLocation =
standardJBossApplicationMetaDataLocation;
+ }
+
+ public JBossApplicationMetaData getStandardJBossApplicationMetaData()
+ {
+ return standardJBossApplicationMetaData;
+ }
+
+ public APIFactory getAPIFactory()
+ {
+ return apiFactory;
+ }
+
+ public boolean acceptFile(URL url)
+ {
+ String urlAsFile = url.getFile();
+ Matcher matcher = urlPattern.matcher(urlAsFile);
+ return matcher.matches();
+ }
+
+ public Deployment newInstance(URL url, PortalWebApp pwa, MBeanServer mbeanServer)
throws DeploymentException
+ {
+ return new PortletAppDeployment(url, pwa, mbeanServer, this);
+ }
+
+ public void start() throws Exception
+ {
+ //
+ try
+ {
+ apiFactory = new APIFactoryImpl();
+
+ // Try to load
+ if (apiFactoryClassName != null)
+ {
+ Class apiFactoryClass =
Thread.currentThread().getContextClassLoader().loadClass(apiFactoryClassName);
+ apiFactory = (APIFactory)apiFactoryClass.newInstance();
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Cannot create portlet APIFactory=" + apiFactoryClassName +
" will use default one instead", e);
+ }
+
+ //
+ loadStandardJBossApplicationMetaData();
+
+ //
+ super.start();
+ }
+
+ public void loadStandardJBossApplicationMetaData()
+ {
+ if (standardJBossApplicationMetaDataLocation != null)
+ {
+ InputStream in = null;
+ try
+ {
+ in =
Tools.safeBufferedWrapper(Thread.currentThread().getContextClassLoader().getResourceAsStream(standardJBossApplicationMetaDataLocation));
+ if (in != null)
+ {
+ JBossApplicationMetaDataFactory factory =
createJBossApplicationMetaDataFactory();
+ Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
+ standardJBossApplicationMetaData =
(JBossApplicationMetaData)unmarshaller.unmarshal(in, new ValueTrimmingFilter(factory),
null);
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ Tools.safeClose(in);
+ }
+ }
+ }
+
+ public void stop()
+ {
+ super.stop();
+
+ //
+ apiFactory = null;
+ }
+
+ public PortletSecurityService getPortletSecurityService()
+ {
+ return portletSecurityService;
+ }
+
+ public void setPortletSecurityService(PortletSecurityService portletSecurityService)
+ {
+ this.portletSecurityService = portletSecurityService;
+ }
+
+ /** Subclasses can provide a subclass of JBossApplicationMetaDataFactory. */
+ public JBossApplicationMetaDataFactory createJBossApplicationMetaDataFactory()
+ {
+ return new JBossApplicationMetaDataFactory();
+ }
+}
Property changes on:
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletAppDeploymentFactory.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletContainerAdapter.java
===================================================================
---
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletContainerAdapter.java
(rev 0)
+++
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletContainerAdapter.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,89 @@
+/******************************************************************************
+ * 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.jboss.portal.portlet.deployment.jboss;
+
+import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
+import org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl;
+import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
+import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
+import org.jboss.portal.portlet.container.PortletApplicationContextImpl;
+import org.jboss.portal.portlet.container.PortletContainer;
+
+/**
+ * Adapt the life cycle of micro container to the portlet container impl.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6700 $
+ */
+public class PortletContainerAdapter
+{
+
+ /** . */
+ private PortletMetaData portletMD;
+
+ /** . */
+ private JBossPortletMetaData jbossPortletMD;
+
+ /** . */
+ private PortletApplicationContextImpl portletApplicationContext;
+
+ /** . */
+ private PortletContainerImpl portletContainer;
+
+ public PortletContainerAdapter(PortletMetaData portletMD, JBossPortletMetaData
jbossPortletMD)
+ {
+ this.portletMD = portletMD;
+ this.jbossPortletMD = jbossPortletMD;
+ }
+
+ public PortletApplicationContextImpl getPortletApplicationContext()
+ {
+ return portletApplicationContext;
+ }
+
+ public void setPortletWebAppAdapter(PortletApplicationContextImpl
portletApplicationContext)
+ {
+ this.portletApplicationContext = portletApplicationContext;
+ }
+
+ public PortletContainer getPortletContainer()
+ {
+ return portletContainer;
+ }
+
+ public void start() throws Exception
+ {
+ PortletApplicationImpl portletApp =
portletApplicationContext.getPortletApplication();
+ portletContainer = new PortletContainerImpl(portletApp, portletMD,
jbossPortletMD);
+ portletContainer.start();
+ portletApp.addContainer(portletContainer);
+ }
+
+ public void stop()
+ {
+ PortletApplicationImpl portletApp =
portletApplicationContext.getPortletApplication();
+ portletApp.removeContainer(portletContainer);
+ portletContainer.stop();
+ portletContainer = null;
+ }
+}
Property changes on:
trunk/portlet-server/src/main/org/jboss/portal/portlet/deployment/jboss/PortletContainerAdapter.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/portlet-server/src/main/org/jboss/portal/portlet/impl/security/JBossPortletSecurityService.java
===================================================================
---
trunk/portlet-server/src/main/org/jboss/portal/portlet/impl/security/JBossPortletSecurityService.java
(rev 0)
+++
trunk/portlet-server/src/main/org/jboss/portal/portlet/impl/security/JBossPortletSecurityService.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,182 @@
+/******************************************************************************
+ * 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.jboss.portal.portlet.impl.security;
+
+import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
+import org.jboss.portal.portlet.security.PortletPermission;
+import org.jboss.portal.portlet.security.PortletSecurityService;
+import org.jboss.portal.security.PortalPermission;
+import org.jboss.portal.security.PortalPermissionCollection;
+import org.jboss.portal.security.PortalSecurityException;
+import org.jboss.portal.security.RoleSecurityBinding;
+import org.jboss.portal.security.SecurityConstants;
+import org.jboss.portal.security.impl.JBossAuthorizationDomainRegistry;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
+import org.jboss.portal.security.spi.provider.AuthorizationDomain;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+import org.jboss.portal.security.spi.provider.PermissionFactory;
+import org.jboss.portal.security.spi.provider.PermissionRepository;
+import org.jboss.portal.security.spi.provider.SecurityConfigurationException;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * Service that configures security for portlets.
+ *
+ * @author <a href="mailto:Anil.Saldhana@jboss.org">Anil
Saldhana</a>
+ * @version $Revision: 6712 $
+ * @since Mar 17, 2006
+ */
+public class JBossPortletSecurityService implements PortletSecurityService,
+ AuthorizationDomain, DomainConfigurator, PermissionRepository, PermissionFactory
+{
+
+ /** . */
+ protected ConcurrentReaderHashMap securityConstraintsMap;
+
+ /** . */
+ protected PortalAuthorizationManagerFactory portalAuthorizationManagerFactory;
+
+ /** . */
+ protected JBossAuthorizationDomainRegistry authorizationDomainRegistry;
+
+ public AuthorizationDomain getAuthorizationDomain()
+ {
+ return this;
+ }
+
+ //*************************************************************
+ // AuthorizationDomain Interface Methods
+ //*************************************************************
+ public String getType()
+ {
+ return PortletPermission.PERMISSION_TYPE;
+ }
+
+ public DomainConfigurator getConfigurator()
+ {
+ return this;
+ }
+
+ public PermissionRepository getPermissionRepository()
+ {
+ return this;
+ }
+
+ public PermissionFactory getPermissionFactory()
+ {
+ return this;
+ }
+
+ public Set getSecurityBindings(String uri)
+ {
+ return (Set)securityConstraintsMap.get(uri);
+ }
+
+ public void setSecurityBindings(String uri, Set securityBindings) throws
SecurityConfigurationException
+ {
+ this.securityConstraintsMap.put(uri, securityBindings);
+ }
+
+ public void removeSecurityBindings(String uri) throws SecurityConfigurationException
+ {
+ this.securityConstraintsMap.remove(uri);
+ }
+
+ public PortalPermission getPermission(String roleName, String uri) throws
PortalSecurityException
+ {
+ Set set = getSecurityBindings(uri);
+ if (set != null && !set.isEmpty())
+ {
+ for (Iterator i = set.iterator(); i.hasNext();)
+ {
+ RoleSecurityBinding sc = (RoleSecurityBinding)i.next();
+ String constraintRoleName = sc.getRoleName();
+ if (constraintRoleName.equals(roleName) ||
+ SecurityConstants.UNCHECKED_ROLE_NAME.equals(constraintRoleName))
+ {
+ return createPermission(uri, sc.getActions());
+ }
+ }
+ }
+ return null;
+ }
+
+ public PortalPermission createPermissionContainer(PortalPermissionCollection
collection) throws PortalSecurityException
+ {
+ return new PortletPermission(collection);
+ }
+
+ public PortalPermission createPermission(String uri, String action) throws
PortalSecurityException
+ {
+ return new PortletPermission(uri, action);
+ }
+
+ public PortalPermission createPermission(String uri, Collection actions) throws
PortalSecurityException
+ {
+ return new PortletPermission(uri, actions);
+ }
+
+ public void create() throws Exception
+ {
+ this.securityConstraintsMap = new ConcurrentReaderHashMap();
+ }
+
+ public void start() throws Exception
+ {
+ // Add ourself as the authorization domain
+ authorizationDomainRegistry.addDomain(this);
+ }
+
+ public void stop() throws Exception
+ {
+ authorizationDomainRegistry.removeDomain(this);
+ }
+
+ public void destroy()
+ {
+ securityConstraintsMap = null;
+ }
+
+ public JBossAuthorizationDomainRegistry getAuthorizationDomainRegistry()
+ {
+ return authorizationDomainRegistry;
+ }
+
+ public void setAuthorizationDomainRegistry(JBossAuthorizationDomainRegistry
authorizationDomainRegistry)
+ {
+ this.authorizationDomainRegistry = authorizationDomainRegistry;
+ }
+
+ public PortalAuthorizationManagerFactory getPortalAuthorizationManagerFactory()
+ {
+ return portalAuthorizationManagerFactory;
+ }
+
+ public void setPortalAuthorizationManagerFactory(PortalAuthorizationManagerFactory
portalAuthorizationManagerFactory)
+ {
+ this.portalAuthorizationManagerFactory = portalAuthorizationManagerFactory;
+ }
+}
Property changes on:
trunk/portlet-server/src/main/org/jboss/portal/portlet/impl/security/JBossPortletSecurityService.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/portlet-server/src/main/org/jboss/portal/portlet/security/PortletPermission.java
===================================================================
---
trunk/portlet-server/src/main/org/jboss/portal/portlet/security/PortletPermission.java
(rev 0)
+++
trunk/portlet-server/src/main/org/jboss/portal/portlet/security/PortletPermission.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,242 @@
+/******************************************************************************
+ * 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.jboss.portal.portlet.security;
+
+import org.jboss.portal.security.PortalPermissionCollection;
+import org.jboss.portal.security.PortalSecurityException;
+import org.jboss.portal.security.PortalPermission;
+import org.jboss.portal.security.spi.provider.PermissionRepository;
+
+import javax.security.auth.Subject;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.StringTokenizer;
+import java.security.Permission;
+
+/**
+ * The permission for instance.
+ *
+ * @author <a href="mailto:anil.saldhana@jboss.org">Anil
Saldhana</a>
+ * @version $Revision$
+ */
+public final class PortletPermission extends PortalPermission
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 8445291296726152562L;
+
+ /** The view action name. */
+ public static final String VIEW_ACTION = "view";
+
+ /** The view action name. */
+// public static final String INSTANTIATE_ACTION = "instantiate";
+
+ /** The view action name. */
+// public static final String PERSONALIZE_ACTION = "personalize";
+
+ /** . */
+ public static final int VIEW_MASK = 0x01;
+
+ /** . */
+// public static final int INSTANTIATE_MASK = 0x02;
+
+ /** . */
+// public static final int PERSONALIZE_MASK = 0x04;
+
+ /** The imply mask. */
+ private int mask;
+
+ /** The actions string. */
+ private String actions;
+
+ /** . */
+ public static final String PERMISSION_TYPE = "portlet";
+
+ /** The action names. */
+ private static final String[] ACTION_NAMES = {VIEW_ACTION};
+
+ public PortletPermission(PortalPermissionCollection collection)
+ {
+ super("portletpermission", collection);
+ }
+
+ public PortletPermission(String uri, int mask)
+ {
+ super("portletpermission", uri);
+ this.mask = mask;
+ }
+
+ public PortletPermission(String uri, Collection actions)
+ {
+ super("portletpermission", uri);
+ if (actions == null)
+ {
+ throw new IllegalArgumentException("Actions agurment cannot be
null");
+ }
+
+ //
+ for (Iterator i = actions.iterator(); i.hasNext();)
+ {
+ String action = (String)i.next();
+ addAction(action);
+ }
+ }
+
+ public PortletPermission(String uri, String actions)
+ {
+ super("portletpermission", uri);
+ if (actions == null)
+ {
+ throw new IllegalArgumentException("Actions agurment cannot be
null");
+ }
+
+ // Parse the actions into the mask
+ StringTokenizer tokenizer = new StringTokenizer(actions, ",");
+ while (tokenizer.hasMoreTokens())
+ {
+ String action = tokenizer.nextToken();
+ addAction(action);
+ }
+ }
+
+ private void addAction(String action) throws IllegalArgumentException
+ {
+ if (VIEW_ACTION.equals(action))
+ {
+ mask |= VIEW_MASK;
+ }
+// else if (INSTANTIATE_ACTION.equals(action))
+// {
+// mask |= INSTANTIATE_MASK;
+// }
+// else if (PERSONALIZE_ACTION.equals(action))
+// {
+// mask |= PERSONALIZE_MASK;
+// }
+ else
+ {
+ throw new IllegalArgumentException("Illegal action " + action);
+ }
+ }
+
+ public boolean implies(PermissionRepository repository, Subject caller, String
roleName, PortalPermission permission) throws PortalSecurityException
+ {
+ if (permission instanceof PortletPermission)
+ {
+ PortletPermission pp = (PortletPermission)permission;
+
+ // If no uri then the permission is a container
+ if (pp.isContainer())
+ {
+ return false;
+ }
+ else
+ {
+ String uri = pp.getURI();
+ PortalPermission loaded = repository.getPermission(roleName, uri);
+ if (loaded != null && loaded.implies(pp))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean implies(Permission permission)
+ {
+ if (permission instanceof PortletPermission && isContainer() == false)
+ {
+ PortletPermission that = (PortletPermission)permission;
+
+ //
+ if (that.isContainer() == false && that.uri.equals(this.uri))
+ {
+ return (this.mask & that.mask) == that.mask;
+ }
+ }
+ return false;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof PortletPermission)
+ {
+ PortletPermission that = (PortletPermission)obj;
+ if (this.isContainer())
+ {
+ return that.isContainer();
+ }
+ return this.mask == that.mask && this.uri.equals(that.uri);
+ }
+ return false;
+ }
+
+ public int hashCode()
+ {
+ if (isContainer())
+ {
+ return 0;
+ }
+ else
+ {
+ return uri.hashCode() * 43 + mask;
+ }
+ }
+
+ public String getActions()
+ {
+ if (actions == null)
+ {
+ StringBuffer tmp = new StringBuffer();
+
+ //
+ for (int i = 0; i < ACTION_NAMES.length; i++)
+ {
+ int mask = 2 >> i;
+ if ((this.mask & mask) == mask)
+ {
+ tmp.append(ACTION_NAMES[i]).append(',');
+ }
+ }
+
+ //
+ int length = tmp.length();
+ if (length > 0)
+ {
+ tmp.setLength(length - 1);
+ }
+ actions = tmp.toString();
+ }
+ return actions;
+ }
+
+ public String getType()
+ {
+ return PERMISSION_TYPE;
+ }
+}
Added:
trunk/portlet-server/src/main/org/jboss/portal/portlet/security/PortletSecurityService.java
===================================================================
---
trunk/portlet-server/src/main/org/jboss/portal/portlet/security/PortletSecurityService.java
(rev 0)
+++
trunk/portlet-server/src/main/org/jboss/portal/portlet/security/PortletSecurityService.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * 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.jboss.portal.portlet.security;
+
+import org.jboss.portal.security.spi.provider.AuthorizationDomain;
+
+/**
+ * Interface that defines a service that is used to configure security for portlets
+ *
+ * @author <a href="mailto:Anil.Saldhana@jboss.org">Anil
Saldhana</a>
+ * @version $Revision$
+ * @since Mar 17, 2006
+ */
+public interface PortletSecurityService
+{
+ AuthorizationDomain getAuthorizationDomain();
+}
Added:
trunk/portlet-server/src/main/org/jboss/portal/portlet/tck/TCKPortletController.java
===================================================================
--- trunk/portlet-server/src/main/org/jboss/portal/portlet/tck/TCKPortletController.java
(rev 0)
+++
trunk/portlet-server/src/main/org/jboss/portal/portlet/tck/TCKPortletController.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * 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.jboss.portal.portlet.tck;
+
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.test.PortletController;
+import org.jboss.portal.server.ServerInvocation;
+
+import javax.servlet.http.HttpSession;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5776 $
+ */
+public class TCKPortletController extends PortletController
+{
+ protected Collection getRenderList(ServerInvocation invocation) throws
PortletInvokerException
+ {
+ HttpSession session =
invocation.getServerContext().getClientRequest().getSession();
+ List portletIds = null;
+ String[] values =
(String[])invocation.getServerContext().getQueryParameterMap().get("portletName");
+ if (values == null)
+ {
+ portletIds = (List)session.getAttribute("portlets");
+ }
+ else
+ {
+ portletIds = new ArrayList();
+ for (int i = 0; i < values.length; i++)
+ {
+ String value = values[i];
+ String portletId = '/' + value.replace('/', '.');
+ portletIds.add(portletId);
+ }
+ session.setAttribute("portlets", portletIds);
+ }
+ List portlets = new ArrayList();
+ for (Iterator i = portletIds.iterator(); i.hasNext();)
+ {
+ String portletId = (String)i.next();
+ Portlet portlet =
portletInvoker.getPortlet(PortletContext.createPortletContext(portletId));
+ portlets.add(portlet);
+
+ }
+ return portlets;
+ }
+}
Property changes on:
trunk/portlet-server/src/main/org/jboss/portal/portlet/tck/TCKPortletController.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portlet-server/src/main/org/jboss/portal/portlet/test/PortletController.java
===================================================================
--- trunk/portlet-server/src/main/org/jboss/portal/portlet/test/PortletController.java
(rev 0)
+++
trunk/portlet-server/src/main/org/jboss/portal/portlet/test/PortletController.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,682 @@
+/******************************************************************************
+ * 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.jboss.portal.portlet.test;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.common.invocation.EmptyAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.common.util.URLTools;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.portlet.ActionURL;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.PortletURL;
+import org.jboss.portal.portlet.RenderURL;
+import org.jboss.portal.portlet.StateEvent;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.impl.PortletRequestDecoder;
+import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext;
+import org.jboss.portal.portlet.impl.spi.AbstractRequestContext;
+import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
+import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.RenderResponse;
+import org.jboss.portal.portlet.spi.ActionContext;
+import org.jboss.portal.portlet.spi.InstanceContext;
+import org.jboss.portal.portlet.spi.PortalContext;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
+import org.jboss.portal.portlet.spi.RenderContext;
+import org.jboss.portal.portlet.spi.RequestContext;
+import org.jboss.portal.portlet.spi.SecurityContext;
+import org.jboss.portal.portlet.spi.UserContext;
+import org.jboss.portal.portlet.spi.WindowContext;
+import org.jboss.portal.portlet.state.AccessMode;
+import org.jboss.portal.server.AbstractServerURL;
+import org.jboss.portal.server.RequestController;
+import org.jboss.portal.server.ServerException;
+import org.jboss.portal.server.ServerInvocation;
+import org.jboss.portal.server.request.URLFormat;
+import org.jboss.logging.Logger;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class PortletController implements RequestController
+{
+
+ /** . */
+ protected boolean redirectAfterAction;
+
+ /** . */
+ protected PortletInvoker portletInvoker;
+
+ /** . */
+ protected Logger log = Logger.getLogger(getClass());
+
+ public PortletInvoker getPortletInvoker()
+ {
+ return portletInvoker;
+ }
+
+ public void setPortletInvoker(PortletInvoker portletInvoker)
+ {
+ this.portletInvoker = portletInvoker;
+ }
+
+ public boolean getRedirectAfterAction()
+ {
+ return redirectAfterAction;
+ }
+
+ public void setRedirectAfterAction(boolean redirectAfterAction)
+ {
+ this.redirectAfterAction = redirectAfterAction;
+ }
+
+ public void handle(ServerInvocation invocation) throws ServerException
+ {
+ //
+// if (HttpTestContext.isCurrentRequestCount(0))
+// {
+// invocation.getServerContext().getClientRequest().getSession().invalidate();
+// }
+
+ try
+ {
+ String requestPath = invocation.getServerContext().getPortalRequestPath();
+
+ if (requestPath != null &&
requestPath.startsWith("/portlet/"))
+ {
+ // Get the portlet
+ String portletId = requestPath.substring("/portlet/".length());
+ Portlet portlet =
portletInvoker.getPortlet(PortletContext.createPortletContext(portletId));
+
+ PortletRequestDecoder decoder = new PortletRequestDecoder();
+ decoder.decode(invocation.getServerContext().getQueryParameterMap(),
invocation.getServerContext().getBodyParameterMap());
+
+ if (decoder.getType() == PortletRequestDecoder.ACTION_TYPE)
+ {
+ // Get the navigational state if it exist
+ PortletParametersStateString navigationalState =
(PortletParametersStateString)invocation.getAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext().getId());
+
+ //
+ ActionContextImpl actionContext = new ActionContextImpl(
+ portlet, invocation, navigationalState,
+ decoder.getWindowState() != null ? decoder.getWindowState() :
WindowState.NORMAL,
+ decoder.getMode() != null ? decoder.getMode() : Mode.VIEW,
+ decoder.getInteractionState(),
+ decoder.getForm());
+
+ ActionInvocation action = createAction(invocation, actionContext);
+
action.setTarget(((InstanceContextImpl)action.getInstanceContext()).getPortletContext());
+ PortletInvocationResponse response = portletInvoker.invoke(action);
+ if (response instanceof RenderResponse)
+ {
+ RenderResponse renderResult = (RenderResponse)response;
+
+ // Perform the redirection or chain rendering as part of the same http
request
+ if (redirectAfterAction)
+ {
+ try
+ {
+ final StateString _portletNavState =
renderResult.getNavigationalState();
+ final Mode _mode = renderResult.getMode();
+ final WindowState _windowState = renderResult.getWindowState();
+ PortletURL portletURL = new RenderURL()
+ {
+ public StateString getNavigationalState()
+ {
+ return _portletNavState;
+ }
+
+ public Mode getMode()
+ {
+ return _mode;
+ }
+
+ public WindowState getWindowState()
+ {
+ return _windowState;
+ }
+ };
+ String url = actionContext.renderURL(portletURL, null, null,
false);
+
invocation.getServerContext().getClientResponse().sendRedirect(url);
+ return;
+ }
+ catch (IOException e)
+ {
+ throw new ServerException(e);
+ }
+ }
+ else
+ {
+ invocation.setAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext().getId(), renderResult.getNavigationalState());
+ }
+ }
+ if (response instanceof HTTPRedirectionResponse)
+ {
+ try
+ {
+ HTTPRedirectionResponse redirection =
(HTTPRedirectionResponse)response;
+
invocation.getServerContext().getClientResponse().sendRedirect(redirection.getLocation());
+ return;
+ }
+ catch (IOException e)
+ {
+ throw new ServerException(e);
+ }
+ }
+ else if (response instanceof ErrorResponse)
+ {
+ ErrorResponse error = (ErrorResponse)response;
+ error.logErrorTo(log, "An error occured during portlet
invocation");
+ try
+ {
+
invocation.getServerContext().getClientResponse().sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ return;
+ }
+ catch (IOException e)
+ {
+ throw new ServerException(e);
+ }
+ }
+ }
+ else
+ {
+ //
+ invocation.setAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext().getId(), decoder.getNavigationalState());
+
+ //
+ Mode mode = decoder.getMode();
+ if (mode == null)
+ {
+ mode = Mode.VIEW;
+ }
+ invocation.setAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext() + "_mode", mode);
+
+ //
+ WindowState windowState = decoder.getWindowState();
+ if (windowState == null)
+ {
+ windowState = WindowState.NORMAL;
+ }
+ invocation.setAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext() + "_windowstate", windowState);
+ }
+
+ }
+
+ // Render everything
+ startRender(invocation);
+
+ //
+ for (Iterator i = getRenderList(invocation).iterator(); i.hasNext();)
+ {
+ Portlet portlet = (Portlet)i.next();
+
+ // Get the navigational state
+ StateString ns =
(StateString)invocation.getAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext().getId());
+
+ // Get the mode
+ Mode mode =
(Mode)invocation.getAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext() + "_mode");
+ if (mode == null)
+ {
+ mode = Mode.VIEW;
+ }
+
+ // Get the window state
+ WindowState windowState =
(WindowState)invocation.getAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE,
portlet.getContext() + "_windowstate");
+ if (windowState == null)
+ {
+ windowState = WindowState.NORMAL;
+ }
+
+ //
+ RenderContextImpl renderContext = new RenderContextImpl(portlet, invocation,
ns, windowState, mode);
+
+ //
+ PrintWriter writer =
invocation.getServerContext().getClientResponse().getWriter();
+
+ //
+
invocation.getServerContext().getClientRequest().getSession().getAttribute("CLONE_ON");
+
+ //
+ writer.write("<div>");
+ RenderInvocation render = createRender(invocation, renderContext);
+
render.setTarget(((InstanceContextImpl)render.getInstanceContext()).getPortletContext());
+ PortletInvocationResponse response = portletInvoker.invoke(render);
+
+ //
+ if (response instanceof FragmentResponse)
+ {
+ FragmentResponse fragment = (FragmentResponse)response;
+ String s = "";
+ switch (fragment.getType())
+ {
+ case FragmentResponse.TYPE_EMPTY:
+ // Keep the empty string
+ break;
+ case FragmentResponse.TYPE_CHARS:
+ s = ((FragmentResponse)response).getChars().toString();
+ break;
+ case FragmentResponse.TYPE_BYTES:
+ s = ((FragmentResponse)response).getBytes().toString();
+ break;
+ }
+ writer.write(s);
+ }
+ else if (response instanceof ErrorResponse)
+ {
+ writer.write("<div style=\"color: red;\">");
+ writer.write(((ErrorResponse)response).toHTML());
+ writer.write("</div>");
+ }
+ else if (response instanceof InsufficientPrivilegesResponse)
+ {
+ throw new NotYetImplemented();
+// // Redirect to authed servlet
+//
+// // Compute the new url context
+// URLContext uctx = invocation.getServerContext().getURLContext();
+// uctx = URLContext.newInstance(uctx.getSecure(), true);
+//
+// //
+// AbstractServerURL url = new AbstractServerURL();
+// url.setPortalRequestPath("/index.html");
+//
+// //
+// for (Iterator j =
invocation.getServerContext().getParameterMap().values().iterator(); j.hasNext();)
+// {
+// RequestParameter param = (RequestParameter)j.next();
+// url.setParameterValues(param.getName(), param.getValues());
+// }
+//
+// //
+// String s = invocation.getResponse().encodeURL(url, uctx);
+//
+// //
+// HttpServletResponse resp =
invocation.getServerContext().getClientResponse();
+// resp.sendRedirect(s);
+// return;
+ }
+ else
+ {
+ writer.write("");
+ }
+ writer.write("</div>");
+ }
+
+ //
+ endRender(invocation);
+ }
+ catch (PortletInvokerException e)
+ {
+ throw new ServerException(e);
+ }
+ catch (ServletException e)
+ {
+ throw new ServerException(e);
+ }
+ catch (IOException e)
+ {
+ throw new ServerException(e);
+ }
+ }
+
+ protected Collection getRenderList(ServerInvocation invocation) throws
PortletInvokerException
+ {
+ return portletInvoker.getPortlets();
+ }
+
+ protected void startRender(ServerInvocation invocation) throws ServletException,
IOException
+ {
+
+ HttpServletResponse cresp = invocation.getServerContext().getClientResponse();
+ cresp.setContentType("text/html;charset=UTF-8");
+ cresp.setCharacterEncoding("UTF-8");
+ PrintWriter writer =
invocation.getServerContext().getClientResponse().getWriter();
+ writer.print("<html><body>");
+ }
+
+ protected void endRender(ServerInvocation invocation) throws ServletException,
IOException
+ {
+ PrintWriter writer =
invocation.getServerContext().getClientResponse().getWriter();
+ writer.print("</body></html>");
+ writer.close();
+ }
+
+ /** An instance context implementation that stores */
+ protected class InstanceContextImpl implements InstanceContext
+ {
+
+ private HttpServletRequest req;
+ private AccessMode accessMode;
+ private PortletContext portletContext;
+ private PortletContext cloneContext;
+ private static final String CLONE_OF = "clone_of_";
+
+ public InstanceContextImpl(Portlet portlet, HttpServletRequest req)
+ {
+ this.portletContext = portlet.getContext();
+ this.req = req;
+ this.cloneContext = (PortletContext)req.getSession().getAttribute(CLONE_OF +
portlet.getContext().getId());
+ this.accessMode = cloneContext == null ? AccessMode.CLONE_BEFORE_WRITE :
AccessMode.READ_WRITE;
+ }
+
+ public String getId()
+ {
+ return portletContext.getId();
+ }
+
+ public void onStateEvent(StateEvent event)
+ {
+ req.getSession().setAttribute(CLONE_OF + this.portletContext.getId(),
event.getPortletContext());
+ }
+
+ public void portletCloned(String cloneId)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public AccessMode getAccessMode()
+ {
+ return accessMode;
+ }
+
+ public PortletContext getPortletContext()
+ {
+ return cloneContext != null ? cloneContext : portletContext;
+ }
+ }
+
+ protected class RenderContextImpl extends PortletInvocationContextImpl implements
RenderContext
+ {
+ public RenderContextImpl(
+ Portlet portlet,
+ ServerInvocation invocation,
+ StateString navigationalState,
+ WindowState windowState,
+ Mode mode)
+ {
+ super(portlet, invocation, navigationalState, windowState, mode);
+ }
+ }
+
+ protected class ActionContextImpl extends PortletInvocationContextImpl implements
ActionContext
+ {
+
+ private HttpServletRequest req;
+ private StateString interactionState;
+ private PortletParameters form;
+
+ public ActionContextImpl(
+ Portlet portlet,
+ ServerInvocation invocation,
+ StateString navigationalState,
+ WindowState windowState,
+ Mode mode,
+ StateString interactionState,
+ PortletParameters form)
+ {
+ super(portlet, invocation, navigationalState, windowState, mode);
+ req = invocation.getServerContext().getClientRequest();
+ this.interactionState = interactionState;
+ this.form = form;
+ }
+
+ public String getCharacterEncoding()
+ {
+ return req.getCharacterEncoding();
+ }
+
+ public BufferedReader getReader() throws IOException
+ {
+ return req.getReader();
+ }
+
+ public InputStream getInputStream() throws IOException
+ {
+ return req.getInputStream();
+ }
+
+ public int getContentLength()
+ {
+ return req.getContentLength();
+ }
+
+ public String getContentType()
+ {
+ return req.getContentType();
+ }
+
+ public StateString getInteractionState()
+ {
+ return interactionState;
+ }
+
+ public PortletParameters getForm()
+ {
+ return form;
+ }
+ }
+
+ public ActionInvocation createAction(ServerInvocation serverInvocation, ActionContext
actionContext)
+ {
+ ActionInvocation invocation = new ActionInvocation(actionContext);
+ update(serverInvocation, invocation);
+ return invocation;
+ }
+
+ public RenderInvocation createRender(ServerInvocation serverInvocation, RenderContext
renderContext)
+ {
+ RenderInvocation invocation = new RenderInvocation(renderContext);
+ update(serverInvocation, invocation);
+ return invocation;
+ }
+
+ public void update(final ServerInvocation serverInvocation, PortletInvocation
invocation)
+ {
+ final PortletInvocationContextImpl invocationContext =
(PortletInvocationContextImpl)invocation.getPortletContext();
+ PortalContext portalContext = new TestPortalContext();
+ SecurityContext securityContext = new
AbstractSecurityContext(invocationContext.getClientRequest());
+ RequestContext requestContext = new
AbstractRequestContext(invocationContext.getClientRequest(),
invocationContext.getClientResponse());
+ InstanceContext instanceContext = new
InstanceContextImpl(invocationContext.portlet, invocationContext.getClientRequest());
+
+ //
+ WindowContext windowContext = new WindowContext()
+ {
+ public String getId()
+ {
+ return invocationContext.portlet.getContext().getId();
+ }
+
+ };
+ UserContext userContext = new UserContext()
+ {
+ public String getId()
+ {
+ return null;
+ }
+
+ public Map getInformations()
+ {
+ return new HashMap();
+ }
+
+ public Locale getLocale()
+ {
+ return serverInvocation.getRequest().getLocale();
+ }
+
+ public List getLocales()
+ {
+ return Tools.toList(serverInvocation.getRequest().getLocales());
+ }
+ };
+
+ //
+ invocation.setPortalContext(portalContext);
+ invocation.setSecurityContext(securityContext);
+ invocation.setRequestContext(requestContext);
+ invocation.setInstanceContext(instanceContext);
+ invocation.setWindowContext(windowContext);
+ invocation.setUserContext(userContext);
+ }
+
+ protected class PortletInvocationContextImpl extends AbstractPortletInvocationContext
implements PortletInvocationContext
+ {
+
+ protected Portlet portlet;
+ protected ServerInvocation invocation;
+
+ public PortletInvocationContextImpl(
+ Portlet portlet,
+ ServerInvocation invocation,
+ StateString navigationalState,
+ WindowState windowState,
+ Mode mode)
+ {
+ super(mode, windowState, navigationalState,
(MarkupInfo)invocation.getResponse().getContentInfo());
+
+ //
+ this.portlet = portlet;
+ this.invocation = invocation;
+
+ //
+ addResolver(ServerInvocation.REQUEST_SCOPE, invocation.getContext());
+ addResolver(ServerInvocation.PRINCIPAL_SCOPE, invocation.getContext());
+ addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE,
EmptyAttributeResolver.getInstance());
+ addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new
MapAttributeResolver());
+ }
+
+ public HttpServletResponse getClientResponse()
+ {
+ return invocation.getServerContext().getClientResponse();
+ }
+
+ public HttpServletRequest getClientRequest()
+ {
+ return invocation.getServerContext().getClientRequest();
+ }
+
+ public String encodeResourceURL(String url)
+ {
+ URLTools.enforceAbsoluteURL(url);
+ return invocation.getServerContext().getClientResponse().encodeURL(url);
+ }
+
+ public String renderURL(PortletURL portletURL, Boolean wantSecure, Boolean
wantAuthenticated, boolean relative)
+ {
+ AbstractServerURL serverURL = new AbstractServerURL();
+
+ //
+ String id = portlet.getContext().getId();
+ serverURL.setPortalRequestPath("/portlet/" + id);
+
+ //
+ int meta = PortletRequestDecoder.RENDER_MASK;
+ if (portletURL instanceof ActionURL)
+ {
+ meta = PortletRequestDecoder.ACTION_MASK;
+ }
+
+ //
+ if (portletURL.getMode() != null)
+ {
+ meta |= PortletRequestDecoder.MODE_MASK;
+ serverURL.setParameterValue(PortletRequestDecoder.MODE_PARAMETER,
portletURL.getMode().toString());
+ }
+
+ //
+ if (portletURL.getWindowState() != null)
+ {
+ meta |= PortletRequestDecoder.WINDOW_STATE_MASK;
+ serverURL.setParameterValue(PortletRequestDecoder.WINDOW_STATE_PARAMETER,
portletURL.getWindowState().toString());
+ }
+
+ //
+ serverURL.setParameterValue(PortletRequestDecoder.META_PARAMETER,
Integer.toHexString(meta));
+
+ // Unwrap in a specific jboss portlet navigational state
+ PortletParameters parameters = null;
+ if (portletURL instanceof ActionURL)
+ {
+ PortletParametersStateString interactionState =
(PortletParametersStateString)((ActionURL)portletURL).getInteractionState();
+ if (interactionState != null)
+ {
+ parameters = interactionState.getParameters();
+ }
+ }
+ else
+ {
+ PortletParametersStateString navState =
(PortletParametersStateString)((RenderURL)portletURL).getNavigationalState();
+ if (navState != null)
+ {
+ parameters = navState.getParameters();
+ }
+ }
+
+ //
+ if (parameters != null)
+ {
+ for (Iterator i = parameters.entrySet().iterator(); i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String name = (String)entry.getKey();
+ String[] values = (String[])entry.getValue();
+ serverURL.setParameterValues(name, values);
+ }
+ }
+
+ //
+ return invocation.getResponse().renderURL(serverURL,
URLFormat.newInstance(relative, true));
+ }
+ }
+}
Added:
trunk/portlet-server/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java
===================================================================
---
trunk/portlet-server/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java
(rev 0)
+++
trunk/portlet-server/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,79 @@
+/******************************************************************************
+ * 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.jboss.portal.portlet.test;
+
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.invocation.PortletInterceptor;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
+import org.jboss.portal.portlet.security.PortletPermission;
+import org.jboss.portal.security.PortalSecurityException;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6691 $
+ */
+public class TestSecurityInterceptor extends PortletInterceptor
+{
+
+ /** The auth manager factory. */
+ private PortalAuthorizationManagerFactory pamf;
+
+ public PortalAuthorizationManagerFactory getPortalAuthorizationManagerFactory()
+ {
+ return pamf;
+ }
+
+ public void setPortalAuthorizationManagerFactory(PortalAuthorizationManagerFactory
portalAuthorizationManagerFactory)
+ {
+ this.pamf = portalAuthorizationManagerFactory;
+ }
+
+ protected Object invoke(PortletInvocation invocation) throws Exception,
InvocationException
+ {
+ try
+ {
+ PortalAuthorizationManager authMgr = pamf.getManager();
+ PortletContext portletContext = invocation.getTarget();
+ String portletId = portletContext.getId();
+ PortletPermission perm = new PortletPermission(portletId,
PortletPermission.VIEW_MASK);
+ boolean authorized = authMgr.checkPermission(perm);
+ if (authorized == false)
+ {
+ return new InsufficientPrivilegesResponse();
+ }
+ else
+ {
+ return invocation.invokeNext();
+ }
+ }
+ catch (PortalSecurityException e)
+ {
+ throw new PortletInvokerException(e);
+ }
+ }
+}
Property changes on:
trunk/portlet-server/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portlet-server/src/resources/tck-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/portlet-server/src/resources/tck-sar/META-INF/jboss-service.xml
(rev 0)
+++ trunk/portlet-server/src/resources/tck-sar/META-INF/jboss-service.xml 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,320 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+
+ <!-- Server stack -->
+ <mbean
+ code="org.jboss.portal.server.aspects.server.LocaleInterceptor"
+ name="portal:service=Interceptor,type=Server,name=Locale"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.server.aspects.server.ContentTypeInterceptor"
+ name="portal:service=Interceptor,type=Server,name=ContentType"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.server.aspects.server.NavigationInterceptor"
+ name="portal:service=Interceptor,type=Server,name=Navigation"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.server.impl.invocation.JBossInterceptorStack"
+ name="portal:service=InterceptorStack,type=Server"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends-list optional-attribute-name="InterceptorNames">
+
<depends-list-element>portal:service=Interceptor,type=Server,name=User</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Server,name=Locale</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Server,name=ContentType</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Server,name=Navigation</depends-list-element>
+ </depends-list>
+ </mbean>
+
+ <!-- Consumer stack -->
+ <mbean
+ code="org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=ConsumerCache"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.server.impl.invocation.JBossInterceptorStack"
+ name="portal:service=InterceptorStack,type=Consumer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends-list optional-attribute-name="InterceptorNames">
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ConsumerCache</depends-list-element>
+ </depends-list>
+ </mbean>
+
+ <!-- Container stack-->
+ <mbean
+ code="org.jboss.portal.portlet.aspects.portlet.ValveInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=Valve"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=SecureTransport"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=ContextDispatcher"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.portlet.aspects.portlet.WindowStatesInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=WindowStates"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.portlet.aspects.portlet.ModesInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=Modes"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=ProducerCache"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.server.impl.invocation.JBossInterceptorStack"
+ name="portal:service=InterceptorStack,type=Container"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends-list optional-attribute-name="InterceptorNames">
+
<!--<depends-list-element>portal:service=Interceptor,type=Portlet,name=Security</depends-list-element>-->
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=Valve</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=SecureTransport</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=SessionPreDispatch</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ContextDispatcher</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=SessionPostDispatch</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=WindowStates</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=Modes</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ProducerCache</depends-list-element>
+ </depends-list>
+ </mbean>
+
+ <!-- Webapp registry -->
+ <mbean
+ code="org.jboss.portal.portlet.container.PortletApplicationRegistryImpl"
+ name="portal:service=WebAppRegistry"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
+ <!-- The consumer portlet invoker -->
+ <mbean
+ code="org.jboss.portal.portlet.test.TestPortletInvoker"
+ name="portal:service=PortletInvoker,type=Consumer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Producer"
+
proxy-type="attribute">portal:service=PortletInvoker,type=Producer</depends>
+ <depends optional-attribute-name="Stack"
+
proxy-type="attribute">portal:service=InterceptorStack,type=Consumer</depends>
+ </mbean>
+
+ <!-- The producer portlet invoker -->
+ <mbean
+ code="org.jboss.portal.portlet.state.producer.ProducerPortletInvoker"
+ name="portal:service=PortletInvoker,type=Producer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="PortletInvoker"
proxy-type="attribute">portal:service=PortletInvoker,type=Container</depends>
+ <depends optional-attribute-name="StateStore"
+
proxy-type="attribute">portal:service=StateStore,type=Producer</depends>
+ </mbean>
+
+ <!-- The container portlet invoker -->
+ <mbean
+ code="org.jboss.portal.portlet.container.PortletContainerInvoker"
+ name="portal:service=PortletInvoker,type=Container"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Stack"
+
proxy-type="attribute">portal:service=InterceptorStack,type=Container</depends>
+ <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ </mbean>
+
+ <!-- The portlet controller -->
+ <mbean
+ code="org.jboss.portal.portlet.tck.TCKPortletController"
+ name="portal:controller=Request,redirect=true"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="PortletInvoker"
proxy-type="attribute">portal:service=PortletInvoker,type=Consumer</depends>
+ <attribute name="RedirectAfterAction">true</attribute>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.portlet.test.PortletController"
+ name="portal:controller=Request,redirect=false"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="PortletInvoker"
proxy-type="attribute">portal:service=PortletInvoker,type=Consumer</depends>
+ <attribute name="RedirectAfterAction">false</attribute>
+ </mbean>
+
+ <!-- Portlet deployment factory -->
+ <mbean
+
code="org.jboss.portal.portlet.deployment.jboss.PortletAppDeploymentFactory"
+ name="portal:deploymentFactory=PortletApp"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
+ <depends optional-attribute-name="WebAppRegistry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
+ <depends optional-attribute-name="PortletSecurityService"
proxy-type="attribute">portal:service=PortletSecurityService</depends>
+ </mbean>
+
+ <!-- Preferences -->
+ <mbean
+
code="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"
+ name="portal:service=StateStore,type=Producer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <!--
+ <mbean
+ code="org.jboss.portal.portlet.test.TestConsumerStateStore"
+ name="portal:service=StateStore,type=Consumer"
+ xmbean-dd=""
+
xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ -->
+
+ <!-- Portal security services-->
+ <mbean
+
code="org.jboss.portal.security.impl.JBossAuthorizationDomainRegistryImpl"
+ name="portal:service=AuthorizationDomainRegistry"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.security.impl.jacc.JACCPortalAuthorizationManagerFactory"
+ name="portal:service=PortalAuthorizationManagerFactory"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="AuthorizationDomainRegistry"
proxy-type="attribute">portal:service=AuthorizationDomainRegistry</depends>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.portlet.impl.security.JBossPortletSecurityService"
+ name="portal:service=PortletSecurityService"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="PortalAuthorizationManagerFactory"
proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
+ <depends optional-attribute-name="AuthorizationDomainRegistry"
proxy-type="attribute">portal:service=AuthorizationDomainRegistry</depends>
+ </mbean>
+
+
+ <!--Things from portal-server.sar - jboss-service.xml-->
+
+ <!-- Server configuration service -->
+ <mbean
+ code="org.jboss.portal.server.config.ServerConfigService"
+ name="portal:service=ServerConfig"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="ConfigLocation">conf/config.xml</attribute>
+ </mbean>
+
+
+ <!-- Server -->
+ <mbean
+ code="org.jboss.portal.server.impl.ServerImpl"
+ name="portal:service=Server"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
+ </mbean>
+
+ <!-- Server deployer -->
+ <mbean
+ code="org.jboss.portal.server.deployment.jboss.ServerDeployer"
+ name="portal:deployer=PortalWebApp">
+ <depends>jboss.system:service=MainDeployer</depends>
+ <depends optional-attribute-name="PortalServer"
proxy-type="attribute">portal:service=Server</depends>
+ </mbean>
+
+ <!-- Adapt the web app to the server deployer -->
+ <mbean
+ code="org.jboss.portal.server.deployment.WebAppAdapter"
+ name="portal:deployer=Adapter"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
+ <depends
optional-attribute-name="InterceptedDeployer">jboss.web:service=WebServer</depends>
+ </mbean>
+
+ <!-- Web app enhancer -->
+ <mbean
+ code="org.jboss.portal.server.deployment.WebAppEnhancer"
+ name="portal:service=Deployer,type=Enhancer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
optional-attribute-name="InterceptedDeployer">jboss.web:service=WebServer</depends>
+ </mbean>
+
+</server>
Property changes on:
trunk/portlet-server/src/resources/tck-sar/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portlet-server/src/resources/tck-sar/conf/config.xml
===================================================================
--- trunk/portlet-server/src/resources/tck-sar/conf/config.xml
(rev 0)
+++ trunk/portlet-server/src/resources/tck-sar/conf/config.xml 2007-03-17 02:37:08 UTC
(rev 6720)
@@ -0,0 +1,26 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<properties>
+ <entry key="blah">bluh</entry>
+</properties>
Property changes on: trunk/portlet-server/src/resources/tck-sar/conf/config.xml
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/portlet-server/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/portlet-server/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml
(rev 0)
+++
trunk/portlet-server/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,188 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+
+ <!-- -->
+ <mbean
+ code="org.jboss.portal.test.framework.driver.http.HttpTestDriverServer"
+ name="portal.test:service=HttpTestDriverServer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Agent"
+ proxy-type="attribute">portal.test:service=Agent</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+ name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ <depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
+ <depends
optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
+ <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
+ </mbean>
+
+ <!-- Server -->
+ <mbean
+ code="org.jboss.portal.server.impl.ServerImpl"
+ name="portal:service=Server"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
+ <!-- Server stack -->
+ <mbean
+
code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
+ name="portal:service=InterceptorStackFactory,type=Server"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends-list optional-attribute-name="InterceptorNames">
+ </depends-list>
+ </mbean>
+
+ <!-- Server deployer -->
+ <mbean
+ code="org.jboss.portal.server.deployment.jboss.ServerDeployer"
+ name="portal:deployer=PortalWebApp">
+ <depends>jboss.system:service=MainDeployer</depends>
+ <depends optional-attribute-name="PortalServer"
proxy-type="attribute">portal:service=Server</depends>
+ </mbean>
+
+ <!-- Adapt the web app to the server deployer -->
+ <mbean
+ code="org.jboss.portal.server.deployment.WebAppAdapter"
+ name="portal:deployer=Adapter"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
+ <depends
optional-attribute-name="InterceptedDeployer">jboss.web:service=WebServer</depends>
+ </mbean>
+
+ <!-- Webapp registry -->
+ <mbean
+ code="org.jboss.portal.portlet.container.PortletApplicationRegistryImpl"
+ name="portal:service=WebAppRegistry"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
+ <!-- Portlet deployment factory -->
+ <mbean
+
code="org.jboss.portal.portlet.deployment.jboss.PortletAppDeploymentFactory"
+ name="portal:deploymentFactory=PortletApp"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
+ <depends optional-attribute-name="WebAppRegistry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ </mbean>
+
+ <!-- -->
+ <mbean
+ code="org.jboss.portal.test.server.TestRequestController"
+ name="portal:controller=Request"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ </mbean>
+
+ <!-- -->
+ <mbean
+ code="org.jboss.portal.test.portlet.info.MetaInfoTest"
+ name="portal:test=MetaInfo"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.test.portlet.info.PreferenceInfoTest"
+ name="portal:test=PreferenceInfo"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.test.portlet.info.CapabilitiesInfoTest"
+ name="portal:test=CapabilitiesInfo"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.test.portlet.info.CacheInfoTest"
+ name="portal:test=CacheInfo"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.test.portlet.info.ModeInfoTest"
+ name="portal:test=ModeInfo"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.test.portlet.info.PortletInfoTest"
+ name="portal:test=PortletInfo"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.test.portlet.info.SessionInfoTest"
+ name="portal:test=SessionInfo"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.test.portlet.info.SecurityInfoTest"
+ name="portal:test=SecurityInfo"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal:controller=Request</depends>
+ </mbean>
+</server>
\ No newline at end of file
Property changes on:
trunk/portlet-server/src/resources/test/info/test-info-sar/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portlet-server/src/resources/test-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/portlet-server/src/resources/test-sar/META-INF/jboss-service.xml
(rev 0)
+++ trunk/portlet-server/src/resources/test-sar/META-INF/jboss-service.xml 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,369 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+
+ <!-- -->
+ <mbean
+ code="org.jboss.portal.test.framework.driver.http.HttpTestDriverServer"
+ name="portal.test:service=HttpTestDriverServer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Agent"
+ proxy-type="attribute">portal.test:service=Agent</depends>
+ </mbean>
+ <mbean
+ code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+ name="portal.test:service=Invoker,name=HttpTestDriverServer">
+ <depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
+ <depends
optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
+ <attribute name="JndiName">HttpTestDriverServer</attribute>
+ <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
+ </mbean>
+
+ <!-- -->
+ <mbean
+ code="org.jboss.portal.test.framework.portlet.PortletTestDriver"
+ name="portal:service=PortletTestDriver"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="TestDriverRegistry"
proxy-type="attribute">portal.test:service=HttpTestDriverServer</depends>
+ </mbean>
+
+ <!-- Runtime context for running portlet container -->
+ <mbean
+
code="org.jboss.portal.portlet.container.runtime.PortletRuntimeContextImpl"
+ name="portal:service=PortletRuntimeContext"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
+ <!-- Server stack -->
+ <mbean
+ code="org.jboss.portal.server.aspects.server.LocaleInterceptor"
+ name="portal:service=Interceptor,type=Server,name=Locale"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.server.aspects.server.ContentTypeInterceptor"
+ name="portal:service=Interceptor,type=Server,name=ContentType"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
+ name="portal:service=InterceptorStackFactory,type=Server"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends-list optional-attribute-name="InterceptorNames">
+
<depends-list-element>portal:service=Interceptor,type=Server,name=Locale</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Server,name=ContentType</depends-list-element>
+ </depends-list>
+ </mbean>
+
+ <!-- Consumer stack -->
+ <mbean
+
code="org.jboss.portal.portlet.aspects.portlet.PortalSessionSynchronizationInterceptor"
+
name="portal:service=Interceptor,type=Portlet,name=PortalSessionSynchronization"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
+ name="portal:service=InterceptorStackFactory,type=Consumer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends-list optional-attribute-name="InterceptorNames">
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=PortalSessionSynchronization</depends-list-element>
+ </depends-list>
+ </mbean>
+
+ <!-- Producer stack-->
+ <mbean
+ code="org.jboss.portal.portlet.aspects.portlet.ValveInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=Valve"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=ConsumerCache"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=SecureTransport"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=ContextDispatcher"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="RuntimeContext"
+
proxy-type="attribute">portal:service=PortletRuntimeContext</depends>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.portlet.aspects.portlet.PortletSessionSynchronizationInterceptor"
+
name="portal:service=Interceptor,type=Portlet,name=PortletSessionSynchronization"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.portlet.aspects.portlet.WindowStatesInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=WindowStates"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.portlet.aspects.portlet.ModesInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=Modes"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=ProducerCache"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
+ name="portal:service=InterceptorStackFactory,type=Container"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends-list optional-attribute-name="InterceptorNames">
+
<!--<depends-list-element>portal:service=Interceptor,type=Portlet,name=Security</depends-list-element>-->
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=Valve</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ConsumerCache</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=SecureTransport</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ContextDispatcher</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=PortletSessionSynchronization</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=WindowStates</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=Modes</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ProducerCache</depends-list-element>
+ </depends-list>
+ </mbean>
+
+ <!-- Webapp registry -->
+ <mbean
+ code="org.jboss.portal.portlet.container.PortletApplicationRegistryImpl"
+ name="portal:service=WebAppRegistry"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
+ <!-- The consumer portlet invoker -->
+ <mbean
+ code="org.jboss.portal.portlet.test.TestPortletInvoker"
+ name="portal:service=PortletInvoker,type=Consumer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Producer"
+
proxy-type="attribute">portal:service=PortletInvoker,type=Producer</depends>
+ <depends optional-attribute-name="StackFactory"
proxy-type="attribute">portal:service=InterceptorStackFactory,type=Consumer</depends>
+ </mbean>
+
+ <!-- The producer portlet invoker -->
+ <mbean
+
code="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"
+ name="portal:service=PersistenceManager,type=Producer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.portlet.impl.state.StateManagementPolicyService"
+ name="portal:service=StateManagementPolicy,type=Producer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="PersistLocally">true</attribute>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.portlet.impl.state.StateConverterV0"
+ name="portal:service=StateConverterService,type=Producer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.portlet.state.producer.ProducerPortletInvoker"
+ name="portal:service=PortletInvoker,type=Producer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="PortletInvoker"
proxy-type="attribute">portal:service=PortletInvoker,type=Container</depends>
+ <depends optional-attribute-name="PersistenceManager"
proxy-type="attribute">portal:service=PersistenceManager,type=Producer</depends>
+ <depends optional-attribute-name="StateManagementPolicy"
proxy-type="attribute">portal:service=StateManagementPolicy,type=Producer</depends>
+ <depends optional-attribute-name="StateConverter"
proxy-type="attribute">portal:service=StateConverterService,type=Producer</depends>
+ </mbean>
+
+ <!-- The container portlet invoker -->
+ <mbean
+ code="org.jboss.portal.portlet.container.PortletContainerInvoker"
+ name="portal:service=PortletInvoker,type=Container"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="StackFactory"
proxy-type="attribute">portal:service=InterceptorStackFactory,type=Container</depends>
+ <depends optional-attribute-name="Registry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="RuntimeContext"
proxy-type="attribute">portal:service=PortletRuntimeContext</depends>
+ </mbean>
+
+ <!-- The portlet controller -->
+ <mbean
+ code="org.jboss.portal.portlet.test.PortletController"
+ name="portal:controller=Request,redirect=true"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="PortletInvoker"
proxy-type="attribute">portal:service=PortletInvoker,type=Consumer</depends>
+ <attribute name="RedirectAfterAction">true</attribute>
+ </mbean>
+ <mbean
+ code="org.jboss.portal.portlet.test.PortletController"
+ name="portal:controller=Request,redirect=false"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="PortletInvoker"
proxy-type="attribute">portal:service=PortletInvoker,type=Consumer</depends>
+ <attribute name="RedirectAfterAction">false</attribute>
+ </mbean>
+
+ <!-- Portlet deployment factory -->
+ <mbean
+
code="org.jboss.portal.portlet.deployment.jboss.PortletAppDeploymentFactory"
+ name="portal:deploymentFactory=PortletApp"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
+ <depends optional-attribute-name="WebAppRegistry"
proxy-type="attribute">portal:service=WebAppRegistry</depends>
+ <depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
+ <depends optional-attribute-name="PortletSecurityService"
proxy-type="attribute">portal:service=PortletSecurityService</depends>
+ </mbean>
+
+ <!-- Portal security services-->
+ <mbean
+
code="org.jboss.portal.security.impl.JBossAuthorizationDomainRegistryImpl"
+ name="portal:service=AuthorizationDomainRegistry"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.security.impl.jacc.JACCPortalAuthorizationManagerFactory"
+ name="portal:service=PortalAuthorizationManagerFactory"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="AuthorizationDomainRegistry"
proxy-type="attribute">portal:service=AuthorizationDomainRegistry</depends>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.portlet.impl.security.JBossPortletSecurityService"
+ name="portal:service=PortletSecurityService"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="PortalAuthorizationManagerFactory"
proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
+ <depends optional-attribute-name="AuthorizationDomainRegistry"
proxy-type="attribute">portal:service=AuthorizationDomainRegistry</depends>
+ </mbean>
+
+
+ <!-- Things from portal-server.sar - jboss-service.xml-->
+
+ <!-- Server configuration service -->
+ <mbean
+ code="org.jboss.portal.server.config.ServerConfigService"
+ name="portal:service=ServerConfig"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="ConfigLocation">conf/config.xml</attribute>
+ </mbean>
+
+ <!-- Server -->
+ <mbean
+ code="org.jboss.portal.server.impl.ServerImpl"
+ name="portal:service=Server"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Config"
proxy-type="attribute">portal:service=ServerConfig</depends>
+ </mbean>
+
+ <!-- Server deployer -->
+ <mbean
+ code="org.jboss.portal.server.deployment.jboss.ServerDeployer"
+ name="portal:deployer=PortalWebApp">
+ <depends>jboss.system:service=MainDeployer</depends>
+ <depends optional-attribute-name="PortalServer"
proxy-type="attribute">portal:service=Server</depends>
+ </mbean>
+
+ <!-- Adapt the web app to the server deployer -->
+ <mbean
+ code="org.jboss.portal.server.deployment.WebAppAdapter"
+ name="portal:deployer=Adapter"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Deployer"
proxy-type="attribute">portal:deployer=PortalWebApp</depends>
+ <depends
optional-attribute-name="InterceptedDeployer">jboss.web:service=WebServer</depends>
+ </mbean>
+
+ <!-- Web app enhancer -->
+ <mbean
+ code="org.jboss.portal.server.deployment.WebAppEnhancer"
+ name="portal:service=Deployer,type=Enhancer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
optional-attribute-name="InterceptedDeployer">jboss.web:service=WebServer</depends>
+ </mbean>
+</server>
Property changes on:
trunk/portlet-server/src/resources/test-sar/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portlet-server/src/resources/test-sar/conf/config.xml
===================================================================
--- trunk/portlet-server/src/resources/test-sar/conf/config.xml
(rev 0)
+++ trunk/portlet-server/src/resources/test-sar/conf/config.xml 2007-03-17 02:37:08 UTC
(rev 6720)
@@ -0,0 +1,26 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<properties>
+ <entry key="blah">bluh</entry>
+</properties>
Property changes on: trunk/portlet-server/src/resources/test-sar/conf/config.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portlet-server/src/resources/test-war/WEB-INF/classes/roles.properties
===================================================================
--- trunk/portlet-server/src/resources/test-war/WEB-INF/classes/roles.properties
(rev 0)
+++
trunk/portlet-server/src/resources/test-war/WEB-INF/classes/roles.properties 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1 @@
+test=Test
Property changes on:
trunk/portlet-server/src/resources/test-war/WEB-INF/classes/roles.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portlet-server/src/resources/test-war/WEB-INF/classes/users.properties
===================================================================
--- trunk/portlet-server/src/resources/test-war/WEB-INF/classes/users.properties
(rev 0)
+++
trunk/portlet-server/src/resources/test-war/WEB-INF/classes/users.properties 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1 @@
+test=test
Property changes on:
trunk/portlet-server/src/resources/test-war/WEB-INF/classes/users.properties
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portlet-server/src/resources/test-war/WEB-INF/jboss-web.xml
===================================================================
--- trunk/portlet-server/src/resources/test-war/WEB-INF/jboss-web.xml
(rev 0)
+++ trunk/portlet-server/src/resources/test-war/WEB-INF/jboss-web.xml 2007-03-17 02:37:08
UTC (rev 6720)
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<jboss-web>
+ <context-root>/test</context-root>
+ <security-domain>java:/jaas/other</security-domain>
+ <replication-config>
+ <replication-trigger>SET</replication-trigger>
+ </replication-config>
+</jboss-web>
Property changes on: trunk/portlet-server/src/resources/test-war/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portlet-server/src/resources/test-war/WEB-INF/web.xml
===================================================================
--- trunk/portlet-server/src/resources/test-war/WEB-INF/web.xml
(rev 0)
+++ trunk/portlet-server/src/resources/test-war/WEB-INF/web.xml 2007-03-17 02:37:08 UTC
(rev 6720)
@@ -0,0 +1,138 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <description>Portlet war</description>
+
+ <distributable/>
+
+ <servlet>
+ <servlet-name>PortalServletRedirect</servlet-name>
+
<servlet-class>org.jboss.portal.server.servlet.PortalServlet</servlet-class>
+ <init-param>
+ <param-name>asDefaultServlet</param-name>
+ <param-value>false</param-value>
+ <description>The servlet needs to know wether it is set as a default
servlet or not</description>
+ </init-param>
+ <init-param>
+ <param-name>controllerName</param-name>
+ <param-value>portal:controller=Request,redirect=true</param-value>
+ <description>The request controller for the portal
servlet</description>
+ </init-param>
+ <load-on-startup>0</load-on-startup>
+ <security-role-ref>
+ <role-name>Test</role-name>
+ <role-link>Test</role-link>
+ </security-role-ref>
+ </servlet>
+
+ <!--
+ <servlet>
+ <servlet-name>PortalServletNoRedirect</servlet-name>
+
<servlet-class>org.jboss.portal.server.servlet.PortalServlet</servlet-class>
+ <init-param>
+ <param-name>asDefaultServlet</param-name>
+ <param-value>false</param-value>
+ <description>The servlet needs to know wether it is set as a default
servlet or not</description>
+ </init-param>
+ <init-param>
+ <param-name>controllerName</param-name>
+
<param-value>portal:controller=Request,redirect=false</param-value>
+ <description>The request controller for the portal
servlet</description>
+ </init-param>
+ <load-on-startup>0</load-on-startup>
+ <security-role-ref>
+ <role-name>Test</role-name>
+ <role-link>Test</role-link>
+ </security-role-ref>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>PortalServletNoRedirect</servlet-name>
+ <url-pattern>/noredirect/*</url-pattern>
+ </servlet-mapping>
+ -->
+
+ <!-- Provide access to unauthenticated users -->
+ <servlet-mapping>
+ <servlet-name>PortalServletRedirect</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>PortalServletRedirect</servlet-name>
+ <url-pattern>/sec/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>PortalServletRedirect</servlet-name>
+ <url-pattern>/auth/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>PortalServletRedirect</servlet-name>
+ <url-pattern>/authsec/*</url-pattern>
+ </servlet-mapping>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Authenticated</web-resource-name>
+ <description></description>
+ <url-pattern>/auth/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>Test</role-name>
+ </auth-constraint>
+ </security-constraint>
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Secure</web-resource-name>
+ <url-pattern>/sec/*</url-pattern>
+ </web-resource-collection>
+ <user-data-constraint>
+ <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>Secure+Authenticated</web-resource-name>
+ <url-pattern>/authsec/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>Test</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>Test</realm-name>
+ </login-config>
+
+ <security-role>
+ <role-name>Test</role-name>
+ </security-role>
+
+</web-app>
Property changes on: trunk/portlet-server/src/resources/test-war/WEB-INF/web.xml
___________________________________________________________________
Name: svn:executable
+ *
Modified:
trunk/server/src/main/org/jboss/portal/server/aspects/server/SessionInvalidatorInterceptor.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/server/aspects/server/SessionInvalidatorInterceptor.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/server/src/main/org/jboss/portal/server/aspects/server/SessionInvalidatorInterceptor.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -30,7 +30,6 @@
import org.jboss.portal.server.servlet.CommandServlet;
import org.jboss.portal.server.servlet.ServletCommand;
-import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -110,9 +109,12 @@
// Get portal context
ServletContext portalContext = session.getServletContext();
- // Create a dispatch implementation that uses the current invocation
- DispatcherImpl dispatcher = new DispatcherImpl(invocation);
+ //
+ HttpServletRequest req = invocation.getServerContext().getClientRequest();
+ //
+ HttpServletResponse resp = invocation.getServerContext().getClientResponse();
+
// Iterate over all the context that have been used
for (Iterator i = contexts.iterator(); i.hasNext();)
{
@@ -127,7 +129,7 @@
try
{
// Execute the command that invalidates the session
- CommandServlet.include(dispatcher, invalidator, dispatchContext);
+ CommandServlet.include(req, resp, invalidator, dispatchContext);
}
catch (Exception e)
{
@@ -141,28 +143,6 @@
}
}
- public static class DispatcherImpl implements CommandServlet.Dispatcher
- {
-
- /** . */
- private final HttpServletRequest req;
-
- /** . */
- private final HttpServletResponse resp;
-
- public DispatcherImpl(ServerInvocation invocation)
- {
- ServerInvocationContext context = invocation.getServerContext();
- req = context.getClientRequest();
- resp = context.getClientResponse();
- }
-
- public void include(RequestDispatcher rd) throws IOException, ServletException
- {
- rd.include(req, resp);
- }
- }
-
public static class InvalidationCommand implements ServletCommand
{
public void execute(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException
Modified: trunk/server/src/main/org/jboss/portal/server/servlet/CommandServlet.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/servlet/CommandServlet.java 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/server/src/main/org/jboss/portal/server/servlet/CommandServlet.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -61,14 +61,14 @@
/**
* Execute a command after having performed a request dispatch in the target servlet
context.
*
- * @param dispatcher the dispatcher that will provide the request and response.
* @param cmd the command to execute after the inclusion is done
* @param ctx the target servlet context
* @throws IOException
* @throws ServletException
*/
public static void include(
- Dispatcher dispatcher,
+ HttpServletRequest req,
+ HttpServletResponse resp,
ServletCommand cmd,
ServletContext ctx) throws IOException, ServletException
{
@@ -76,7 +76,7 @@
{
localCmd.set(cmd);
RequestDispatcher switcher =
ctx.getRequestDispatcher("/jbossportlet");
- dispatcher.include(switcher);
+ switcher.include(req, resp);
}
finally
{
Modified:
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/AbstractTest.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/AbstractTest.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/AbstractTest.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,103 +22,25 @@
******************************************************************************/
package org.jboss.portal.test.framework.server.driver;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.common.test.driver.DriverResponse;
-import org.jboss.portal.common.test.driver.DriverCommand;
-import org.jboss.portal.common.test.driver.TestDriverException;
import org.jboss.portal.common.test.driver.response.ErrorResponse;
-import org.jboss.portal.common.test.driver.command.StartTestCommand;
-import org.jboss.portal.common.test.info.TestItemInfo;
-import org.jboss.portal.common.test.info.TestInfo;
-import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
import org.jboss.portal.test.framework.driver.http.HttpTestContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestDriverServer;
+import org.jboss.portal.test.framework.driver.http.HttpTestCase;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public abstract class AbstractTest extends AbstractJBossService implements
HttpTestDriverServer
+public abstract class AbstractTest extends HttpTestCase
{
- /** The test id. */
- private final String testCaseId;
- /** The test path. */
- private final String path;
-
- /** The controller. */
- private HttpTestDriverRegistry testDriverRegistry;
-
- /** The test info. */
- private TestInfo testInfo;
-
- /** The test info. */
- private HttpTestContext context;
-
- public AbstractTest(String testCaseId, String path)
+ protected AbstractTest(String testCaseId, String path)
{
- if (testCaseId == null)
- {
- throw new IllegalArgumentException("No null test case id accepted");
- }
- if (path == null)
- {
- throw new IllegalArgumentException("No null test path accepted");
- }
-
- //
- this.testCaseId = testCaseId;
- this.path = path;
- this.testInfo = new TestInfo(testCaseId);
+ super(testCaseId, path);
}
- public TestItemInfo getInfo()
- {
- return testInfo;
- }
-
- public HttpTestDriverRegistry getTestDriverRegistry()
- {
- return testDriverRegistry;
- }
-
- public void setTestDriverRegistry(HttpTestDriverRegistry testDriverRegistry)
- {
- this.testDriverRegistry = testDriverRegistry;
- }
-
- public String getTestCaseId()
- {
- return testCaseId;
- }
-
- public String getPath()
- {
- return path;
- }
-
- protected void createService()
- {
- testDriverRegistry.register(this);
- }
-
- protected void destroyService()
- {
- testDriverRegistry.unregister(this);
- }
-
- public void pushContext(String testId, HttpTestContext ctx)
- {
- this.context = ctx;
- }
-
- public HttpTestContext popContext(String testId)
- {
- return context;
- }
-
/**
*
*/
@@ -138,38 +60,8 @@
/**
*
*/
- public DriverResponse invoke(String testId, DriverCommand cmd) throws
TestDriverException
- {
- if (cmd instanceof StartTestCommand)
- {
- return new InvokeGetResponse(path);
- }
- else
- {
- try
- {
- return execute(cmd, context);
- }
- catch (Exception e)
- {
- return new ErrorResponse(e);
- }
- }
- }
-
- /**
- *
- */
public DriverResponse execute(ServerInvocation invocation, HttpTestContext
testContext) throws Exception
{
return new ErrorResponse("No default implementation");
}
-
- /**
- *
- */
- public DriverResponse execute(DriverCommand driverCommand, HttpTestContext
testContext) throws Exception
- {
- return new ErrorResponse("No default implementation");
- }
}
Deleted:
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/HttpTestDriverRegistry.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/HttpTestDriverRegistry.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/HttpTestDriverRegistry.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,58 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.test.framework.server.driver;
-
-import org.jboss.portal.common.test.driver.TestDriver;
-import org.jboss.portal.test.framework.driver.http.HttpTestDriverServer;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public interface HttpTestDriverRegistry extends HttpTestDriverServer
-{
- /**
- * Regisgter a driver.
- *
- * @param driver
- * @throws IllegalArgumentException if the driver is null or already registered
- */
- void register(TestDriver driver) throws IllegalArgumentException;
-
- /**
- * Unregister a driver.
- *
- * @param driver
- * @throws IllegalArgumentException if the driver is null or does not exist
- */
- void unregister(TestDriver driver) throws IllegalArgumentException;
-
- /**
- * Return a driver that is able to understand the specified id.
- *
- * @param itemId
- * @return
- * @throws IllegalArgumentException
- */
- TestDriver getDriver(String itemId) throws IllegalArgumentException;
-}
Deleted:
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/HttpTestDriverRegistryService.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/HttpTestDriverRegistryService.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/HttpTestDriverRegistryService.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,180 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.test.framework.server.driver;
-
-import org.jboss.portal.test.framework.driver.http.AbstractHttpTestDriverServerService;
-import org.jboss.portal.test.framework.driver.http.HttpTestContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestDriverServer;
-import org.jboss.portal.common.test.driver.DriverResponse;
-import org.jboss.portal.common.test.driver.TestDriverException;
-import org.jboss.portal.common.test.driver.TestDriver;
-import org.jboss.portal.common.test.driver.DriverCommand;
-import org.jboss.portal.common.test.info.TestItemInfo;
-import org.jboss.portal.common.test.info.TestContainerInfo;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class HttpTestDriverRegistryService extends AbstractHttpTestDriverServerService
implements HttpTestDriverRegistry
-{
-
- /** . */
- private Map _entries;
-
- /** . */
- private TestContainerInfo _container;
-
- public HttpTestDriverRegistryService()
- {
- _entries = new HashMap();
- _container = new TestContainerInfo("Main");
- }
-
- public synchronized void registerTestDriver(TestDriver test) throws
IllegalArgumentException
- {
- if (test == null)
- {
- throw new IllegalArgumentException("Cannot add null test");
- }
- TestItemInfo itemInfo = test.getInfo();
- String entryKey = itemInfo.getName();
- if (_entries.containsKey(entryKey))
- {
- throw new IllegalArgumentException("Cannot have two tests with the same id
" + entryKey);
- }
-
- //
- _container.addChild(itemInfo);
- _entries.put(entryKey, test);
- }
-
- public synchronized void unregisterTestDriver(TestDriver test) throws
IllegalArgumentException
- {
- if (test == null)
- {
- throw new IllegalArgumentException("Cannot add null test");
- }
- String entryKey = test.getInfo().getName();
- if (!_entries.containsKey(entryKey))
- {
- throw new IllegalArgumentException("Cannot remove test that was not added
previously " + entryKey);
- }
-
- //
- _entries.remove(entryKey);
- _container.removeChild(entryKey);
- }
-
- public synchronized void register(TestDriver driver)
- {
- registerTestDriver(driver);
- }
-
- public synchronized void unregister(TestDriver driver)
- {
- unregisterTestDriver(driver);
- }
-
- public TestDriver getDriver(String itemId)
- {
- TestItemInfo itemInfo = _container.findItem(itemId);
- if (itemInfo == null)
- {
- return null;
- }
-
- // Find original parent
- TestItemInfo currentInfo = itemInfo;
- while (true)
- {
- TestContainerInfo parentInfo = currentInfo.getParent();
- if (parentInfo == null)
- {
- //
- return null;
- }
- else if (parentInfo == _container)
- {
- break;
- }
- else
- {
- currentInfo = parentInfo;
- }
- }
-
- //
- return (TestDriver)_entries.get(currentInfo.getName());
- }
-
- public DriverResponse invoke(String testId, DriverCommand cmd) throws
TestDriverException
- {
- TestItemInfo item = _container.findItem(testId);
- if (item == null)
- {
- throw new TestDriverException("Driver not found for " + testId);
- }
-
- // Get associated test driver
- TestDriver driver = getDriver(testId);
-
- // Route the command to the target driver
- String newTestId = item.getId(driver.getInfo());
- return driver.invoke(newTestId, cmd);
- }
-
- public TestItemInfo getInfo()
- {
- return _container;
- }
-
- public void pushContext(String testId, HttpTestContext ctx)
- {
- TestDriver driver = getDriver(testId);
- if (driver instanceof HttpTestDriverServer)
- {
- HttpTestDriverServer httpDriver = (HttpTestDriverServer)driver;
- TestItemInfo item = _container.findItem(testId);
- String newId = item.getId(httpDriver.getInfo());
- HttpTestContext ctx2 = new HttpTestContext(newId, ctx.getRequestCount(),
ctx.getArchivePath());
- ctx2.setTestAgent(getAgent());
- httpDriver.pushContext(newId, ctx2);
- }
- }
-
- public HttpTestContext popContext(String testId)
- {
- TestDriver tmp = getDriver(testId);
- HttpTestDriverServer driver = (HttpTestDriverServer)tmp;
- TestItemInfo item = _container.findItem(testId);
- String newId = item.getId(driver.getInfo());
- HttpTestContext context = driver.popContext(newId);
- context = new HttpTestContext(context);
- context.setTestAgent(null);
- return context;
- }
-}
Deleted:
trunk/server/src/main/org/jboss/portal/test/framework/server/runner/ServerTestRunner.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/framework/server/runner/ServerTestRunner.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/server/src/main/org/jboss/portal/test/framework/server/runner/ServerTestRunner.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,104 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.test.framework.server.runner;
-
-import org.jboss.portal.test.framework.runner.BaseRunner;
-import org.jboss.portal.test.framework.server.NodeId;
-import org.jboss.portal.common.test.TestParametrization;
-import org.jboss.portal.common.test.junit.JUnitAdapter;
-import junit.framework.AssertionFailedError;
-
-import java.io.File;
-import java.net.MalformedURLException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ServerTestRunner extends BaseRunner
-{
-
- /** . */
- private String archiveName;
-
- public ServerTestRunner()
- {
- init(null);
- }
-
- public ServerTestRunner(NodeId[] nodeIds)
- {
- super(nodeIds);
- init(null);
- }
-
- public ServerTestRunner(String archiveName)
- {
- init(archiveName);
- }
-
- public ServerTestRunner(String archiveName, NodeId[] nodeIds)
- {
- super(nodeIds);
- init(archiveName);
- }
-
- private void init(String archiveName)
- {
- if (archiveName == null)
- {
- TestParametrization abc = JUnitAdapter.getParametrization();
- this.archiveName = (String)abc.getParameterValue("archive").get();
- }
- else
- {
- this.archiveName = archiveName;
- }
- }
-
- public void startRunner() throws Exception
- {
- File root = new File(getArchivePath());
- File f = new File(root, archiveName);
- deploy(f.toURL());
- }
-
- public void stopRunner()
- {
- try
- {
- File root = new File(getArchivePath());
- File f = new File(root, archiveName);
- undeploy(f.toURL());
- }
- catch (MalformedURLException e)
- {
- e.printStackTrace();
- }
- }
-
- public void testDummy()
- {
- throw new AssertionFailedError("Test dummy should not be called, it's a
place holder so that running it from ant does not fail");
- }
-}
Modified: trunk/server/src/main/org/jboss/portal/test/server/CharsetTestCase.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/CharsetTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/server/src/main/org/jboss/portal/test/server/CharsetTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.server;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified: trunk/server/src/main/org/jboss/portal/test/server/ParametersTestCase.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/ParametersTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/server/src/main/org/jboss/portal/test/server/ParametersTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.server;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified: trunk/server/src/main/org/jboss/portal/test/server/ResponseTestCase.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/ResponseTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/server/src/main/org/jboss/portal/test/server/ResponseTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.server;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified: trunk/server/src/main/org/jboss/portal/test/server/ServletTestCase.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/test/server/ServletTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/server/src/main/org/jboss/portal/test/server/ServletTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.test.server;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified: trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java
===================================================================
---
trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/server/src/main/org/jboss/portal/test/server/TestRequestController.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -28,30 +28,30 @@
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.test.driver.DriverCommand;
import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.TestDriverRegistry;
import org.jboss.portal.common.test.driver.command.StartTestCommand;
-import org.jboss.portal.test.framework.server.driver.HttpTestDriverRegistry;
-import org.jboss.portal.test.framework.server.driver.HttpTestDriverRegistryService;
+import org.jboss.portal.test.framework.driver.http.HttpTestDriverServer;
import org.jboss.portal.test.framework.server.driver.AbstractTest;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class TestRequestController extends HttpTestDriverRegistryService implements
RequestController
+public class TestRequestController extends HttpTestDriverServer implements
RequestController
{
/** . */
- private HttpTestDriverRegistry testDriverRegistry;
+ private TestDriverRegistry testDriverRegistry;
/** . */
private String currentTestId;
- public HttpTestDriverRegistry getTestDriverRegistry()
+ public TestDriverRegistry getTestDriverRegistry()
{
return testDriverRegistry;
}
- public void setTestDriverRegistry(HttpTestDriverRegistry testDriverRegistry)
+ public void setTestDriverRegistry(TestDriverRegistry testDriverRegistry)
{
this.testDriverRegistry = testDriverRegistry;
}
Modified: trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/server/src/resources/test/test-charset-sar/META-INF/jboss-service.xml 2007-03-17
02:37:08 UTC (rev 6720)
@@ -25,7 +25,7 @@
<!-- -->
<mbean
-
code="org.jboss.portal.test.framework.server.driver.HttpTestDriverRegistryService"
+ code="org.jboss.portal.test.framework.driver.http.HttpTestDriverServer"
name="portal.test:service=HttpTestDriverServer"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
@@ -40,7 +40,7 @@
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
<depends
optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
<attribute name="JndiName">HttpTestDriverServer</attribute>
- <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
+ <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
<!-- Server configuration service -->
Modified: trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/server/src/resources/test/test-parameters-sar/META-INF/jboss-service.xml 2007-03-17
02:37:08 UTC (rev 6720)
@@ -25,7 +25,7 @@
<!-- -->
<mbean
-
code="org.jboss.portal.test.framework.server.driver.HttpTestDriverRegistryService"
+ code="org.jboss.portal.test.framework.driver.http.HttpTestDriverServer"
name="portal.test:service=HttpTestDriverServer"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
@@ -40,7 +40,7 @@
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
<depends
optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
<attribute name="JndiName">HttpTestDriverServer</attribute>
- <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
+ <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
<!-- Server configuration service -->
Modified: trunk/server/src/resources/test/test-response-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/server/src/resources/test/test-response-sar/META-INF/jboss-service.xml 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/server/src/resources/test/test-response-sar/META-INF/jboss-service.xml 2007-03-17
02:37:08 UTC (rev 6720)
@@ -25,7 +25,7 @@
<!-- -->
<mbean
-
code="org.jboss.portal.test.framework.server.driver.HttpTestDriverRegistryService"
+ code="org.jboss.portal.test.framework.driver.http.HttpTestDriverServer"
name="portal.test:service=HttpTestDriverServer"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
@@ -40,7 +40,7 @@
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
<depends
optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
<attribute name="JndiName">HttpTestDriverServer</attribute>
- <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
+ <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
<!-- Server configuration service -->
Modified: trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/server/src/resources/test/test-servlet-sar/META-INF/jboss-service.xml 2007-03-17
02:37:08 UTC (rev 6720)
@@ -25,7 +25,7 @@
<!-- -->
<mbean
-
code="org.jboss.portal.test.framework.server.driver.HttpTestDriverRegistryService"
+ code="org.jboss.portal.test.framework.driver.http.HttpTestDriverServer"
name="portal.test:service=HttpTestDriverServer"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
@@ -40,7 +40,7 @@
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
<depends
optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
<attribute name="JndiName">HttpTestDriverServer</attribute>
- <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
+ <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
<!-- Server configuration service -->
Copied:
trunk/test/src/main/org/jboss/portal/test/framework/driver/AbstractTestDriverServer.java
(from rev 6712,
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/AbstractHttpTestDriverServerService.java)
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/AbstractTestDriverServer.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/AbstractTestDriverServer.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * 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.jboss.portal.test.framework.driver;
+
+import org.jboss.portal.test.framework.agent.TestAgent;
+import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.invocation.Invocation;
+
+import java.lang.reflect.Method;
+
+/**
+ * Just put here low level details such as the agent connection and the detyped
invocation stuff.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractTestDriverServer extends ServiceMBeanSupport
+{
+
+ /** . */
+ private TestAgent agent;
+
+ protected AbstractTestDriverServer()
+ {
+ }
+
+ //
+
+ public TestAgent getAgent()
+ {
+ return agent;
+ }
+
+ public void setAgent(TestAgent agent)
+ {
+ this.agent = agent;
+ }
+
+ /**
+ * Perform proxy call to ourself.
+ */
+ public Object invoke(Invocation invocation) throws Exception
+ {
+ Method method = invocation.getMethod();
+ Object[] args = invocation.getArguments();
+ return method.invoke(this, args);
+ }
+}
Deleted:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/AbstractHttpTestDriverServerService.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/AbstractHttpTestDriverServerService.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/AbstractHttpTestDriverServerService.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,80 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.test.framework.driver.http;
-
-import org.jboss.portal.test.framework.agent.TestAgent;
-import org.jboss.system.ServiceMBeanSupport;
-import org.jboss.invocation.Invocation;
-
-import java.lang.reflect.Method;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractHttpTestDriverServerService extends ServiceMBeanSupport
implements HttpTestDriverServer
-{
-
- /** . */
- private TestAgent agent;
-
- public TestAgent getAgent()
- {
- return agent;
- }
-
- public void setAgent(TestAgent agent)
- {
- this.agent = agent;
- }
-
- public void pushContext(String testId, HttpTestContext ctx)
- {
- ctx.setTestAgent(agent);
-
- //
- HttpTestContext.setCurrentContext(ctx);
- }
-
- public HttpTestContext popContext(String testId)
- {
- HttpTestContext ctx = HttpTestContext.peekCurrentContext();
-
- // We clone it because we don't want the agent to be potentially marshalled
- ctx = new HttpTestContext(ctx);
- ctx.setTestAgent(null);
-
- //
- return ctx;
- }
-
- /**
- * Perform proxy call to ourself.
- */
- public Object invoke(Invocation invocation) throws Exception
- {
- Method method = invocation.getMethod();
- Object[] args = invocation.getArguments();
- return method.invoke(this, args);
- }
-}
Added: trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestCase.java
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestCase.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,150 @@
+/******************************************************************************
+ * 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.jboss.portal.test.framework.driver.http;
+
+import org.jboss.portal.common.test.driver.TestDriverRegistry;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.command.StartTestCommand;
+import org.jboss.portal.common.test.driver.response.ErrorResponse;
+import org.jboss.portal.common.test.info.TestInfo;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+
+/**
+ * Defines an http test case working from the server side point of view.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5636 $
+ */
+public abstract class HttpTestCase implements HttpTestDriver
+{
+
+ /** The test id. */
+ protected final String testCaseId;
+
+ /** The test path. */
+ protected final String path;
+
+ /** The test info. */
+ protected TestInfo testInfo;
+
+ /** The test context. */
+ protected HttpTestContext context;
+
+ /** The driver registry, in the future we should remove that and use some kind of
external wiring mechanism. */
+ protected TestDriverRegistry testDriverRegistry;
+
+ public HttpTestCase(String testCaseId, String path)
+ {
+ if (testCaseId == null)
+ {
+ throw new IllegalArgumentException("No null test case id accepted");
+ }
+ if (path == null)
+ {
+ throw new IllegalArgumentException("No null test path accepted");
+ }
+
+ //
+ this.testCaseId = testCaseId;
+ this.path = path;
+ this.testInfo = new TestInfo(testCaseId);
+ }
+
+ public TestItemInfo getInfo()
+ {
+ return testInfo;
+ }
+
+ public TestDriverRegistry getTestDriverRegistry()
+ {
+ return testDriverRegistry;
+ }
+
+ public void setTestDriverRegistry(TestDriverRegistry testDriverRegistry)
+ {
+ this.testDriverRegistry = testDriverRegistry;
+ }
+
+ public String getTestCaseId()
+ {
+ return testCaseId;
+ }
+
+ public String getPath()
+ {
+ return path;
+ }
+
+ public void create()
+ {
+ testDriverRegistry.register(this);
+ }
+
+ public void destroy()
+ {
+ testDriverRegistry.unregister(this);
+ }
+
+ public void pushContext(String testId, HttpTestContext ctx)
+ {
+ this.context = ctx;
+ }
+
+ public HttpTestContext popContext(String testId)
+ {
+ return context;
+ }
+
+ /**
+ *
+ */
+ public DriverResponse invoke(String testId, DriverCommand cmd) throws
TestDriverException
+ {
+ if (cmd instanceof StartTestCommand)
+ {
+ return new InvokeGetResponse(path);
+ }
+ else
+ {
+ try
+ {
+ return execute(cmd, context);
+ }
+ catch (Exception e)
+ {
+ return new ErrorResponse(e);
+ }
+ }
+ }
+
+ /**
+ *
+ */
+ public DriverResponse execute(DriverCommand driverCommand, HttpTestContext
testContext) throws Exception
+ {
+ return new ErrorResponse("No default implementation");
+ }
+}
Modified:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestContext.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -41,9 +41,6 @@
public class HttpTestContext implements Serializable
{
- /** The current context. */
- private static HttpTestContext currentContext;
-
/**
* Return the current test case context.
*
@@ -52,11 +49,7 @@
*/
public static HttpTestContext getCurrentContext() throws IllegalStateException
{
- if (currentContext == null)
- {
- throw new IllegalStateException("No existing context");
- }
- return currentContext;
+ throw new UnsupportedOperationException("Don't use this API");
}
/**
@@ -66,7 +59,7 @@
*/
public static HttpTestContext peekCurrentContext()
{
- return currentContext;
+ throw new UnsupportedOperationException("Don't use this API");
}
/**
@@ -76,7 +69,7 @@
*/
public static void setCurrentContext(HttpTestContext newContext)
{
- currentContext = newContext;
+ throw new UnsupportedOperationException("Don't use this API");
}
/** The test name. */
@@ -177,10 +170,6 @@
public void setResponse(DriverResponse response)
{
-// if (response == null)
-// {
-// throw new IllegalArgumentException();
-// }
if (this.response != null)
{
throw new IllegalStateException("A response is already provided");
Copied:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriver.java (from
rev 6712,
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverServer.java)
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriver.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriver.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -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.jboss.portal.test.framework.driver.http;
+
+import org.jboss.portal.common.test.driver.TestDriver;
+
+/**
+ * Extends the test driver interface in order to provide
+ * testability of a server which interracts with a client over
+ * the http protocol.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface HttpTestDriver extends TestDriver
+{
+ /**
+ * A client side push of an http test context for a specific test.
+ */
+ void pushContext(String testId, HttpTestContext ctx);
+
+ /**
+ * A client pop of an http test context for a specific test.
+ */
+ HttpTestContext popContext(String testId);
+}
Modified:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverClient.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverClient.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverClient.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -133,15 +133,15 @@
this.serverLookup = serverLookup;
}
- private HttpTestDriverServer getServer(Node node)
+ private HttpTestDriver getServer(Node node)
{
- return (HttpTestDriverServer)serverLookup.getService(node);
+ return (HttpTestDriver)serverLookup.getService(node);
}
public TestItemInfo getInfo()
{
Node node = nodeManager.getNode(initialNodeId);
- HttpTestDriverServer server = getServer(node);
+ HttpTestDriver server = getServer(node);
return server.getInfo();
}
@@ -459,13 +459,13 @@
HttpTestContext ctx = new HttpTestContext(testId, requestCount, archivePath);
log.info("# Updating test case context of : " + node + " : "
+ ctx);
- HttpTestDriverServer agent = getServer(node);
+ HttpTestDriver agent = getServer(node);
agent.pushContext(testId, ctx);
}
private HttpTestContext popContext()
{
- HttpTestDriverServer agent = getServer(node);
+ HttpTestDriver agent = getServer(node);
return agent.popContext(testId);
}
Deleted:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverServer.java
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverServer.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverServer.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -1,42 +0,0 @@
-/******************************************************************************
- * 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.jboss.portal.test.framework.driver.http;
-
-import org.jboss.portal.common.test.driver.TestDriver;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface HttpTestDriverServer extends TestDriver
-{
- /**
- *
- */
- void pushContext(String testId, HttpTestContext ctx);
-
- /**
- *
- */
- HttpTestContext popContext(String testId);
-}
Copied:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverService.java
(from rev 6712,
trunk/server/src/main/org/jboss/portal/test/framework/server/driver/HttpTestDriverRegistryService.java)
===================================================================
---
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverService.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverService.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -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.jboss.portal.test.framework.server.driver;
+
+import org.jboss.portal.test.framework.driver.http.AbstractHttpTestDriverServerService;
+import org.jboss.portal.test.framework.driver.http.HttpTestContext;
+import org.jboss.portal.test.framework.driver.http.HttpTestDriverServer;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.TestDriver;
+import org.jboss.portal.common.test.driver.DriverCommand;
+import org.jboss.portal.common.test.info.TestItemInfo;
+import org.jboss.portal.common.test.info.TestContainerInfo;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class HttpTestDriverRegistryService extends AbstractHttpTestDriverServerService
implements HttpTestDriverRegistry
+{
+
+ /** . */
+ private Map _entries;
+
+ /** . */
+ private TestContainerInfo _container;
+
+ public HttpTestDriverRegistryService()
+ {
+ _entries = new HashMap();
+ _container = new TestContainerInfo("Main");
+ }
+
+ public synchronized void registerTestDriver(TestDriver test) throws
IllegalArgumentException
+ {
+ if (test == null)
+ {
+ throw new IllegalArgumentException("Cannot add null test");
+ }
+ TestItemInfo itemInfo = test.getInfo();
+ String entryKey = itemInfo.getName();
+ if (_entries.containsKey(entryKey))
+ {
+ throw new IllegalArgumentException("Cannot have two tests with the same id
" + entryKey);
+ }
+
+ //
+ _container.addChild(itemInfo);
+ _entries.put(entryKey, test);
+ }
+
+ public synchronized void unregisterTestDriver(TestDriver test) throws
IllegalArgumentException
+ {
+ if (test == null)
+ {
+ throw new IllegalArgumentException("Cannot add null test");
+ }
+ String entryKey = test.getInfo().getName();
+ if (!_entries.containsKey(entryKey))
+ {
+ throw new IllegalArgumentException("Cannot remove test that was not added
previously " + entryKey);
+ }
+
+ //
+ _entries.remove(entryKey);
+ _container.removeChild(entryKey);
+ }
+
+ public synchronized void register(TestDriver driver)
+ {
+ registerTestDriver(driver);
+ }
+
+ public synchronized void unregister(TestDriver driver)
+ {
+ unregisterTestDriver(driver);
+ }
+
+ public TestDriver getDriver(String itemId)
+ {
+ TestItemInfo itemInfo = _container.findItem(itemId);
+ if (itemInfo == null)
+ {
+ return null;
+ }
+
+ // Find original parent
+ TestItemInfo currentInfo = itemInfo;
+ while (true)
+ {
+ TestContainerInfo parentInfo = currentInfo.getParent();
+ if (parentInfo == null)
+ {
+ //
+ return null;
+ }
+ else if (parentInfo == _container)
+ {
+ break;
+ }
+ else
+ {
+ currentInfo = parentInfo;
+ }
+ }
+
+ //
+ return (TestDriver)_entries.get(currentInfo.getName());
+ }
+
+ public DriverResponse invoke(String testId, DriverCommand cmd) throws
TestDriverException
+ {
+ TestItemInfo item = _container.findItem(testId);
+ if (item == null)
+ {
+ throw new TestDriverException("Driver not found for " + testId);
+ }
+
+ // Get associated test driver
+ TestDriver driver = getDriver(testId);
+
+ // Route the command to the target driver
+ String newTestId = item.getId(driver.getInfo());
+ return driver.invoke(newTestId, cmd);
+ }
+
+ public TestItemInfo getInfo()
+ {
+ return _container;
+ }
+
+ public void pushContext(String testId, HttpTestContext ctx)
+ {
+ TestDriver driver = getDriver(testId);
+ if (driver instanceof HttpTestDriverServer)
+ {
+ HttpTestDriverServer httpDriver = (HttpTestDriverServer)driver;
+ TestItemInfo item = _container.findItem(testId);
+ String newId = item.getId(httpDriver.getInfo());
+ HttpTestContext ctx2 = new HttpTestContext(newId, ctx.getRequestCount(),
ctx.getArchivePath());
+ ctx2.setTestAgent(getAgent());
+ httpDriver.pushContext(newId, ctx2);
+ }
+ }
+
+ public HttpTestContext popContext(String testId)
+ {
+ TestDriver tmp = getDriver(testId);
+ HttpTestDriverServer driver = (HttpTestDriverServer)tmp;
+ TestItemInfo item = _container.findItem(testId);
+ String newId = item.getId(driver.getInfo());
+ HttpTestContext context = driver.popContext(newId);
+ context = new HttpTestContext(context);
+ context.setTestAgent(null);
+ return context;
+ }
+}
Property changes on:
trunk/test/src/main/org/jboss/portal/test/framework/driver/http/HttpTestDriverService.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/test/src/main/org/jboss/portal/test/framework/runner/ServerTestRunner.java
(from rev 6712,
trunk/server/src/main/org/jboss/portal/test/framework/server/runner/ServerTestRunner.java)
===================================================================
--- trunk/test/src/main/org/jboss/portal/test/framework/runner/ServerTestRunner.java
(rev 0)
+++
trunk/test/src/main/org/jboss/portal/test/framework/runner/ServerTestRunner.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -0,0 +1,103 @@
+/******************************************************************************
+ * 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.jboss.portal.test.framework.runner;
+
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.common.test.TestParametrization;
+import org.jboss.portal.common.test.junit.JUnitAdapter;
+import junit.framework.AssertionFailedError;
+
+import java.io.File;
+import java.net.MalformedURLException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ServerTestRunner extends BaseRunner
+{
+
+ /** . */
+ private String archiveName;
+
+ public ServerTestRunner()
+ {
+ init(null);
+ }
+
+ public ServerTestRunner(NodeId[] nodeIds)
+ {
+ super(nodeIds);
+ init(null);
+ }
+
+ public ServerTestRunner(String archiveName)
+ {
+ init(archiveName);
+ }
+
+ public ServerTestRunner(String archiveName, NodeId[] nodeIds)
+ {
+ super(nodeIds);
+ init(archiveName);
+ }
+
+ private void init(String archiveName)
+ {
+ if (archiveName == null)
+ {
+ TestParametrization abc = JUnitAdapter.getParametrization();
+ this.archiveName = (String)abc.getParameterValue("archive").get();
+ }
+ else
+ {
+ this.archiveName = archiveName;
+ }
+ }
+
+ public void startRunner() throws Exception
+ {
+ File root = new File(getArchivePath());
+ File f = new File(root, archiveName);
+ deploy(f.toURL());
+ }
+
+ public void stopRunner()
+ {
+ try
+ {
+ File root = new File(getArchivePath());
+ File f = new File(root, archiveName);
+ undeploy(f.toURL());
+ }
+ catch (MalformedURLException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void testDummy()
+ {
+ throw new AssertionFailedError("Test dummy should not be called, it's a
place holder so that running it from ant does not fail");
+ }
+}
Modified: trunk/tools/etc/buildfragments/modules.ent
===================================================================
--- trunk/tools/etc/buildfragments/modules.ent 2007-03-16 22:18:56 UTC (rev 6719)
+++ trunk/tools/etc/buildfragments/modules.ent 2007-03-17 02:37:08 UTC (rev 6720)
@@ -67,9 +67,16 @@
<path id="jboss.portal-portlet.classpath">
<pathelement
path="${jboss.portal-portlet.lib}/portal-portlet-lib.jar"/>
<pathelement
path="${jboss.portal-portlet.lib}/portal-portlet-test-lib.jar"/>
- <pathelement
path="${jboss.portal-portlet.lib}/portal-portlet-testframework-lib.jar"/>
+ <pathelement
path="${jboss.portal-portlet.lib}/portal-portlet-test-framework-lib.jar"/>
</path>
+ <!-- portlet-server -->
+ <property name="jboss.portal-portlet-server.root"
value="${project.root}/portlet-server/output"/>
+ <property name="jboss.portal-portlet-server.lib"
value="${jboss.portal-portlet-server.root}/lib"/>
+ <path id="jboss.portal-portlet-server.classpath">
+ <pathelement
path="${jboss.portal-portlet-server.lib}/portal-portlet-server-lib.jar"/>
+ </path>
+
<!-- portlet-federation -->
<property name="jboss.portal-portlet-federation.root"
value="${project.root}/portlet-federation/output"/>
<property name="jboss.portal-portlet-federation.lib"
value="${jboss.portal-portlet-federation.root}/lib"/>
Modified: trunk/wsrp/build.xml
===================================================================
--- trunk/wsrp/build.xml 2007-03-16 22:18:56 UTC (rev 6719)
+++ trunk/wsrp/build.xml 2007-03-17 02:37:08 UTC (rev 6720)
@@ -472,6 +472,8 @@
<fileset dir="${jboss.portlet-api.root}/lib"
includes="portal-api-lib.jar"/>
<fileset dir="${jboss.portal-portlet.root}/lib"
includes="portal-portlet-lib.jar,
portal-portlet-test-lib.jar"/>
+ <fileset dir="${jboss.portal-portlet-server.root}/lib"
+ includes="portal-portlet-server-lib.jar"/>
<fileset dir="${jboss.portal-portlet-federation.root}/lib"
includes="portal-portlet-federation-lib.jar"/>
<fileset dir="${jboss.portal-registration.root}/lib"
includes="portal-registration-lib.jar"/>
<fileset dir="${jboss.portal-test.lib}"
includes="portal-test-lib.jar"/>
@@ -531,6 +533,7 @@
<fileset dir="${jboss.portlet-api.root}/lib"
includes="portlet-api-lib.jar"/>
<fileset dir="${jboss.portlet-api.root}/lib"
includes="portal-api-lib.jar"/>
<fileset dir="${jboss.portal-portlet.root}/lib"
includes="portal-portlet-lib.jar"/>
+ <fileset dir="${jboss.portal-portlet-server.root}/lib"
includes="portal-portlet-server-lib.jar"/>
<fileset dir="${jboss.portal-portlet-federation.root}/lib"
includes="portal-portlet-federation-lib.jar"/>
<fileset dir="${jboss.portal-registration.root}/lib"
includes="portal-registration-lib.jar"/>
<fileset dir="${jboss.portal-test.lib}"
includes="portal-test-lib.jar"/>
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPBaseTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPBaseTest.java 2007-03-16 22:18:56
UTC (rev 6719)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/WSRPBaseTest.java 2007-03-17 02:37:08
UTC (rev 6720)
@@ -33,12 +33,12 @@
import org.jboss.portal.common.test.driver.DriverCommand;
import org.jboss.portal.common.test.driver.DriverResponse;
import org.jboss.portal.common.test.driver.TestDriverException;
+import org.jboss.portal.common.test.driver.TestDriverRegistry;
import org.jboss.portal.common.test.info.TestItemInfo;
import org.jboss.portal.common.test.junit.POJOJUnitTest;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.test.framework.driver.http.HttpTestContext;
-import org.jboss.portal.test.framework.driver.http.HttpTestDriverServer;
-import org.jboss.portal.test.framework.server.driver.HttpTestDriverRegistry;
+import org.jboss.portal.test.framework.driver.http.HttpTestDriver;
/**
* Base Class for all WSRP Test Cases
@@ -48,7 +48,7 @@
* @author <a href="mailto:Boleslaw.Dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
* @since 2.4 (Feb 20, 2006)
*/
-public abstract class WSRPBaseTest extends AbstractJBossService implements
HttpTestDriverServer
+public abstract class WSRPBaseTest extends AbstractJBossService implements
HttpTestDriver
{
Logger log = Logger.getLogger(WSRPBaseTest.class);
@@ -57,7 +57,7 @@
private POJOJUnitTest test;
/** . */
- private HttpTestDriverRegistry testDriverRegistry;
+ private TestDriverRegistry testDriverRegistry;
/** . */
private HttpTestContext context;
@@ -77,12 +77,12 @@
}
- public HttpTestDriverRegistry getTestDriverRegistry()
+ public TestDriverRegistry getTestDriverRegistry()
{
return testDriverRegistry;
}
- public void setTestDriverRegistry(HttpTestDriverRegistry testDriverRegistry)
+ public void setTestDriverRegistry(TestDriverRegistry testDriverRegistry)
{
this.testDriverRegistry = testDriverRegistry;
}
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestCase.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ConsumerTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,11 +22,11 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.consumer;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ConsumerTestCase extends ServerTestRunner
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestRunner.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestRunner.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestRunner.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,11 +22,11 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.consumer;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class MarkupTestRunner extends ServerTestRunner
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/PortletManagementTestRunner.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/PortletManagementTestRunner.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/PortletManagementTestRunner.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.wsrp.v1.consumer;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestRunner.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestRunner.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestRunner.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,11 +22,11 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.consumer;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ServiceDescriptionTestRunner extends ServerTestRunner
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestRunner.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestRunner.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestRunner.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,11 +22,11 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.producer;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class MarkupTestRunner extends ServerTestRunner
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestRunner.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestRunner.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/PortletManagementTestRunner.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,11 +22,11 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.producer;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class PortletManagementTestRunner extends ServerTestRunner
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestCase.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestCase.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ProducerTestCase.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,11 +22,11 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.producer;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ProducerTestCase extends ServerTestRunner
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestRunner.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestRunner.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/RegistrationTestRunner.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,11 +22,11 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.producer;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class RegistrationTestRunner extends ServerTestRunner
{
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestRunner.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestRunner.java 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ServiceDescriptionTestRunner.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -22,11 +22,11 @@
******************************************************************************/
package org.jboss.portal.test.wsrp.v1.producer;
-import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+import org.jboss.portal.test.framework.runner.ServerTestRunner;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision$
*/
public class ServiceDescriptionTestRunner extends ServerTestRunner
{
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java 2007-03-16
22:18:56 UTC (rev 6719)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RequestProcessor.java 2007-03-17
02:37:08 UTC (rev 6720)
@@ -53,6 +53,7 @@
import org.jboss.portal.wsrp.core.UnsupportedMimeTypeFault;
import org.jboss.portal.wsrp.core.UnsupportedModeFault;
import org.jboss.portal.wsrp.core.UnsupportedWindowStateFault;
+import org.jboss.portal.server.PortalConstants;
import javax.activation.MimeTypeParseException;
import java.security.Principal;
@@ -344,6 +345,12 @@
{
return new PortalContext()
{
+
+ public String getInfo()
+ {
+ return PortalConstants.VERSION.toString();
+ }
+
public Set getWindowStates()
{
String[] validNewWindowStates = params.getValidNewWindowStates();
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/wsrp/src/resources/tests/test-wsrp-consumer-sar/META-INF/jboss-service.xml 2007-03-17
02:37:08 UTC (rev 6720)
@@ -26,7 +26,7 @@
<!-- -->
<mbean
-
code="org.jboss.portal.test.framework.server.driver.HttpTestDriverRegistryService"
+ code="org.jboss.portal.test.framework.driver.http.HttpTestDriverServer"
name="portal.test:service=HttpTestDriverServer"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
@@ -41,7 +41,7 @@
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
<depends
optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
<attribute name="JndiName">HttpTestDriverServer</attribute>
- <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
+ <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
<!-- Dummy test WSRP Producer implementation -->
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-03-16
22:18:56 UTC (rev 6719)
+++
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-03-17
02:37:08 UTC (rev 6720)
@@ -26,7 +26,7 @@
<!-- -->
<mbean
-
code="org.jboss.portal.test.framework.server.driver.HttpTestDriverRegistryService"
+ code="org.jboss.portal.test.framework.driver.http.HttpTestDriverServer"
name="portal.test:service=HttpTestDriverServer"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
@@ -41,7 +41,7 @@
<depends
optional-attribute-name="InvokerName">jboss:service=invoker,type=jrmp</depends>
<depends
optional-attribute-name="TargetName">portal.test:service=HttpTestDriverServer</depends>
<attribute name="JndiName">HttpTestDriverServer</attribute>
- <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriverServer</attribute>
+ <attribute
name="ExportedInterfaces">org.jboss.portal.test.framework.driver.http.HttpTestDriver</attribute>
</mbean>
<!-- Webapp registry -->